Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add --disable-dev-shm-usage to chrome flags #8

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

FAUSheppy
Copy link

There is a common error for Lighthouse described here:

GoogleChrome/lighthouse-ci#504 (comment)

and here:

GoogleChrome/lighthouse#6512 (comment)

cause this error:

  LH:ChromeLauncher Killing Chrome instance 37 +1ms
Runtime error encountered: Waiting for DevTools protocol response has exceeded the allotted time. (Method: Network.setUserAgentOverride)
Traceback (most recent call last):
  File "/usr/local/lib/python3.11/dist-packages/lighthouse/runner.py", line 129, in _run
    subprocess.check_call(' '.join(command), shell=True)
  File "/usr/lib/python3.11/subprocess.py", line 413, in check_call
    raise CalledProcessError(retcode, cmd)
subprocess.CalledProcessError: Command 'lighthouse https://potaris.de/en-gb/posts/automx/  --chrome-flags="--headless --no-sandbox" --preset=perf --emulated-form-factor=desktop --output=json --output=html --output-path=/tmp/2024-01-29_15:35:48.115571_1461f67834ea4ec5a9a14e4de2ea0fdd' returned non-zero exit status 1.

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "//app/checks.py", line 151, in check_url
    result_dict.update({"lighthouse" : check_lighthouse_f(url)})
                                       ^^^^^^^^^^^^^^^^^^^^^^^
  File "//app/checks.py", line 38, in check_lighthouse_f
    report = LighthouseRunner(url, form_factor='desktop', quiet=False, timings=TIMINGS).report
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/local/lib/python3.11/dist-packages/lighthouse/runner.py", line 84, in __init__
    self._run(url, form_factor, quiet, additional_settings)
  File "/usr/local/lib/python3.11/dist-packages/lighthouse/runner.py", line 133, in _run
    raise RuntimeError(msg)
RuntimeError: Command 'lighthouse https://potaris.de/en-gb/posts/automx/  --chrome-flags="--headless --no-sandbox" --preset=perf --emulated-form-factor=desktop --output=json --output=html --output-path=/tmp/2024-01-29_15:35:48.115571_1461f67834ea4ec5a9a14e4de2ea0fdd' returned an error code: 1, output: None

as described in the Issues, this can be fixed with:

--disable-dev-shm-usage

honestly a shame that lighthouse and chrome devs are pointing fingers at each other for years about this now instead of fixing it, but uh well...

Here is a Dockerfile for testing (with my repo & changes): https://github.com/FAUSheppy/atlantis-website-monitoring/blob/master/worker/Dockerfile

Try with:

docker build . -t test; docker kill test; docker rm test; docker run --name test -d test;
docker exec -it test /bin/bash
>  python3 -i app/checks.py
>  > check_url("https://potaris.de/en-gb/posts/automx/", True, True, False)

@FAUSheppy
Copy link
Author

Bump :( ?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

1 participant