You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
It is no problem if I am running this docker image locally in windows. But meet the error when I do it in Jenkin pipeline
I do looked at the old issue which report similar in 2018. but I tried the solution to chmod 777 to the mounted volume But it is still the same
Runtime error encountered: EACCES: permission denied, open '/home/chrome/reports/lighthouse-report-mobile.json'
Error: EACCES: permission denied, open '/home/chrome/reports/lighthouse-report-mobile.json'
I found the error in the FAQ but the provided solution did not fix the error.
After some research I discovered the flag --disable-dev-shm-usage in this StackOverflow-post, which fixed the issue for me.
This also has a related chrome bug: https://issues.chromium.org/issues/40517415
It was important to have the correct permissions from the FAQ and the flag enabled.
My whole command looks like the following:
SITE_URL=$1# get the parameter
OUTPUT_DIR="$(pwd)/.ddev/reports"# target directory to save the files to# we need --disable-dev-shm-usage because of chrome bug: https://issues.chromium.org/issues/40517415
CHROME_FLAGS="--headless --disable-gpu --no-sandbox --ignore-certificate-errors --disable-dev-shm-usage --allow-insecure-localhost --silent"# Run Lighthouse for mobile
docker run --privileged --rm --name lighthouse-mobile \
--network host \
-v "$OUTPUT_DIR:/home/chrome/reports" \
-e CHROME_FLAGS="$CHROME_FLAGS" \
femtopixel/google-lighthouse "$SITE_URL" \
--output json \
--output-path "/home/chrome/reports/lighthouse-report-mobile.json" \
--form-factor mobile \
--screenEmulation.mobile \
--screenEmulation.width=360 \
--screenEmulation.height=640 \
--screenEmulation.deviceScaleFactor=2 \
--ignore-certificate-errors \
--disable-dev-shm-usage \
--allow-insecure-localhost \
--quiet
It is no problem if I am running this docker image locally in windows. But meet the error when I do it in Jenkin pipeline
I do looked at the old issue which report similar in 2018. but I tried the solution to chmod 777 to the mounted volume But it is still the same
The docker image version I am using
"Labels": {
"maintainer": "Jay MOULIN https://jaymoulin.me/femtopixel/docker-google-lighthouse http://twitter.com/MoulinJay",
"version": "v9.5.0"
}
Steps to reproduce the issue:
Fri, 08 Apr 2022 16:14:21 GMT LH:status Generating results...
Fri, 08 Apr 2022 16:14:21 GMT LH:ChromeLauncher Killing Chrome instance 27
Runtime error encountered: EACCES: permission denied, open 'lighthouse-result.html'
Error: EACCES: permission denied, open 'lighthouse-result.html'
[Pipeline] }
[Pipeline] // stage
[Pipeline] }
[Pipeline] // node
[Pipeline] End of Pipeline
ERROR: script returned exit code 1
Finished: FAILURE
The text was updated successfully, but these errors were encountered: