For some reason, in our CI, we need to run node tests inside docker container (including fetching dependencies, etc.). So, I am trying to have UI tests run as a part of docker build.
This is how my Dockerfile looks like:
FROM testcafe/testcafe:1.3.3
USER root
#some packages needed for some dependencies
RUN apk add --no-cache yarn python make build-base vim curl
RUN ln -s /opt/testcafe/docker/testcafe-docker.sh /usr/local/bin/testcafe-docker
WORKDIR /usr/src/app
RUN yarn config set registry https://private-npm-registry --global
COPY package*.json ./
RUN yarn
COPY . .
RUN yarn test:ui:ci
# "test:ui:clean": "rm -rf uitests/reports"
# "test:ui:ci-debug": "yarn test:ui:clean; testcafe-docker 'chromium --no-sandbox' uitests/tests -S -s uitests/reports/screenshots --video uitests/reports/videos -r spec,json:uitests/reports/report.json,html:uitests/reports/report.html",
# "test:ui:ci": "start-server-and-test serve http://127.0.0.1:8080 test:ui:ci-debug"
I get ERROR Unable to establish one or more of the specified browser connections. This can be caused by network issues or remote device failure.
Also, I tried using user user, but it gives permission error when creating reports folder inside uitests folder before running tests.
I tried it with and without the --no-sandbox option, got the same issue. Also tried chromium:headless --no-sandbox, got the same error.
Any suggestion, please? Thanks.
UPDATE:
Also tried with user: user (avoiding permission issue by using /tmp folder for report) and got same issue:
20-Jul-2019 23:53:33 > yarn test:ui:clean; whoami; ls -sail; testcafe-docker 'chromium --no-sandbox' uitests/tests -S -s /tmp/uitests/reports/screenshots --video /tmp/uitests/reports/videos -r spec,json:/tmp/uitests/reports/report.json,html:/tmp/uitests/reports/report.html
20-Jul-2019 23:53:33
20-Jul-2019 23:53:34 $ rm -rf /tmp/uitests/reports
20-Jul-2019 23:53:34 user
20-Jul-2019 23:53:34 total 528
20-Jul-2019 23:53:34 13 4 drwxr-xr-x 10 user user 4096 Jul 20 13:52 .
20-Jul-2019 23:53:34 12 4 drwxr-xr-x 8 root root 4096 Jul 20 13:52 ..
20-Jul-2019 23:53:34 79 4 -rw-r--r-- 1 root root 20 Jul 19 07:06 .dockerignore
20-Jul-2019 23:53:34 75 4 -rw-r--r-- 1 root root 45 Jul 19 07:06 .eslintignore
20-Jul-2019 23:53:34 83 4 -rw-r--r-- 1 root root 790 Jul 19 07:06 .eslintrc
20-Jul-2019 23:53:34 78 4 drwxr-xr-x 8 root root 4096 Jul 20 13:48 .git
20-Jul-2019 23:53:34 82 4 -rw-r--r-- 1 root root 326 Jul 20 13:48 .gitignore
20-Jul-2019 23:53:34 87 4 -rw-r--r-- 1 root root 189 Jul 19 07:06 Dockerfile
20-Jul-2019 23:53:34 81 4 -rw-r--r-- 1 root root 592 Jul 20 13:48 DockerfileUITest
20-Jul-2019 23:53:34 89 4 -rw-r--r-- 1 root root 451 Jul 19 07:06 README.md
20-Jul-2019 23:53:34 90 4 drwxr-xr-x 3 root root 4096 Jul 19 07:06 backend
20-Jul-2019 23:53:34 4096 4 drwxr-xr-x 3 user user 4096 Jul 20 13:53 build
20-Jul-2019 23:53:34 85 4 -rwxr-xr-x 1 root root 959 Jul 19 07:06 build.sh
20-Jul-2019 23:53:34 84 4 -rw-r--r-- 1 root root 1124 Jul 19 07:06 deploy.yaml
20-Jul-2019 23:53:34 91 4 drwxr-xr-x 1348 user user 4096 Jul 20 13:52 node_modules
20-Jul-2019 23:53:34 74 4 -rw-r--r-- 1 root root 2959 Jul 20 13:48 package.json
20-Jul-2019 23:53:34 76 4 drwxr-xr-x 2 root root 4096 Jul 19 07:06 public
20-Jul-2019 23:53:34 88 4 -rwxr-xr-x 1 root root 742 Jul 19 07:06 runUITestsInCI.sh
20-Jul-2019 23:53:34 77 4 drwxr-xr-x 8 root root 4096 Jul 19 07:06 src
20-Jul-2019 23:53:34 80 4 drwxr-xr-x 7 root root 4096 Jul 19 07:06 uitests
20-Jul-2019 23:53:34 86 448 -rw-r--r-- 1 root root 454847 Jul 20 13:48 yarn.lock
20-Jul-2019 23:53:34 Using locally installed version of TestCafe.
20-Jul-2019 23:55:36 ERROR Unable to establish one or more of the specified browser connections. This can be caused by network issues or remote device failure.
20-Jul-2019 23:55:36
20-Jul-2019 23:55:36 Type "testcafe -h" for help.
Update-2:
Tried with firefox as well and same issue: ERROR Unable to establish one or more of the specified browser connections. This can be caused by network issues or remote device failure.
Update-3:
Sorry for the delay. Got distracted in something else. Tried both in CI and local machine and it was same behaviour. Also tried suggestion in comment echo -e '#!/bin/sh\n/usr/bin/chromium-browser --no-sandbox --remote-debugging-port=9222 --headless' > /usr/local/bin/testcafe-docker and got following output in both CI and local env.
02-Dec-2019 18:45:17 DevTools listening on ws://127.0.0.1:9222/devtools/browser/711c6409-be9a-4e08-959e-0c994c8c5742
02-Dec-2019 18:45:17 [1202/074517.060637:ERROR:gl_implementation.cc(282)] Failed to load /usr/lib/chromium/swiftshader/libGLESv2.so: Error loading shared library /usr/lib/chromium/swiftshader/libGLESv2.so: No such file or directory
02-Dec-2019 18:45:17 [1202/074517.064824:ERROR:viz_main_impl.cc(176)] Exiting GPU process due to errors during initialization
02-Dec-2019 18:45:17 [1202/074517.072317:WARNING:dns_config_service_posix.cc(341)] Failed to read DnsConfig.
02-Dec-2019 18:45:17 [1202/074517.072782:WARNING:gpu_process_host.cc(1220)] The GPU process has crashed 1 time(s)
02-Dec-2019 18:45:17 [1202/074517.135149:ERROR:gl_implementation.cc(282)] Failed to load /usr/lib/chromium/swiftshader/libGLESv2.so: Error loading shared library /usr/lib/chromium/swiftshader/libGLESv2.so: No such file or directory
02-Dec-2019 18:45:17 [1202/074517.139203:ERROR:viz_main_impl.cc(176)] Exiting GPU process due to errors during initialization
02-Dec-2019 18:45:17 [1202/074517.143251:WARNING:gpu_process_host.cc(1220)] The GPU process has crashed 2 time(s)
02-Dec-2019 18:45:17 [1202/074517.208950:WARNING:gpu_process_host.cc(990)] Reinitialized the GPU process after a crash. The reported initialization time was 0 ms
02-Dec-2019 18:45:17 [1202/074517.209227:ERROR:gpu_channel_manager.cc(397)] ContextResult::kFatalFailure: Failed to create shared context for virtualization.
The recent 'Chromium' versions are not allow you to run them under the root user. Change the user from 'root' to user before running TestCafe tests.
Also, you need to setup permission for creating new folders.
See the detailed explanation in write in shared volumes docker
...
USER user
RUN yarn test:ui:ci
It is because of proxy. We use proxy to reach internet. I was adding http_proxy, https_proxy and no_proxy(127.0.0.1) in docker image. Browser in docker container was trying to reach testcafe server (running in same container) through proxy, because it does not use 127.0.0.1/localhost but 172.17.0.2as testcafe server host inside container. So adding 172.17.0.2 to no_proxy works.
Related
I have a VueJS app hosted on Firebase, and I'm using CloudBuild to build and deploy it. My ultimate goal is to embed a version number or commit SHA into the footer of the front page, so we can always confirm which version we're seeing in the browser. Happy to hear alternate implementations, but right now I'm just trying to write a static text file.
I know each step in CloudBuild is a unique container, and only /workspace gets held over through each step. If I execute "pwd," I do see that's where all these steps take place.
I can even write the text file as shown (my date interpolation doesn't work), and see the file exists in the subsequent step. But after the final deployment, it's not there.
- name: gcr.io/cloud-builders/gcloud
entrypoint: /bin/bash
args: ['-c', "echo \"$REVISION_ID (commit $COMMIT_SHA) deployed on `date`\" >> ./static/version.txt"]
- name: 'bash'
args: ['ls', '-lart', './static']
# Deploy
- name: 'gcr.io/cloud-builders/npm:node-10.10.0'
args: ['run', 'deploy']
the ls output shows this:
total 56
drwxr-xr-x 2 root root 4096 Apr 17 20:52 svg
drwxr-xr-x 2 root root 4096 Apr 17 20:52 styles
drwxr-xr-x 2 root root 4096 Apr 17 20:52 plugins
-rw-r--r-- 1 root root 442 Apr 17 20:52 manifest.json
drwxr-xr-x 2 root root 4096 Apr 17 20:52 legal
drwxr-xr-x 2 root root 4096 Apr 17 20:52 js
drwxr-xr-x 4 root root 4096 Apr 17 20:52 images
drwxr-xr-x 2 root root 4096 Apr 17 20:52 gifs
drwxr-xr-x 3 root root 4096 Apr 17 20:52 fonts
-rw-r--r-- 1 root root 6148 Apr 17 20:52 .DS_Store
drwxr-xr-x 12 root root 4096 Apr 17 20:59 ..
-rw-r--r-- 1 root root 132 Apr 17 21:00 version.txt
drwxr-xr-x 10 root root 4096 Apr 17 21:00 .
So I know the version.txt file gets written and persists across steps.
The npm run deploy step just runs firebase deploy. The app deploys, but the version.txt file gives a 404. Notably, I can navigate to <APP_ROOT>/static/manifest.json and open that file in the browser -- but since it is part of the git revision, maybe that doesn't tell me much.
Not sure how to proceed from here. Am I missing something about how CloudBuild works? Is there a better way to do this version thing?
i'm stuck with an artifactory problem, my artifactory webpage return a 500 status failed to initialize.
First I try to restart the service systemclt restart artifactory.service. The service start with any error output during the operation. Here the output of a systemctl status artifactory after the restart, I try to stop and start too but same result:
➜ log systemctl status artifactory.service -l
● artifactory.service - LSB: Start Artifactory on Tomcat
Loaded: loaded (/etc/init.d/artifactory)
Active: active (running) since mer. 2020-07-22 15:42:06 CEST; 1h 50min ago
Process: 4751 ExecStop=/etc/init.d/artifactory stop (code=exited, status=0/SUCCESS)
Process: 4849 ExecStart=/etc/init.d/artifactory start (code=exited, status=0/SUCCESS)
Main PID: 4915 (java)
CGroup: /system.slice/artifactory.service
‣ 4915 /usr/bin/java -Djava.util.logging.config.file=/home/artifactory/tomcat/conf/logging.properties -Djava.util.logging.manager=org.apache.juli.ClassLoaderLogManager -server -Xms512m -Xmx2g -Xss256k -XX:+UseG1GC -Djruby.compile.invokedynamic=false -Dfile.encoding=UTF8 -Dartdist=zip -Dorg.apache.tomcat.util.buf.UDecoder.ALLOW_ENCODED_SLASH=true -Dartifactory.home=/home/artifactory -Djava.endorsed.dirs=/home/artifactory/tomcat/endorsed -classpath /home/artifactory/tomcat/bin/bootstrap.jar:/home/artifactory/tomcat/bin/tomcat-juli.jar -Dcatalina.base=/home/artifactory/tomcat -Dcatalina.home=/home/artifactory/tomcat -Djava.io.tmpdir=/home/artifactory/tomcat/temp org.apache.catalina.startup.Bootstrap start
juil. 22 15:42:04 ns337904.ip-**-***-***.** artifactory[4849]: Using ARTIFACTORY_PID: /home/artifactory/run/artifactory.pid
juil. 22 15:42:04 ns337904.ip-**-***-***.** artifactory[4849]: Using CATALINA_BASE: /home/artifactory/tomcat
juil. 22 15:42:04 ns337904.ip-**-***-***.** artifactory[4849]: Using CATALINA_HOME: /home/artifactory/tomcat
juil. 22 15:42:04 ns337904.ip-**-***-***.** artifactory[4849]: Using CATALINA_TMPDIR: /home/artifactory/tomcat/temp
juil. 22 15:42:04 ns337904.ip-**-***-***.** artifactory[4849]: Using JRE_HOME: /usr
juil. 22 15:42:04 ns337904.ip-**-***-***.** artifactory[4849]: Using CLASSPATH: /home/artifactory/tomcat/bin/bootstrap.jar:/home/artifactory/tomcat/bin/tomcat-juli.jar
juil. 22 15:42:04 ns337904.ip-**-***-***.** artifactory[4849]: Using CATALINA_PID: /home/artifactory/run/artifactory.pid
juil. 22 15:42:04 ns337904.ip-**-***-***.** artifactory[4849]: Tomcat started.
juil. 22 15:42:06 ns337904.ip-**-***-***.** artifactory[4849]: Artifactory Tomcat started in normal mode
juil. 22 15:42:06 ns337904.ip-**-***-***.** systemd[1]: Started LSB: Start Artifactory on Tomcat.
But problem isn't fixed. The first error before the restart in the artifactory.log : https://pastebin.com/XEfFmN19
After the restart : https://pastebin.com/EJLAJT91
When I go to the derby.log file same error logged with no more informations. The concerned file(i think) by the error :
➜ cd /home/artifactory/data/derby/log
➜ log ll
total 257M
-rw-r--r-- 1 artifactory artifactory 256M juil. 17 01:05 log3955.dat
-rw-r--r-- 1 root artifactory 0 juil. 22 15:42 log3956.dat
-rw-r--r-- 1 artifactory artifactory 48 juil. 22 15:42 log.ctrl
-rw-r--r-- 1 artifactory artifactory 48 juil. 22 15:42 logmirror.ctrl
-rw-r--r-- 1 artifactory artifactory 532 juil. 10 2016 README_DO_NOT_TOUCH_FILES.txt
So apparently it's a size log file problem. But I don't know how to solve that.
I search in the artifactory conf and see nothing to upgrade the max allow size.
I see nothing in the artifacory docs about that. Anyway I don't know if it's the best way to handle the problem.
Thanks for help
I suggest you consider using an outside db instead of using derby
this link suggests some workarounds on reclaiming space or changing the default storage
Steps to reproduce
dotnet build or dotnet run
Expected behavior
Run or Build app
Actual Behavior
Getting ready...
The template "ASP.NET Core with Angular" was created successfully.
Processing post-creation actions...
Running 'dotnet restore' on /home/limup/Documents/Projetos/Limup/salao/salao.csproj...
/usr/share/dotnet/sdk/3.1.101/NuGet.targets(123,5): error : Unable to obtain lock file access on '/tmp/NuGetScratch/lock/b19d3901039706ea82571abad7c98ec690508d4b' for operations on '/home/limup/Documents/Projetos/Limup/salao/obj/salao.csproj.nuget.cache'. This may mean that a different user or administator is holding this lock and that this process does not have permission to access it. If no other process is currently performing an operation on this file it may mean that an earlier NuGet process crashed and left an inaccessible lock file, in this case removing the file '/tmp/NuGetScratch/lock/b19d3901039706ea82571abad7c98ec690508d4b' will allow NuGet to continue. [/home/limup/Documents/Projetos/Limup/salao/salao.csproj]
Restore failed.
Post action failed.
Description: Restore NuGet packages required by this project.
Manual instructions: Run 'dotnet restore'
Environment Data
dotnet --info
.NET Core SDK (reflecting any global.json):
Version: 3.1.101
Commit: b377529961
Runtime Environment:
OS Name: fedora
OS Version: 31
OS Platform: Linux
RID: fedora.31-x64
Base Path: /usr/share/dotnet/sdk/3.1.101/
Host (useful for support):
Version: 3.1.1
Commit: a1388f194c
.NET Core SDKs installed:
3.1.101 [/usr/share/dotnet/sdk]
.NET Core runtimes installed:
Microsoft.AspNetCore.App 3.1.1 [/usr/share/dotnet/shared/Microsoft.AspNetCore.App]
Microsoft.NETCore.App 3.1.1 [/usr/share/dotnet/shared/Microsoft.NETCore.App]
To install additional .NET Core runtimes or SDKs:
https://aka.ms/dotnet-download
Obs
Tried Fixes put in dotnet restore, but I received the same error.
Did not have this problem with dotnet sdk 2.0.
In my case, the problem was caused by ownership of the "lock file" (in Linux).
I was running dotnet build under my user (without sudo) but my project was created using sudo.
Option A)
Use sudo again
sudo dotnet build
Option B)
Change /tmp/NuGetScratch/lock/ ownership:
sudo chown -R <user>:<user> /tmp/NuGetScratch/
Then, the user can run dotnet build without sudo.
I fixed that bug with commands below:
export TMPDIR=/tmp/NuGetScratch/
mkdir -p ${TMPDIR}
but, I've been receive the other error and I opened other question post: Post
I was getting the same error in my Visual Studio 2022 when I was trying to build my new console project.
Severity Code Description Project File Line Suppression State
Error Error occurred while restoring NuGet packages: Unable to obtain
lock file access on for operations on 'NuGet.Config'. This may mean
that a different user or administrator is holding this lock and that
this process does not have permission to access it. If no other
process is currently performing an operation on this file it may mean
that an earlier NuGet process crashed and left an inaccessible lock
file, in this case removing the file will allow NuGet to continue.
The very easy fix you can do is to open your Visual Studio as an administrator and build your project.
#Omair Majid, see:
[limup#localhost tmp]$ ll -a
total 12
drwxrwxrwt. 22 root root 480 Jan 15 16:59 .
dr-xr-xr-x. 18 root root 4096 Jan 10 18:51 ..
drwx------. 2 limup limup 60 Jan 15 16:54 .esd-1000
drwxrwxrwt. 2 root root 40 Jan 15 16:49 .font-unix
drwxrwxrwt. 2 root root 60 Jan 15 16:54 .ICE-unix
drwx------. 3 root root 60 Jan 15 16:49 systemd-private-5f8b1b99edb949b1864fa2e580380675-adb.service-WzMSag
drwx------. 3 root root 60 Jan 15 16:49 systemd-private-5f8b1b99edb949b1864fa2e580380675-chronyd.service-Rw6V8i
drwx------. 3 root root 60 Jan 15 16:50 systemd-private-5f8b1b99edb949b1864fa2e580380675-colord.service-9QFuBh
drwx------. 3 root root 60 Jan 15 16:49 systemd-private-5f8b1b99edb949b1864fa2e580380675-dbus-broker.service-DqpFAf
drwx------. 3 root root 60 Jan 15 16:54 systemd-private-5f8b1b99edb949b1864fa2e580380675-fwupd.service-eBNBLh
drwx------. 3 root root 60 Jan 15 16:54 systemd-private-5f8b1b99edb949b1864fa2e580380675-geoclue.service-O6YLYg
drwx------. 3 root root 60 Jan 15 16:49 systemd-private-5f8b1b99edb949b1864fa2e580380675-ModemManager.service-hHCfHf
drwx------. 3 root root 60 Jan 15 16:49 systemd-private-5f8b1b99edb949b1864fa2e580380675-rtkit-daemon.service-3A8e9f
drwx------. 3 root root 60 Jan 15 16:49 systemd-private-5f8b1b99edb949b1864fa2e580380675-switcheroo-control.service-zSjrXg
drwx------. 3 root root 60 Jan 15 16:49 systemd-private-5f8b1b99edb949b1864fa2e580380675-systemd-logind.service-ohP23f
drwx------. 3 root root 60 Jan 15 16:50 systemd-private-5f8b1b99edb949b1864fa2e580380675-upower.service-kMAiIg
drwx------. 2 limup limup 40 Jan 15 16:58 Temp-31248c7a-04ad-429c-ab49-4c2ed74a1986
drwx------. 2 limup limup 40 Jan 15 16:58 Temp-8fa994cb-0334-4cf9-886d-103347596108
drwxrwxrwt. 2 root root 40 Jan 15 16:49 .Test-unix
drwx------. 2 limup limup 40 Jan 15 17:00 tracker-extract-files.1000
-r--r--r--. 1 limup limup 11 Jan 15 16:54 .X0-lock
-r--------. 1 gdm gdm 11 Jan 15 16:50 .X1024-lock
drwxrwxrwt. 2 root root 80 Jan 15 16:54 .X11-unix
drwxrwxrwt. 2 root root 40 Jan 15 16:49 .XIM-unix
How can check which mup version we are used in meteor?
I am using meteor 1.2.1 version.
mup command is showing below result but there is no command to check mup version.
Meteor Up: Production Quality Meteor Deployments
Valid Actions
init - Initialize a Meteor Up project
setup - Setup the server
deploy - Deploy app to server
reconfig - Reconfigure the server and restart
logs [-f -n] - Access logs
start - Start your app instances
stop - Stop your app instances
restart - Restart your app instances
You can use which mup to find out which mup you are using. Then follow the symbolic link to see where is installed, and check the content of the package.json file
e.g.
➜ ~ which mup
/home/oliver/.nvm/versions/node/v4.8.0/bin/mup
➜ ~ ls -la /home/oliver/.nvm/versions/node/v4.8.0/bin/mup
lrwxrwxrwx 1 oliver oliver 32 Jun 29 10:49 /home/oliver/.nvm/versions/node/v4.8.0/bin/mup -> ../lib/node_modules/mup/index.js
➜ ~ ls -l /home/oliver/.nvm/versions/node/v4.8.0/lib/mup
ls: cannot access '/home/oliver/.nvm/versions/node/v4.8.0/lib/mup': No such file or directory
➜ ~ ls -l /home/oliver/.nvm/versions/node/v4.8.0/lib/node_modules/mup
total 56
-rw-r--r-- 1 oliver oliver 5659 Jun 14 17:19 CHANGELOG.md
-rw-r--r-- 1 oliver oliver 3135 Jun 14 13:21 CONTRIBUTING.md
drwxr-xr-x 8 oliver oliver 4096 Jun 29 10:49 docs
-rwxr-xr-x 1 oliver oliver 65 Mar 11 02:16 index.js
drwxr-xr-x 4 oliver oliver 4096 Jun 29 10:49 lib
drwxr-xr-x 171 oliver oliver 4096 Jun 29 10:49 node_modules
-rw-r--r-- 1 oliver oliver 3972 Jun 29 10:49 package.json
-rw-r--r-- 1 oliver oliver 24283 Jun 14 13:21 README.md
➜ ~ grep _id /home/oliver/.nvm/versions/node/v4.8.0/lib/node_modules/mup/package.json
"_id": "mup#1.2.11",
➜ ~
This might be simple problem. But I am stuck with this for weeks now.
We have an AIX server in which we are facing this issue. I am not able to run programs inside a specific directory and its sub directories.
I am getting proper outputs for commands java and scp2 in /opt/FileNet directory. But when I am in /opt/FileNet/RM directory these commands stops working. Outputs are as below.
Java - JVMXM008: Error occured while initialising System ClassException in thread "main" Could not create the Java virtual machine.
SCP2 - Failed to parse installation path.
I have no idea why this is happening. Your thoughts please.
drwxr-xr-x 24 root system 4096 Feb 21 2012 opt
drwxr-xr-x 17 jxadmin wasadmin 4096 Aug 14 08:40 FileNet
drwxrwxr-x 17 jxadmin wasadmin 4096 Aug 14 08:45 RM
drwxrwxr-x 37 jxadmin wasadmin 4096 Feb 13 2012 AE (/opt/FileNet/AE, This directory is working as expected)
Couldn't find any ACLs.