PROTOCOL_TIMEOUT Errors on some urls
Hey guys, first of all, great project. I've integrated it pretty easily on circleci.
I'm having trouble running it against some urls, it's giving me a timeout error:
- lighthouse-check: Running...
❌ Something went wrong while attempting to enqueue URLs for Lighthouse. See the error below.
{ LHError: PROTOCOL_TIMEOUT
at Timeout.setTimeout [as _onTimeout] (/usr/local/lib/node_modules/@foo-software/lighthouse-check/node_modules/lighthouse/lighthouse-core/gather/driver.js:409:21)
at ontimeout (timers.js:436:11)
at tryOnTimeout (timers.js:300:5)
at listOnTimeout (timers.js:263:5)
at Timer.processTimers (timers.js:223:10)
name: 'LHError',
code: 'PROTOCOL_TIMEOUT',
friendlyMessage:
'Waiting for DevTools protocol response has exceeded the allotted time. (Method: Emulation.setScriptExecutionDisabled)',
lhrRuntimeError: true,
protocolMethod: 'Emulation.setScriptExecutionDisabled' }
The weird part is that this only happens when I'm running it on circleci or a docker container but not when I execute it using the lighthouse-check cli command from my local computer.
One of the urls I'm having trouble is: https://www.ourbranch.com
Thanks for reporting this @sebasrodriguez. My questions:
- Could you provide your config?
- With the same config, is the issue occurring only for certain URLs?
- For those URLs do the errors occur consistently or is it intermittent?
I successfully ran an audit on https://www.ourbranch.com via Automated Lighthouse Check which runs within a Docker container seen here.
PROTOCOL_TIMEOUT is a common error that I've seen for a variety of reasons, but we'll get to the bottom of it.
Hi @adamhenson.
I'll paste you a minimal config that fails consistently when I run it against https://www.ourbranch.com
version: 2.1
orbs:
lighthouse-check: foo-software/[email protected]
jobs:
lighthouse:
executor: lighthouse-check/default
steps:
- lighthouse-check/audit:
urls: https://www.ourbranch.com
workflows:
version: 2
build:
jobs:
- lighthouse
You'll need to have installed circleci locally installed and then run:
circleci config process .circleci/config.yml > process.ymlcircleci local execute -c process.yml --job lighthouse
I've tried it with a few urls under ourbranch.com and it also fails with the same error.
Thanks @sebasrodriguez. I am able to reproduce it in this test PR, so let me see what I can find.
And then when changing the URL, the issue doesn't exist as seen here. This seems to more about the Lighthouse project , CircleCI and that specific URL. I don't want to abandon this however... would like to get to the bottom of it. Could something about the relationship of CircleCI's environment and that website. Perhaps there is a legitimate timeout in that connection due to CircleCI's environment memory capacity for example and the response time of ourbranch.com. In this report for example, TTI is around 15 seconds. I'm going to keep digging for a bit.
I also tried to utilize the maxWaitForLoad option by setting it for 2 minutes without any luck. The strange part about this is the error message and that I can't reproduce it on other URLs.
protocolMethod: 'Emulation.setScriptExecutionDisabled'
Another interesting discovery. I am able to reproduce locally with the Docker image directly. So, at least we can rule out CircleCI.
docker run foosoftware/lighthouse-check:latest \
lighthouse-check --verbose \
--urls "https://www.ourbranch.com"
Hi @sebasrodriguez - #15 seems to fix the issue. I've confirmed it works with www.ourbranch.com. Please give it a shot and let me know. You shouldn't have to do anything on your end... just trigger another build.
The exact details of the cause is unknown. I discovered the only difference in the way we run things on Automated Lighthouse Check was a different version of Alpine in Docker. Making that change in #15 fixes the issue.
Closing this, but please do confirm or let me know if you face any further issues regarding this.
Hi @adamhenson thank you so much for taking the time in troubleshooting this. I've used the latest version and it worked great 👏
It's weird that just bumping the node version seems to fix it but anyway. Thanks again.