-
Notifications
You must be signed in to change notification settings - Fork 9.4k
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
☂️ PROTOCOL_TIMEOUT #6512
Comments
Lighthouse Version: 3.3.0.4001
Very strange - I just ran LightHouse successfully 2 days ago on this site. |
As a temporary solution, is there a way to increase this timeout ? |
No (unless you want to modify the source code). The timeout is 30s which is very generous for most protocol requests. If you are experiencing this error, I wouldn't expect increasing the timeout beyond 30s to fix it. |
Is there a way to catch this error at least ? I have tried to get around this by adding some retry logic but to no avail. The error somehow gets around the try catch block and a .catch statement to kill the whole process const runLighthouseTest = async (page, urlPath, options, config, maxRetries = 3) => {
let retries = 0;
while (retries < maxRetries) {
try {
const result = await lighthouse(`${baseUrl}${urlPath}`, options, config, page).catch(
error => {
throw error;
}
);
return result;
} catch (error) {
logger.error(
`Lighthouse test for page ${urlPath} failed on attempt ${retries + 1}: ${error}`
);
retries++;
if (retries === maxRetries) {
throw new Error(
`Failed to run Lighthouse test for page ${urlPath} after ${maxRetries} attempts`
);
}
}
}
}; |
@Moro-Code try adding an uncaught rejection handler. |
@patrickhulce while this would prevent the script from crashing not sure how I would initiate a retry of running a report using this method |
Today i had the same case run Lighthouse programmatically in Docker. Local and from CMD was everything fine.
|
Extension Error: PROTOCOL_TIMEOUT Method: Network.emulateNetworkConditions |
Same issue here using sitespeed: |
I ran into some issues attempting to run the current image of lighthouse through the python script. In order to fix this I needed to update the lighthouse dockerfile. This updates the lighthouse dockerfile to use Node.js 18-slim instead of Alpine. This will also install the latest version of lighthouse which is currently on version 10.3.0. Lastly this will set a couple of environment variables to configure Chromium. The `CHROME_PATH` is needed so that lighthouse will know where to find Chromium. This will also set the some flags for the chromium browser so we don't need to manually set them when running lighthouse. The flags will ensure chromium runs in headless mode and will disable the sandbox which is need when the container is ran as root. I also needed to add the flag "--disable-dev-shm-usage" to prevent chromium from crashing when running in docker. GoogleChrome/lighthouse#6512 (comment)
Method: Emulation.setScriptExecutionDisabled |
Method: Runtime.evaluate |
This is so frustrating. It just doesn't work at scale. Constantly getting this protocol error and getting this since 2018.
|
Was hitting this timeout since upgrading from lighthouse 11.0.0 to 11.5.0. Rolling back to 11.4.0 resolved the issue for me, FWIW. |
|
"lighthouse": "11.6.0" |
Runtime.evaluate from getBenchmarkIndex |
Method: Debugger.disable |
Method: Network.getResponseBody |
tl;dr - Chrome sometimes stops responding, most commonly when trying to clear the cache, so uncheck "Clear storage" and try again.
Explanation
This is the umbrella ☂️ issue for all
PROTOCOL_TIMEOUT
error reports. We're collecting all of them in a single place so that we can easily identify which protocol methods are most problematic to prioritize to Chromium domain owners.PROTOCOL_TIMEOUT
refers to the situation when Lighthouse has been waiting for Chrome to respond to a single command for more than 30 seconds.PROTOCOL
refers to the Chrome DevTools Protocol connection that Lighthouse uses to talk to Chrome.If you experienced a protocol timeout issue, please just comment here with the method name, e.g.
Network.clearBrowserCache
More recent update: #6512 (comment)
The text was updated successfully, but these errors were encountered: