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

Lighthouse could not test page - LHError: PROTOCOL_TIMEOUT #108

Open
UladzislauCharkouski opened this issue Sep 13, 2022 · 5 comments
Open

Comments

@UladzislauCharkouski
Copy link

UladzislauCharkouski commented Sep 13, 2022

Your question

Hi
I'm trying to test pages with sitespeedio/sitespeed.io:25.11.0-plus1
But receiving the error:
ERROR: Lighthouse could not test http://localhost:3000/testPage please create an upstream issue: https://github.com/GoogleChrome/lighthouse/issues/new?assignees=&labels=bug&template=bug-report.yml LHError: PROTOCOL_TIMEOUT
at /lighthouse/node_modules/lighthouse/lighthouse-core/gather/driver.js:348:50.....

After researching, one possible solution that could help is to add a chrome flag "--disable-dev-shm-usage" (GoogleChrome/lighthouse#6512)
But none of the options for passing flags to the lighthouse plugin, as I see it, does not work for me (from --lighthouse.config config.js or --lighthouse.flags flag.json)
And as I see here https://github.com/sitespeedio/plugin-lighthouse/blob/main/index.js#L36-L68 the chrome flags are already set but without the ability to pass additional flags into it (maybe I'm wrong).
@soulgalore could you please tell me if there are any other ways to pass chrome flags to the lighthouse plugin?
Or maybe there are other ways to fix the error?

@soulgalore
Copy link
Member

Hi @UladzislauCharkouski inside the Docker container localhost is inside the container, wanted to check if you followed https://www.sitespeed.io/documentation/sitespeed.io/docker/#access-localhost so you can access it on the machine instead?

@UladzislauCharkouski
Copy link
Author

@soulgalore thanks for the quick response
Yes, I use this flag and sitespeed has access and measures correctly.
The container runs in Kubernetes in the same pod as the application.
here are my options: -v ${WORKSPACE}:/sitespeed.io --network=host --cap-add=NET_ADMIN --entrypoint='' -u root --outputFolder output -n 5 --mobile --browsertime.connectivity.engine=throttle --browsertime.connectivity.profile 3gfast --config sitespeed_config.json

@max-perepelov
Copy link

Getting the same issue but not for localhost. All configs are pretty much default. I tried to add the param that @UladzislauCharkouski suggested but no luck.

    "browsertime": {
        "iterations": 1,
        "browser": "chrome"
    },
    "chrome": {
        "args": [
            "disable-dev-shm-usage"
        ]
    }

Is that should be considered as Lighthouse issue?

@UladzislauCharkouski
Copy link
Author

@max-perepelov
"--shm-size=1g" flag resolved my issue
example: docker run --shm-size=1g --rm -v "$(pwd):/sitespeed.io" sitespeedio/sitespeed.io:26.1.0-plus1 https://www.sitespeed.io/

@soulgalore
Copy link
Member

@max-perepelov that will disable dev-shm for Browsertime, not Lighthouse (it starts there own version of Chrome). I think the easiest is if I add that disable-dev-shm-usage by default for Lighthouse and see if it helps.

@soulgalore soulgalore transferred this issue from sitespeedio/sitespeed.io Oct 25, 2022
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

No branches or pull requests

3 participants