lighthouse: ☂️ PROTOCOL_TIMEOUT

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: https://github.com/GoogleChrome/lighthouse/issues/6512#issuecomment-924123935

About this issue

  • Original URL
  • State: open
  • Created 6 years ago
  • Reactions: 142
  • Comments: 360 (23 by maintainers)

Commits related to this issue

Most upvoted comments

I also experienced this bug in the programmatic usage with the lighthouse. I request to consider this as important

@Yasuslik thanks for the link, I managed to fix it with lighthouse --chrome-flags="--disable-dev-shm-usage" 🥳

I too have observed the same issues on our docker container and saw many of the same error messages, sometimes they did not error from the same points in the stack trace. 🤷‍♀️


2021-03-10T09:58:28.766-08:00 | Run #1...failed!
-- | --
  | 2021-03-10T09:58:28.767-08:00 | Error: Lighthouse failed with exit code 1
  | 2021-03-10T09:58:28.767-08:00 | at ChildProcess.<anonymous> (/usr/local/lib/node_modules/@lhci/cli/src/collect/node-runner.js:120:21)
  | 2021-03-10T09:58:28.767-08:00 | at ChildProcess.emit (events.js:315:20)
  | 2021-03-10T09:58:28.767-08:00 | at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
  | 2021-03-10T09:58:28.767-08:00 | Wed, 10 Mar 2021 17:54:30 GMT ChromeLauncher Waiting for browser.
  | 2021-03-10T09:58:28.767-08:00 | Wed, 10 Mar 2021 17:54:30 GMT ChromeLauncher Waiting for browser...
  | 2021-03-10T09:58:28.767-08:00 | Wed, 10 Mar 2021 17:54:30 GMT ChromeLauncher Waiting for browser.....
  [removed for brevity]
  | 2021-03-10T09:58:28.767-08:00 | Wed, 10 Mar 2021 17:55:18 GMT waitFor:warn Timed out waiting for page load. Checking if page is hung...
  | 2021-03-10T09:58:28.767-08:00 | Wed, 10 Mar 2021 17:55:19 GMT waitFor:warn Page appears to be hung, killing JavaScript...
  | 2021-03-10T09:58:28.767-08:00 | Wed, 10 Mar 2021 17:55:49 GMT status Disconnecting from browser...
  | 2021-03-10T09:58:28.767-08:00 | Wed, 10 Mar 2021 17:55:49 GMT ChromeLauncher Killing Chrome instance 66
  | 2021-03-10T09:58:28.767-08:00 | Runtime error encountered: Waiting for DevTools protocol response has exceeded the allotted time. (Method: Emulation.setScriptExecutionDisabled)
  | 2021-03-10T09:58:28.767-08:00 | LHError: PROTOCOL_TIMEOUT
  | 2021-03-10T09:58:28.767-08:00 | at Timeout._onTimeout (/usr/local/lib/node_modules/@lhci/cli/node_modules/lighthouse/lighthouse-core/gather/driver.js:399:21)
  | 2021-03-10T09:58:28.767-08:00 | at listOnTimeout (internal/timers.js:549:17)
  | 2021-03-10T09:58:28.767-08:00 | at processTimers (internal/timers.js:492:7)

Running it locally by installing the lhci commandline tools and using lhci collect with the same settings as before gave a more insightful error object than in my AWS logs:

  "runWarnings": [
    "The page did not paint any content. Please ensure you keep the browser window in the foreground during the load and try again. (NO_FCP)"
  ],
  "runtimeError": {
    "code": "NO_FCP",
    "message": "The page did not paint any content. Please ensure you keep the browser window in the foreground during the load and try again. (NO_FCP)"
  },

What fixed this for me:

Passing --collect.settings.maxWaitForFcp="45000" seemed to do the trick. As of this post the default looks like 30 seconds.

https://github.com/GoogleChrome/lighthouse/blob/315c3678db586d5b1c1d76383fbbb3ad48a8ed6b/types/externs.d.ts#L153 https://github.com/GoogleChrome/lighthouse/blob/777bf1147fd0f6aca16ffefde1350bf6297476d4/lighthouse-core/config/constants.js#L97

I understand that’s a high number of 45 seconds, but you can see why I am keen to get this up and running. :p Hope this helps other people if your lighthouse containers are erroring in the same way. I was stuck on this for longer than I would care to admit…

Adding these chrome flags greatly improved performance for me (using lhci in cypress/browsers:node14.17.6-chrome100-ff98 docker image):

	'--headless',
	'--disable-gpu',
	'--disable-dev-shm-usage',
	'--no-first-run'

We went from 5:50 to 2:20 for lhci collect We’ll have to see, if PROTOCOL_TIMEOUT now still occurs.

Posting again, for anyone else having issues with this - we fixed our issue with the --disable-dev-shm-usage Chrome flag. With that flag in place we were also able to stop skipping the full-page-screenshot audit. 😎

See: https://github.com/codeenigma/ce-deploy/blob/lhci-chrome-fix-plus-docs_PR_devel/roles/lhci_run/defaults/main.yml#L16

Lighthouse 7.4.0 executed via “lighthouse-batch 7.1.0” (shell)

Method: Network.enable Environment: gitlab-ci Image: Alpine 3.11 + Nodejs 14.x LTS Chromium: chromium@edge (91.0.4472.77-r0) (via edge package) Additional pkg: harfbuzz ca-certificates “freetype>2.8” ttf-freefont nss Error rate: 100%

LH Params: none (except --port <puppeteer browser port>) Chromium Params: --no-sandbox --disable-dev-shm-usage --in-process-gpu Additional Info: We use puppeteer to spawn the browser, and then let the LH uses that instance via wsEndpoint()

Stack Trace:

Wed, 09 Jun 2021 08:09:59 GMT config:warn IFrameElements gatherer requested, however no audit requires it.
Wed, 09 Jun 2021 08:09:59 GMT config:warn FormElements gatherer requested, however no audit requires it.
Wed, 09 Jun 2021 08:09:59 GMT status Connecting to browser
Wed, 09 Jun 2021 08:09:59 GMT status Resetting state with about:blank
Wed, 09 Jun 2021 08:10:29 GMT status Disconnecting from browser...
Runtime error encountered: Waiting for DevTools protocol response has exceeded the allotted time. (Method: Network.enable)
LHError: PROTOCOL_TIMEOUT
    at Timeout.<anonymous> (/builds/**CENSORED**/node_modules/lighthouse/lighthouse-core/gather/driver.js:322:21)
    at listOnTimeout (internal/timers.js:554:17)
    at processTimers (internal/timers.js:497:7)

It seems “resetting state with about:blank” somehow makes it stuck.

Not sure if it’s gonna help someone, but I had to remove the full-page-screenshot audit from my config to get around this problem:

"skipAudits": ["full-page-screenshot"]

I’m getting this error for about 90% of runs against https://www.eyebuydirect.com/eyeglasses/women. Seems to happen more often on EC2 than it does on my local machine.

Thu, 24 Dec 2020 02:33:50 GMT status Disconnecting from browser...
Runtime error encountered: Waiting for DevTools protocol response has exceeded the allotted time. (Method: Runtime.evaluate)
LHError: PROTOCOL_TIMEOUT
    at Timeout._onTimeout (/usr/lib/node_modules/lighthouse/lighthouse-core/gather/driver.js:399:21)
    at listOnTimeout (internal/timers.js:554:17)
    at processTimers (internal/timers.js:497:7)

This is with Lighthouse 7.0. Same problem on 6.1.1 and 6.5.0.

Still getting this error: PROTOCOL_TIMEOUT

Channel: DevTools
Initial URL: https://cookpad.com/in
Chrome Version: 84.0.4147.89
Stack Trace: LHError: PROTOCOL_TIMEOUT
    at eval (devtools://devtools/remote/serve_file/@19abfe7bcba9318a0b2a6bc6634a67fc834aa592/lighthouse_worker/lighthouse_worker_module.js:1453:229)

Chrome version: Version 84.0.4147.89 (Official Build) (64-bit)

@tw-360vier

Adding these chrome flags greatly improved performance for me (using lhci in cypress/browsers:node14.17.6-chrome100-ff98 docker image):

	'--headless',
	'--disable-gpu',
	'--disable-dev-shm-usage',
	'--no-first-run'

We were also having an issue with a protocol timeout at Driver.sendCommandToSession for a certain test, and another one returning null, when running lighthouse in a tekton pipeline. Adding these flags to our chrome launch resolved the issue. Thanks!

PROTOCOL_TIMEOUT

Channel: DevTools
Initial URL: https://developers.google.com/web/updates/2020/05/devtools?utm_source=devtools#issues
Chrome Version: 84.0.4147.89
Stack Trace: LHError: PROTOCOL_TIMEOUT
    at eval (devtools://devtools/remote/serve_file/@19abfe7bcba9318a0b2a6bc6634a67fc834aa592/lighthouse_worker/lighthouse_worker_module.js:1453:229)

Getting this error on an internal app, how do I fix this?

Screenshot 2022-01-17 at 2 34 01 AM

PROTOCOL_TIMEOUT

Channel: DevTools
Initial URL: https://admin-seltos.dev.cashmycar.olx.in/en-in/car/edit/45ca3a4c-4b7b-4b21-8beb-ced2a5451374/
Chrome Version: 97.0.4692.71
Stack Trace: LHError: PROTOCOL_TIMEOUT
    at devtools://devtools/bundled/devtools-frontend/front_end/third_party/lighthouse/lighthouse-dt-bundle.js:503:713

A few notes for everyone here…

This is not a single issue that has a single fix. This is the catch-all error name for any time that Chrome stops responding to Lighthouse’s commands. There are likely thousands of different reasons this is happening across everyone who has chimed in here.

There are, however, some very common reasons this happens, but nothing can really be done about them in Lighthouse (and sometimes not by anyone but the site owner, Lighthouse can obviously do other things than this specific error message but none that would allow the analysis to be valid after this occurs).

  • The page being analyzed enters an infinite loop that locks the Chrome DevTools Protocol. Sometimes this is intentional by the site (i.e. user-agent sniffing for Lighthouse and intentionally making it unauditable), other times this is an accidental bug (common case is when Lighthouse tries to request an image that is blocked, the page has onerror="this.src='/404'" which is an infinite loop).
  • Failing to use --disable-dev-shm-usage Chrome flag in container-like environments.
  • A Chromium bug that prevents a response in Chrome DevTools Protocol (historical examples exist, but we have yet to be provided with a consistent repro that takes this form on latest Chromium)

As always, if anyone has a consistent repro for a specific URL that doesn’t fall into one of the top 2 cases. Please forward it our way and we’ll be happy to look into if it’s something that can be fixed in Chromium.

WHEN RUNNING WITH Applied Fast 3G throttling…

PROTOCOL_TIMEOUT
Channel: DevTools
Initial URL: https://www.woolaroc.org/become-a-member
Chrome Version: 75.0.3770.142
Stack Trace: LHError: PROTOCOL TIMEOUT
    at eval (chrome-devtools://devtools/remote/serve_file/@8d93477bd18154c67a70a67019cb8032382c55dd/audits2_worker/audits2_worker_module.js:1190:210)

Sometimes get this instead…

NO_FCP
Channel: DevTools
Initial URL: https://www.woolaroc.org/become-a-member
Chrome Version: 75.0.3770.142
Stack Trace: LHError: NO_FCP
    at eval (chrome-devtools://devtools/remote/serve_file/@8d93477bd18154c67a70a67019cb8032382c55dd/audits2_worker/audits2_worker_module.js:1219:206)

Does not happen with No throttling selected.

2019-07-22_1620

{ "code":"PROTOCOL_TIMEOUT", "friendlyMessage": "Waiting for DevTools protocol response has exceeded the allotted time. (Method: Emulation.setScriptExecutionDisabled)", "level": "error", "lhrRuntimeError": true, "protocolMethod": "Debugger.disable" }

“lighthouse”: “11.6.0”

Runtime.evaluate

i’m also seeing this issue in our Gitlab CI pipeline using lhci:

Runtime error encountered: Waiting for DevTools protocol response has exceeded the allotted time. (Method: Emulation.setScriptExecutionDisabled)
LHError: PROTOCOL_TIMEOUT
    at /usr/local/lib/node_modules/@lhci/cli/node_modules/lighthouse/lighthouse-core/gather/driver.js:341:50
    at new Promise (<anonymous>)
    at Driver.sendCommandToSession (/usr/local/lib/node_modules/@lhci/cli/node_modules/lighthouse/lighthouse-core/gather/driver.js:339:28)
    at Driver.sendCommand (/usr/local/lib/node_modules/@lhci/cli/node_modules/lighthouse/lighthouse-core/gather/driver.js:362:17)
    at /usr/local/lib/node_modules/@lhci/cli/node_modules/lighthouse/lighthouse-core/gather/driver/wait-for-condition.js:469:23
    at async Promise.all (index 0)
    at async Object.gotoURL (/usr/local/lib/node_modules/@lhci/cli/node_modules/lighthouse/lighthouse-core/gather/driver/navigation.js:120:26)
    at async Function.loadPage (/usr/local/lib/node_modules/@lhci/cli/node_modules/lighthouse/lighthouse-core/gather/gather-runner.js:[74](https://gitlab.com/360vier/clients/cognos/hsf019-gutenberg-blocks/-/jobs/2406797515#L74):36)
    at async Function.runPass (/usr/local/lib/node_modules/@lhci/cli/node_modules/lighthouse/lighthouse-core/gather/gather-runner.js:586:49)
    at async Function.run (/usr/local/lib/node_modules/@lhci/cli/node_modules/lighthouse/lighthouse-core/gather/gather-runner.js:509:29)

I feel obligated to say that if you use identical flags from the CLI and if you use the same CHROME_PATH, there is no fundamental difference from your script and the CLI (the CLI does exactly what this script does using chrome-launcher), and I strongly suspect some other unobserved difference to be really at play here @Axection. My best guess is that the flags were not being passed properly in the CLI because omitting --disable-dev-shm-usage will absolutely give you the behavior you describe.

Hi - any progress on this?

We are running the Lighthouse@6.5.0 in a docker image and are facing the Emulation.setScriptExecutionDisabled timeouts for desktop emulation.

The chrome launcher settings are:

[
    '--headless',
    '--disable-gpu',
    '--disable-storage-reset',
    '--emulated-form-factor',
    '--no-sandbox',
  ],

the lighthouse settings are:

{
  "formatKey": "lighthouse",
  "extends": "lighthouse:default",
  "settings": {
    "throttlingMethod": "provided",
    "skipAudits": [
      "font-display",
      "final-screenshot",
      "is-on-https",
      "screenshot-thumbnails",
      "user-timings",
      "main-thread-tasks",
      "largest-contentful-paint-element",
      "long-tasks",
      "no-document-write",
      "color-contrast"
    ],
    "onlyCategories": [
      "performance",
      "accessibility"
    ],
    "emulatedFormFactor": "desktop",
    "maxWaitForFcp": 45000,
    "maxWaitForLoad": 60000
  }
}

we kill and respawn chrome before each run against an url but still see:

LighthouseError [LHError]: PROTOCOL_TIMEOUT
    at Timeout._onTimeout (/home/chrome/app/web-metrics-cron/node_modules/lighthouse/lighthouse-core/gather/driver.js:382:21)
    at listOnTimeout (internal/timers.js:554:17)
    at processTimers (internal/timers.js:497:7) {
  code: 'PROTOCOL_TIMEOUT',
  friendlyMessage: 'Waiting for DevTools protocol response has exceeded the allotted time. (Method: Emulation.setScriptExecutionDisabled)',
  lhrRuntimeError: true,
  protocolMethod: 'Emulation.setScriptExecutionDisabled'
}

Props 🤲 to https://github.com/GoogleChrome/lighthouse/issues/6512#issuecomment-797152215 which fixed this type of timeout for us.

To run in docker and run in gitlab-ci you need use it solution https://github.com/GoogleChrome/lighthouse/issues/9212#issuecomment-607276050

In docker have troble with /dev/shm

i mouned volume to /dev/shm and problem has sold

docker-compose.yml

version: "3.7"
services:
  lightci:
    image: cypress/browsers:node14.15.0-chrome86-ff82
    container_name: lightci
    volumes:
      - ./:/var/www/lighthouse
      - lightci-shm:/dev/shm
    tty: true
    stdin_open: true
    working_dir: /var/www/lighthouse

volumes:
  lightci-shm:

I’ve already been using the flags you mentioned:

[
    '--disable-dev-shm-usage',
    '--disable-gpu',
    '--headless',
    '--ignore-certificate-errors',
    '--no-sandbox'
]

I run Lighthouse on hundreds of other URLs, but for some reason these two consistently PROTOCOL_TIMEOUT. But, oddly 1 out of 10 runs or so, they don’t.

I am getting the following error when running Lighthouse:

PROTOCOL_TIMEOUT

Channel: DevTools
Initial URL: https://reviewsinscope.com/
Chrome Version: 85.0.4183.121
Stack Trace: LHError: PROTOCOL_TIMEOUT
    at eval (devtools://devtools/remote/serve_file/@a81aa729a8e1fd413943a339393c82e7b8055ddc/lighthouse_worker/lighthouse_worker_module.js:1453:229)

Thanks @PeppyH,

adding the --disable-dev-shm-usage flag is solving the issue for me!

I was running into the errors below running inside docker in gitlab CI - this was caused by the following

“By default, Docker runs a container with a /dev/shm shared memory space 64MB. This is typically too small for Chrome and will cause Chrome to crash when rendering large pages. To fix, run the container with docker run --shm-size=1gb to increase the size of /dev/shm. Since Chrome 65, this is no longer necessary. Instead, launch the browser with the --disable-dev-shm-usage flag” - https://developers.google.com/web/tools/puppeteer/troubleshooting

$ lhci autorun
✅  .lighthouseci/ directory writable
✅  Configuration file found
✅  Chrome installation found
✅  Ancestor hash determinable
✅  LHCI server reachable
✅  LHCI server API-compatible
✅  LHCI server token valid
✅  LHCI server unique build for this hash
Healthcheck passed!

Started a web server on port 33284...
Running Lighthouse 3 time(s) on http://localhost:33284/index.html
Run #1...failed!
Error: Lighthouse failed with exit code 1
    at ChildProcess.<anonymous> (/usr/local/lib/node_modules/@lhci/cli/src/collect/node-runner.js:103:21)
    at ChildProcess.emit (events.js:314:20)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
Mon, 12 Oct 2020 23:59:58 GMT ChromeLauncher Waiting for browser.
Mon, 12 Oct 2020 23:59:58 GMT ChromeLauncher Waiting for browser...
Mon, 12 Oct 2020 23:59:58 GMT ChromeLauncher Waiting for browser.....
Mon, 12 Oct 2020 23:59:59 GMT ChromeLauncher Waiting for browser.......
Mon, 12 Oct 2020 23:59:59 GMT ChromeLauncher Waiting for browser.........
Tue, 13 Oct 2020 00:00:00 GMT ChromeLauncher Waiting for browser...........
Tue, 13 Oct 2020 00:00:00 GMT ChromeLauncher Waiting for browser.............
Tue, 13 Oct 2020 00:00:01 GMT ChromeLauncher Waiting for browser...............
Tue, 13 Oct 2020 00:00:01 GMT ChromeLauncher Waiting for browser...............✓
Tue, 13 Oct 2020 00:00:01 GMT config:warn IFrameElements gatherer requested, however no audit requires it.
Tue, 13 Oct 2020 00:00:01 GMT config:warn FormElements gatherer requested, however no audit requires it.
Tue, 13 Oct 2020 00:00:01 GMT status Connecting to browser
Tue, 13 Oct 2020 00:00:01 GMT status Resetting state with about:blank
Tue, 13 Oct 2020 00:00:01 GMT status Benchmarking machine
Tue, 13 Oct 2020 00:00:02 GMT status Initializing…
Tue, 13 Oct 2020 00:00:02 GMT status Running defaultPass pass CSSUsage, JsUsage, ViewportDimensions, RuntimeExceptions, ConsoleMessages, AnchorElements, ImageElements, LinkElements, MetaElements, ScriptElements, IFrameElements, FormElements, MainDocumentContent, GlobalListeners, AppCacheManifest, Doctype, DOMStats, OptimizedImages, PasswordInputsWithPreventedPaste, ResponseCompression, TagsBlockingFirstPaint, FontSize, EmbeddedContent, RobotsTxt, TapTargets, Accessibility, TraceElements, InspectorIssues, SourceMaps
Tue, 13 Oct 2020 00:00:02 GMT status Resetting state with about:blank
Tue, 13 Oct 2020 00:00:02 GMT status Setting up network for the pass trace
Tue, 13 Oct 2020 00:00:02 GMT status Beginning devtoolsLog and trace
Tue, 13 Oct 2020 00:00:02 GMT status Loading page & waiting for onload
Tue, 13 Oct 2020 00:00:47 GMT Driver:warn Timed out waiting for page load. Checking if page is hung...
Tue, 13 Oct 2020 00:00:48 GMT Driver:warn Page appears to be hung, killing JavaScript...
Tue, 13 Oct 2020 00:01:18 GMT status Disconnecting from browser...
Tue, 13 Oct 2020 00:01:18 GMT ChromeLauncher Killing Chrome instance 64
Tue, 13 Oct 2020 00:01:18 GMT GatherRunner disconnect:error read ECONNRESET
Runtime error encountered: Waiting for DevTools protocol response has exceeded the allotted time. (Method: Emulation.setScriptExecutionDisabled)
LHError: PROTOCOL_TIMEOUT
    at Timeout._onTimeout (/usr/local/lib/node_modules/@lhci/cli/node_modules/lighthouse/lighthouse-core/gather/driver.js:352:21)
    at listOnTimeout (internal/timers.js:554:17)
    at processTimers (internal/timers.js:497:7)

Adding the flag ‘–disable-dev-shm-usage’ to the collect settings solved the issue as per the explaination above. Posting this in case someone else encounters the same problem

I thought this would be fixed in upcoming updates, but waiting for more than 5 to 6 updates. Nothing changed.

PROTOCOL_TIMEOUT

Channel: DevTools
Initial URL: https://www.olx.in/
Chrome Version: 85.0.4183.121
Stack Trace: LHError: PROTOCOL_TIMEOUT
    at eval (devtools://devtools/remote/serve_file/@a81aa729a8e1fd413943a339393c82e7b8055ddc/lighthouse_worker/lighthouse_worker_module.js:1453:229)

If you’re getting the eval error at lighthouse_worker_module.js:1453:229 please visit the follow up issue #11215 and give it a thumbs up.

Please don’t do this anyone. lighthouse_worker_module.js:1453:229 is just the line that creates this error, literally everyone running into this in devtools will have this as their stack trace. This is the correct place to track PROTOCOL_TIMEOUT.

As stated in the issue description this error happens when Chrome stops responding to Lighthouse commands. Obviously, this also means we can’t get any extra information from Chrome about why this happened because Chrome wouldn’t respond*. In very rare circumstances that are actually reproducible (https://github.com/GoogleChrome/lighthouse/issues/11124) there is something Lighthouse can do about it, but 99% of the URLs shared here do not reproduce in a clean Chrome environment, meaning it’s specific to the device and there’s not much we can do to investigate.

We’ve been thinking about ways to recover from this situation, but it will pretty much always involve some loud annoying error like this until whatever causes Chrome to stop responding is fixed.

Most reliable fix I’ve found (that also works with k8s) is to add flag --disable-dev-shm-usage to disable shared memory.

Any idea why would this happen?

It seems to happen when I run from Gitlab CI, locally doesn’t have any issues.

I can try later on configuring a bigger server as CI runner in Gitlab

I’m running the tests on a couple of pages, two of them work fine, two of them timeout with that error.

The pages are kind of heavy on javascript with React and other dependencies (~45 performance score on finished tests)

35 Running Lighthouse 3 time(s) on [redacted-url]
36 Run #1...failed!
37 Error: Lighthouse failed with exit code 1
38     at ChildProcess.child.on.code (/usr/local/lib/node_modules/@lhci/cli/src/collect/lighthouse-runner.js:103:21)
39     at ChildProcess.emit (events.js:198:13)
40     at Process.ChildProcess._handle.onexit (internal/child_process.js:248:12)
41 Thu, 12 Dec 2019 12:10:08 GMT ChromeLauncher Waiting for browser.
42 Thu, 12 Dec 2019 12:10:08 GMT ChromeLauncher Waiting for browser...
43 Thu, 12 Dec 2019 12:10:09 GMT ChromeLauncher Waiting for browser.....
44 Thu, 12 Dec 2019 12:10:09 GMT ChromeLauncher Waiting for browser.....✓
45 Thu, 12 Dec 2019 12:10:09 GMT config:warn IFrameElements gatherer requested, however no audit requires it.
46 Thu, 12 Dec 2019 12:10:09 GMT status Connecting to browser
47 Thu, 12 Dec 2019 12:10:09 GMT status Resetting state with about:blank
48 Thu, 12 Dec 2019 12:10:09 GMT status Benchmarking machine
49 Thu, 12 Dec 2019 12:10:09 GMT status Initializing…
50 Thu, 12 Dec 2019 12:10:09 GMT status Resetting state with about:blank
51 Thu, 12 Dec 2019 12:10:09 GMT status Setting up network for the pass trace
52 Thu, 12 Dec 2019 12:10:09 GMT status Cleaning browser cache
53 Thu, 12 Dec 2019 12:10:09 GMT status Beginning devtoolsLog and trace
54 Thu, 12 Dec 2019 12:10:09 GMT status Loading page & waiting for onload CSSUsage, ViewportDimensions, RuntimeExceptions, ConsoleMessages, AnchorElements, ImageElements, LinkElements, MetaElements, ScriptElements, IFrameElements, AppCacheManifest, Doctype, DOMStats, OptimizedImages, PasswordInputsWithPreventedPaste, ResponseCompression, TagsBlockingFirstPaint, FontSize, EmbeddedContent, RobotsTxt, TapTargets, Accessibility
55 Thu, 12 Dec 2019 12:10:55 GMT Driver:warn Timed out waiting for page load. Checking if page is hung...
56 Thu, 12 Dec 2019 12:10:56 GMT Driver:warn Page appears to be hung, killing JavaScript...
57 Thu, 12 Dec 2019 12:11:26 GMT status Disconnecting from browser...
58 Thu, 12 Dec 2019 12:11:26 GMT ChromeLauncher Killing Chrome instance 335
59 Thu, 12 Dec 2019 12:11:26 GMT GatherRunner disconnect:error connect ECONNREFUSED 127.0.0.1:35500
60 Runtime error encountered: Waiting for DevTools protocol response has exceeded the allotted time. (Method: Emulation.setScriptExecutionDisabled)
61 LHError: PROTOCOL_TIMEOUT
62     at Timeout.setTimeout [as _onTimeout] (/usr/local/lib/node_modules/@lhci/cli/node_modules/lighthouse/lighthouse-core/gather/driver.js:409:21)
63     at ontimeout (timers.js:436:11)
64     at tryOnTimeout (timers.js:300:5)
65     at listOnTimeout (timers.js:263:5)
66     at Timer.processTimers (timers.js:223:10)

Hey @patrickhulce! Any updates for the fix of this issue? There have been a whole lot of complaints.

This is so frustrating. It just doesn’t work at scale. Constantly getting this protocol error and getting this since 2018.

{
   "code":"PROTOCOL_TIMEOUT",
   "friendlyMessage":{
      "i18nId":"core/lib/lh-error.js | protocolTimeout",
      "values":{
         "errorCode":"PROTOCOL_TIMEOUT",
         "protocolMethod":"Target.setAutoAttach"
      },
      "formattedDefault":"Waiting for DevTools protocol response has exceeded the allotted time. (Method: Target.setAutoAttach)"
   },
   "lhrRuntimeError":true,
   "protocolMethod":"Target.setAutoAttach"
}

Today i had the same case run Lighthouse programmatically in Docker. Local and from CMD was everything fine. --disable-dev-shm-usage helped me. I’m starting Chrome in Docker with:

//Launch Chrome
    return await launch({
        chromeFlags: ['--headless', '--no-sandbox', '--disable-gpu', '--disable-dev-shm-usage'],
        logLevel: 'info',
        chromePath: '/usr/bin/google-chrome'
    })

We’re also experiencing this PROTOCOL_TIMEOUT for two methods.

Network.setUserAgentOverride and Runtime.evaluate

Error: Runtime error encountered: Waiting for DevTools protocol response has exceeded the allotted time. (Method: Network.setUserAgentOverride)

We are getting both of the above errors intermittently on one branch and never on another.

Both branches:

  • have nearly the same code.
  • using the lighthouse CLI
  • in GitHub Actions
  • and Nx as a monorepo
  • both have 6x websites (Nx workspaces) that each run lighthouse in parallel in the same GitHub Actions build

We’re wondering if the fact that its running 6+ lighthouse runs at the same time in the same build (different directories for output) might cause this?

LIGHTHOUSE_USERAGENT = "Mozilla/5.0 (iPhone; CPU iPhone OS 13_2 like Mac OS X) AppleWebKit/605.1.15 (KHTML, like Gecko) CriOS/105.0.0.0 Mobile/15E148 Safari/604.1"
LIGHTHOUSE_OUTPUT = "./lighthouse-results.json"
*** 
pnpm lighthouse $(SITEURL) \
  --emulatedUserAgent $(LIGHTHOUSE_USERAGENT) \
  --chrome-flags="--headless --disable-gpu --disable-dev-shm-usage --no-first-run" \
  --quiet \
  --disable-storage-reset \
  --output json \
  --output-path $(LIGHTHOUSE_OUTPUT)

Log:

Channel: DevTools
Initial URL: https://www.ender.ml/
Chrome Version: 101.0.4951.0
Stack Trace: LHError: PROTOCOL_TIMEOUT
    at devtools://devtools/bundled/third_party/lighthouse/lighthouse-dt-bundle.js:240:437
    at new Promise (<anonymous>)
    at Driver$5.sendCommandToSession (devtools://devtools/bundled/third_party/lighthouse/lighthouse-dt-bundle.js:240:389)
    at Driver$5.sendCommand (devtools://devtools/bundled/third_party/lighthouse/lighthouse-dt-bundle.js:240:622)
    at NetworkMonitor$4.getNavigationUrls (devtools://devtools/bundled/third_party/lighthouse/lighthouse-dt-bundle.js:264:606)
    at Object.gotoURL$1 [as gotoURL] (devtools://devtools/bundled/third_party/lighthouse/lighthouse-dt-bundle.js:274:687)
    at async Function.loadBlank (devtools://devtools/bundled/third_party/lighthouse/lighthouse-dt-bundle.js:297:872)
    at async Function.run (devtools://devtools/bundled/third_party/lighthouse/lighthouse-dt-bundle.js:303:468)
    at async Function._gatherArtifactsFromBrowser (devtools://devtools/bundled/third_party/lighthouse/lighthouse-dt-bundle.js:424:720)
    at async Function.gather (devtools://devtools/bundled/third_party/lighthouse/lighthouse-dt-bundle.js:423:454)

Same issue as above

Edit: Using --disable-dev-shm-usage chrome flag fixed it and vastly improved performance results. I’m running it in a docker container.

IMO, I don’t feel so much advantage to concentrate report to here related with PROTOCOL_TIMEOUT even a little. Since it’s not cause but result, as @patrickhulce pointing out.

This issue is so much long that the people from Google search won’t be able to find suitable solution for their situation. If reporter used new issue, he will use issue template. Then the people from Google search will be able to find suitable issue for their situation from reporter’s description.

@michaltobiasz “Inspector.targetCrashed {}” in the logs means that the tab crashed in Chromium. There’s nothing we can do in Lighthouse about it, but if you can report the crash dump at crbug.com, they might be able to find the root cause.

I too have observed the same issues on our docker container and saw many of the same error messages, sometimes they did not error from the same points in the stack trace. 🤷‍♀️


2021-03-10T09:58:28.766-08:00 | Run #1...failed!
-- | --
  | 2021-03-10T09:58:28.767-08:00 | Error: Lighthouse failed with exit code 1
  | 2021-03-10T09:58:28.767-08:00 | at ChildProcess.<anonymous> (/usr/local/lib/node_modules/@lhci/cli/src/collect/node-runner.js:120:21)
  | 2021-03-10T09:58:28.767-08:00 | at ChildProcess.emit (events.js:315:20)
  | 2021-03-10T09:58:28.767-08:00 | at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
  | 2021-03-10T09:58:28.767-08:00 | Wed, 10 Mar 2021 17:54:30 GMT ChromeLauncher Waiting for browser.
  | 2021-03-10T09:58:28.767-08:00 | Wed, 10 Mar 2021 17:54:30 GMT ChromeLauncher Waiting for browser...
  | 2021-03-10T09:58:28.767-08:00 | Wed, 10 Mar 2021 17:54:30 GMT ChromeLauncher Waiting for browser.....
  [removed for brevity]
  | 2021-03-10T09:58:28.767-08:00 | Wed, 10 Mar 2021 17:55:18 GMT waitFor:warn Timed out waiting for page load. Checking if page is hung...
  | 2021-03-10T09:58:28.767-08:00 | Wed, 10 Mar 2021 17:55:19 GMT waitFor:warn Page appears to be hung, killing JavaScript...
  | 2021-03-10T09:58:28.767-08:00 | Wed, 10 Mar 2021 17:55:49 GMT status Disconnecting from browser...
  | 2021-03-10T09:58:28.767-08:00 | Wed, 10 Mar 2021 17:55:49 GMT ChromeLauncher Killing Chrome instance 66
  | 2021-03-10T09:58:28.767-08:00 | Runtime error encountered: Waiting for DevTools protocol response has exceeded the allotted time. (Method: Emulation.setScriptExecutionDisabled)
  | 2021-03-10T09:58:28.767-08:00 | LHError: PROTOCOL_TIMEOUT
  | 2021-03-10T09:58:28.767-08:00 | at Timeout._onTimeout (/usr/local/lib/node_modules/@lhci/cli/node_modules/lighthouse/lighthouse-core/gather/driver.js:399:21)
  | 2021-03-10T09:58:28.767-08:00 | at listOnTimeout (internal/timers.js:549:17)
  | 2021-03-10T09:58:28.767-08:00 | at processTimers (internal/timers.js:492:7)

Running it locally by installing the lhci commandline tools and using lhci collect with the same settings as before gave a more insightful error object than in my AWS logs:

  "runWarnings": [
    "The page did not paint any content. Please ensure you keep the browser window in the foreground during the load and try again. (NO_FCP)"
  ],
  "runtimeError": {
    "code": "NO_FCP",
    "message": "The page did not paint any content. Please ensure you keep the browser window in the foreground during the load and try again. (NO_FCP)"
  },

What fixed this for me:

Passing --collect.settings.maxWaitForFcp="45000" seemed to do the trick. As of this post the default looks like 30 seconds.

https://github.com/GoogleChrome/lighthouse/blob/315c3678db586d5b1c1d76383fbbb3ad48a8ed6b/types/externs.d.ts#L153

https://github.com/GoogleChrome/lighthouse/blob/777bf1147fd0f6aca16ffefde1350bf6297476d4/lighthouse-core/config/constants.js#L97

I understand that’s a high number of 45 seconds, but you can see why I am keen to get this up and running. :p Hope this helps other people if your lighthouse containers are erroring in the same way. I was stuck on this for longer than I would care to admit…

I believe using --collect.settings.maxWaitForFcp="45000" means you are using Lighthouse-CI, correct? I first tried it like that and realized that is the syntax for the CI CLI. Lighthouse itself needs --max-wait-for-fcp=4500.

Emulation.setScriptExecutionDisabled

Running a series of Lighthouse tests using lighthouse-ci on GitHub Actions (example failing run). Works on some URLs, then fails reliably on this page if I run from GHA or from an Ubuntu Docker container using act. Running against that URL works successfully if run from macOS.

Versions: lighthouse@7.0.0, @lhci/cli@0.7.0

@Yasuslik thanks for the link, I managed to fix it with lighthouse --chrome-flags="--disable-dev-shm-usage"

Thank you! Works for me too, I’m using this docker image: https://hub.docker.com/r/femtopixel/google-lighthouse

@bbuhler I noticed it started working again after updating chrome, Chrome 86 Fixed.I did this operation on million of pages & it worked

I’m running Lighthouse CI in a docker container with Gitlab CI.

Runtime error encountered: Waiting for DevTools protocol response has exceeded the allotted time. (Method: Runtime.evaluate)
 LHError: PROTOCOL_TIMEOUT
     at Timeout._onTimeout (/root/.npm/_npx/12/lib/node_modules/@lhci/cli/node_modules/lighthouse/lighthouse-core/gather/driver.js:352:21)
     at listOnTimeout (internal/timers.js:549:17)
     at processTimers (internal/timers.js:492:7)

I noticed, in my case, it fails when I use WEBP images either directly or in a <picture> source. If the image returns 404 or when I use JPG or PNG instead it doesn’t fail. Also it only fails with a local running server (started with startServerCommand). Running the CI with the same build against a public domain don’t fail with WEBP.

I hope this information may help.

Happen occasionally only on specific website

{
   "errorType":"LHError",
   "errorMessage":"PROTOCOL_TIMEOUT",
   "code":"PROTOCOL_TIMEOUT",
   "name":"LHError",
   "friendlyMessage":"Waiting for DevTools protocol response has exceeded the allotted time. (Method: Network.emulateNetworkConditions)",
   "lhrRuntimeError":true,
   "protocolMethod":"Network.emulateNetworkConditions",
   "stack":[
      "LHError: PROTOCOL_TIMEOUT",
      "    at Timeout._onTimeout (/var/task/node_modules/lighthouse/lighthouse-core/gather/driver.js:352:21)",
      "    at listOnTimeout (internal/timers.js:549:17)",
      "    at processTimers (internal/timers.js:492:7)"
   ]
}

I get the following error:

Run #1...failed!
Error: Lighthouse failed with exit code 1
    at ChildProcess.<anonymous> (/usr/local/lib/node_modules/@lhci/cli/src/collect/node-runner.js:103:21)
    at ChildProcess.emit (events.js:315:20)
    at Process.ChildProcess._handle.onexit (internal/child_process.js:275:12)
Thu, 17 Sep 2020 13:21:59 GMT ChromeLauncher Waiting for browser.
Thu, 17 Sep 2020 13:21:59 GMT ChromeLauncher Waiting for browser...
Thu, 17 Sep 2020 13:21:59 GMT ChromeLauncher Waiting for browser.....
Thu, 17 Sep 2020 13:21:59 GMT ChromeLauncher Waiting for browser.....✓
Thu, 17 Sep 2020 13:22:00 GMT config:warn IFrameElements gatherer requested, however no audit requires it.
Thu, 17 Sep 2020 13:22:00 GMT config:warn FormElements gatherer requested, however no audit requires it.
Thu, 17 Sep 2020 13:22:00 GMT status Connecting to browser
Thu, 17 Sep 2020 13:22:00 GMT status Resetting state with about:blank
Thu, 17 Sep 2020 13:22:00 GMT status Benchmarking machine
Thu, 17 Sep 2020 13:22:01 GMT status Initializing…
Thu, 17 Sep 2020 13:22:01 GMT status Running defaultPass pass CSSUsage, JsUsage, ViewportDimensions, RuntimeExceptions, ConsoleMessages, AnchorElements, ImageElements, LinkElements, MetaElements, ScriptElements, IFrameElements, FormElements, MainDocumentContent, GlobalListeners, AppCacheManifest, Doctype, DOMStats, OptimizedImages, PasswordInputsWithPreventedPaste, ResponseCompression, TagsBlockingFirstPaint, FontSize, EmbeddedContent, RobotsTxt, TapTargets, Accessibility, TraceElements, InspectorIssues, SourceMaps
Thu, 17 Sep 2020 13:22:01 GMT status Resetting state with about:blank
Thu, 17 Sep 2020 13:22:01 GMT status Setting up network for the pass trace
Thu, 17 Sep 2020 13:22:01 GMT status Cleaning browser cache
Thu, 17 Sep 2020 13:22:01 GMT status Beginning devtoolsLog and trace
Thu, 17 Sep 2020 13:22:01 GMT status Loading page & waiting for onload
Thu, 17 Sep 2020 13:22:46 GMT Driver:warn Timed out waiting for page load. Checking if page is hung...
Thu, 17 Sep 2020 13:22:47 GMT Driver:warn Page appears to be hung, killing JavaScript...
Thu, 17 Sep 2020 13:23:17 GMT status Disconnecting from browser...
Thu, 17 Sep 2020 13:23:17 GMT ChromeLauncher Killing Chrome instance 271
Thu, 17 Sep 2020 13:23:17 GMT GatherRunner disconnect:error read ECONNRESET
Runtime error encountered: Waiting for DevTools protocol response has exceeded the allotted time. (Method: Emulation.setScriptExecutionDisabled)
LHError: PROTOCOL_TIMEOUT
    at Timeout._onTimeout (/usr/local/lib/node_modules/@lhci/cli/node_modules/lighthouse/lighthouse-core/gather/driver.js:352:21)
    at listOnTimeout (internal/timers.js:549:17)
    at processTimers (internal/timers.js:492:7)

Method: Emulation.setScriptExecutionDisabled Method: Runtime.evaluate

Thanks for the feedback @jameswilson we really appreciate your willingness to help!

At some point a Chromium change was made to no longer show the protocol method name to DevTools users and only CLI users will see it printed currently. I put out a request into the ether in #6512 (comment) to add it back.

https://chromium-review.googlesource.com/c/devtools/devtools-frontend/+/2366297

PROTOCOL_TIMEOUT

Channel: DevTools
Initial URL: https://dev-bongfood-explorer.web.app/home
Chrome Version: 84.0.4147.105
Stack Trace: LHError: PROTOCOL_TIMEOUT
    at eval (devtools://devtools/remote/serve_file/@a6b12dfad6663f13a7e16e9a42a6a4975374096b/lighthouse_worker/lighthouse_worker_module.js:1453:229)

PROTOCOL_TIMEOUT

Channel: DevTools
Initial URL: https://www.correio24horas.com.br/noticia/nid/casos-de-covid-19-devem-se-expandir-em-sp-ate-2021-diz-butantan/
Chrome Version: 83.0.4103.106
Stack Trace: LHError: PROTOCOL_TIMEOUT
    at eval (devtools://devtools/remote/serve_file/@ce7134bb3d95141cd18f1e65772a4247f282d950/lighthouse_worker/lighthouse_worker_module.js:1268:229)

This test was done with every category but PWA on docker for mac 2.2.0.3 (docker version 19.03.5), lighthouse version 5.6.0 on a 2,6 GHz 6-Core Intel Core i7 with 16 gigs of ram. I have however seen the same kind of issues running on ECS with both t3.xlarge and t3.2xlarge although they are more frequent on ECS than when running on prem.

Mon, 17 Feb 2020 15:14:29 GMT Driver:warn Timed out waiting for page load. Checking if page is hung...
Mon, 17 Feb 2020 15:14:30 GMT Driver:warn Page appears to be hung, killing JavaScript...
Mon, 17 Feb 2020 15:15:00 GMT status Disconnecting from browser...
Mon, 17 Feb 2020 15:15:00 GMT ChromeLauncher Killing Chrome instance 254
Mon, 17 Feb 2020 15:15:00 GMT GatherRunner disconnect:error read ECONNRESET
Runtime error encountered: Waiting for DevTools protocol response has exceeded the allotted time. (Method: Emulation.setScriptExecutionDisabled)
LHError: PROTOCOL_TIMEOUT
    at Timeout._onTimeout (/usr/lib/node_modules/lighthouse/lighthouse-core/gather/driver.js:409:21)
    at listOnTimeout (internal/timers.js:531:17)
    at processTimers (internal/timers.js:475:7)

What I’m seeing is the page being audited reload with “normal” performance, then appear to reload and time out.

If it’s useful, the app in question is compiled with Angular 9rc8, and has the same behavior with Angular 9rc10.

I have throttling and clear storage turned OFF, and I’m testing just for desktop.

UPDATE: Turning off the test for PWA makes the problem go away.

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`
        );
      }
    }
  }
};

As a temporary solution, is there a way to increase this timeout ?

So I get a PROTOCOL_TIMEOUT intermittently but dont know how to solve it. I have tried all the solutions in this thread to no avail. Below is my stack trace:

Runtime error encountered: Waiting for DevTools protocol response has exceeded the allotted time. (Method: Emulation.setScriptExecutionDisabled) LHError: PROTOCOL_TIMEOUT at /usr/local/lib/node_modules/@lhci/cli/node_modules/lighthouse/lighthouse-core/gather/driver.js:348:50 at new Promise (<anonymous>) at Driver.sendCommandToSession (/usr/local/lib/node_modules/@lhci/cli/node_modules/lighthouse/lighthouse-core/gather/driver.js:346:28) at Driver.sendCommand (/usr/local/lib/node_modules/@lhci/cli/node_modules/lighthouse/lighthouse-core/gather/driver.js:369:17) at /usr/local/lib/node_modules/@lhci/cli/node_modules/lighthouse/lighthouse-core/gather/driver/wait-for-condition.js:476:23 at async Promise.all (index 0) at async Object.gotoURL (/usr/local/lib/node_modules/@lhci/cli/node_modules/lighthouse/lighthouse-core/gather/driver/navigation.js:127:26) at async Function.loadPage (/usr/local/lib/node_modules/@lhci/cli/node_modules/lighthouse/lighthouse-core/gather/gather-runner.js:74:36) at async Function.runPass (/usr/local/lib/node_modules/@lhci/cli/node_modules/lighthouse/lighthouse-core/gather/gather-runner.js:584:49) at async Function.run (/usr/local/lib/node_modules/@lhci/cli/node_modules/lighthouse/lighthouse-core/gather/gather-runner.js:507:29)

Has anyone found a solution ?

protocolMethod: ‘Network.emulateNetworkConditions’

Chrome version: 109.0.5414.75 Lighthouse version: 9.6.8

code: 'PROTOCOL_TIMEOUT',
  friendlyMessage: 'Waiting for DevTools protocol response has exceeded the allotted time. (Method: Network.emulateNetworkConditions)',
  lhrRuntimeError: true,
  protocolMethod: 'Network.emulateNetworkConditions'

I feel obligated to say that if you use identical flags from the CLI and if you use the same CHROME_PATH, there is no fundamental difference from your script and the CLI (the CLI does exactly what this script does using chrome-launcher), and I strongly suspect some other unobserved difference to be really at play here @Axection. My best guess is that the flags were not being passed properly in the CLI because omitting --disable-dev-shm-usage will absolutely give you the behavior you describe.

oh okay. sorry for not realizing that the CLI actually does the same thing. probably all this time the flags weren’t passed correctly. thanks for clarifying 😃

After some experiments, I think PROTOCOL_TIMEOUT was occured more often on lighthosue under plain CLI product, so I suggest to use the lighthouse-core instead, which so far it works on my local and our gitlab-ci (100% success in pipeline result), in addition of more stable Benchmark Index, even in randomly scaled CI runner.

Though, this requires additional npm package chrome-launcher and puppeteer-core (+optionally axios for fetch). Plus, you need a chromium installed. The idea is to use lighthouse on already launched chrome. So overall it looks like this:

import axios from 'axios';
import { Launcher } from 'chrome-launcher';
import { connect } from 'puppeteer-core';
import lighthouse from 'lighthouse/lighthouse-core';

const chrome = new Launcher({
  chromePath: '/usr/bin/chromium-browser', // or wherever you place the executable
  chromeFlags: ['--no-sandbox', '--disable-dev-shm-usage', '--headless', 'in-process-gpu'], // param solution from this thread
  logLevel: 'info'
});
await chrome.launch();
await chrome.waitUntilReady();
const details = await axios.get(`http://localhost:${chrome.port}/json/version`);
const browser = await connect({
  browserWSEndpoint: details.data.webSocketDebuggerUrl, // puppeteer consume the debugger url
});
const options = { logLevel: 'info', hostname: 'localhost', port: new URL(browser.wsEndpoint()).port }; 
const runnerResult = await lighthouse('https://www.your-website.com', options); // or can use fibers to convert this async to sync
// do some data processing with runnerResult
console.log(runnerResult.lhr); // example
// later on
browser.close();

A bit more scripting, but I think you guys doing lighthouse in runner, VM or some cronjob, so a lil bit extra js/ts file won’t hurt your pipeline 😉

The above is tricky when these URLs seem to only fail in under certain scenarios - namely geographic location.

FWIW, that tells me that the most likely issue at play here is that the page is altering its content based on geography in a way that sends it into an infinite loop and/or crashes. Unfortunately, we don’t have the bandwidth to be in the business of debugging infinite loop root causes, but we do plan on using a separate error message for when we detect this is the case in the future.

Is there a private channel or email I can send them to when I have them?

You can send them my way.

Thanks @patrickhulce. I’m not trying to be a pest, so please bear with me. Over the years I’ve certainly tried every setting mentioned in this issue and other places online… and my own experimentations. I’ve tried every Docker Image flavor in existence.

In my case, I’m not the site owner of the URLs as I provide this service to the site owners. Ultimately I just want to have a path forward for them to tell them what exactly is causing the problem and have suggestions for them.

The above is tricky when these URLs seem to only fail in under certain scenarios - namely geographic location.

I’ll go through and put together my newest list of URLs and curate based on how consistently I can reproduce locally. I’d rather not post them publicly.

Is there a private channel or email I can send them to when I have them?

Timing out on Page.getInstallabilityErrors

Hello, could you solve the issue? Mine get stuck also after Get webapp installbility errors. I m using a React app. This happens only when i register service worker.

`` status Get webapp installability errors +18ms

status Disconnecting from browser… +30s

ChromeLauncher Killing Chrome instance 13076 +1ms

Runtime error encountered: Waiting for DevTools protocol response has exceeded the allotted time. (Method: Page.getInstallabilityErrors) LHError: PROTOCOL_TIMEOUT at Timeout.<anonymous> (C:\Users}\AppData\Roaming\npm\node_modules\lighthouse\lighthouse-core\gather\driver.js:322:21) at listOnTimeout (internal/timers.js:554:17) at processTimers (internal/timers.js:497:7) ``

Timing out on Page.getInstallabilityErrors

Versions: lighthouse@7.0.0, @lhci/cli@0.7.0

When using lhci with no extra settings for collect data:

....
Tue, 16 Mar 2021 10:18:04 GMT status Gathering: Accessibility
Tue, 16 Mar 2021 10:19:08 GMT status Disconnecting from browser...
Tue, 16 Mar 2021 10:19:08 GMT ChromeLauncher Killing Chrome instance 68691
Runtime error encountered: Waiting for DevTools protocol response has exceeded the allotted time. (Method: Runtime.evaluate)
LHError: PROTOCOL_TIMEOUT
    at Timeout._onTimeout (/usr/local/lib/node_modules/@lhci/cli/node_modules/lighthouse/lighthouse-core/gather/driver.js:399:21)
    at listOnTimeout (internal/timers.js:551:17)
    at processTimers (internal/timers.js:494:7)

Try skipping the SEO category. It worked for me –only-categories=performance,accessibility,best-practices,pwa

@Yasuslik thanks for the link, I managed to fix it with lighthouse --chrome-flags="--disable-dev-shm-usage" 🥳

Worked but I get a “question mark” on performance…

Version: @lhci/cli@0.7.0

Same error on third try:

Runtime error encountered: Waiting for DevTools protocol response has exceeded the allotted time. (Method: Runtime.evaluate)
LHError: PROTOCOL_TIMEOUT
    at Timeout._onTimeout (/usr/local/share/.config/yarn/global/node_modules/lighthouse/lighthouse-core/gather/driver.js:399:21)
    at listOnTimeout (internal/timers.js:554:17)
    at processTimers (internal/timers.js:497:7)
error Command failed with exit code 1.

Hey all, I’m getting this consistent error while attempting to run lighthouse programmatically via AWS.

status Loading page & waiting for onload
waitFor:warn Timed out waiting for page load. Checking if page is hung...
waitFor:warn Page appears to be hung, killing JavaScript...
status Disconnecting from browser...
LighthouseError [LHError]: PROTOCOL_TIMEOUT
at Timeout._onTimeout (/codebuild/output/src987238044/src/qa-tests/node_modules/lighthouse/lighthouse-core/gather/driver.js:399:21)
at listOnTimeout (internal/timers.js:554:17)
at processTimers (internal/timers.js:497:7) {
code: 'PROTOCOL_TIMEOUT',
friendlyMessage: 'Waiting for DevTools protocol response has exceeded the allotted time. (Method: Emulation.setScriptExecutionDisabled)',
lhrRuntimeError: true,
protocolMethod: 'Emulation.setScriptExecutionDisabled' }

This script was previously not getting this error in AWS, and continues to not get this error when executed on my local machine.

In AWS I am using the Ubuntu 18.04 aws/codebuild/standard:4.0 image

Notable dependencies: “chrome-launcher”: “^0.13.4”, “chromedriver”: “^87.0.7”, “lighthouse”: “^7.0.0”

Any thoughts or ideas as to why this could’ve started happening?

Chrome Version 86.0.4240.183 (Official Build) (x86_64) Mobile mode. Incognito. image

Thanks for sharing that URL @bbuhler I can reproduce that roughly ~5% of the time!

It looks like in this case Chrome is completely crashing on this page.

Fri, 09 Oct 2020 15:27:44 GMT method => browser:verbose Fetch.continueRequest
Fri, 09 Oct 2020 15:27:44 GMT method <= browser OK:verbose Fetch.continueRequest
Fri, 09 Oct 2020 15:27:44 GMT method <= browser OK:verbose Page.getAppManifest
Fri, 09 Oct 2020 15:27:44 GMT method => browser:verbose Page.getInstallabilityErrors
Fri, 09 Oct 2020 15:27:44 GMT <= event:verbose Network.responseReceived
Fri, 09 Oct 2020 15:27:44 GMT <= event:verbose Network.dataReceived
Fri, 09 Oct 2020 15:27:44 GMT <= event:verbose Network.dataReceived
Fri, 09 Oct 2020 15:27:44 GMT <= event:verbose Network.loadingFinished
Fri, 09 Oct 2020 15:27:44 GMT method <= browser OK:verbose Page.getInstallabilityErrors
Fri, 09 Oct 2020 15:27:44 GMT method => browser:verbose Runtime.evaluate
Fri, 09 Oct 2020 15:27:44 GMT <= event:verbose Debugger.scriptParsed
Fri, 09 Oct 2020 15:27:44 GMT <= event:verbose Network.requestWillBeSent
Fri, 09 Oct 2020 15:27:44 GMT <= event:verbose Fetch.requestPaused
Fri, 09 Oct 2020 15:27:44 GMT method => browser:verbose Fetch.continueRequest
Fri, 09 Oct 2020 15:27:44 GMT method <= browser OK:verbose Fetch.continueRequest
Fri, 09 Oct 2020 15:27:44 GMT <= event:verbose Network.requestWillBeSentExtraInfo
Fri, 09 Oct 2020 15:27:44 GMT <= event:verbose Network.responseReceivedExtraInfo
Fri, 09 Oct 2020 15:27:44 GMT <= event:verbose Fetch.requestPaused
Fri, 09 Oct 2020 15:27:44 GMT method => browser:verbose Fetch.continueRequest
Fri, 09 Oct 2020 15:27:44 GMT method <= browser OK:verbose Fetch.continueRequest
Fri, 09 Oct 2020 15:27:44 GMT <= event:verbose Inspector.targetCrashed
Fri, 09 Oct 2020 15:28:44 GMT status Disconnecting from browser...
Fri, 09 Oct 2020 15:28:44 GMT method => browser:verbose Storage.clearDataForOrigin
Fri, 09 Oct 2020 15:28:44 GMT ChromeLauncher Killing Chrome instance 1380
Runtime error encountered: Waiting for DevTools protocol response has exceeded the allotted
time. (Method: Runtime.evaluate)
LHError: PROTOCOL_TIMEOUT
    at Timeout._onTimeout (/usr/local/lib/node_modules/lighthouse/lighthouse-core/gather/driver.js:352:21)
    at listOnTimeout (internal/timers.js:549:17)
    at processTimers (internal/timers.js:492:7)

@adamraine if you’re looking into PROTOCOL_TIMEOUT issues might want to do a test of disabling source maps gatherer to see how that affects things (I suspect request interception is the crash trigger, I disabled those audits and couldn’t repro in 100 runs compared to 5/100 with)

I noticed, in my case, it fails when I use WEBP images either directly or in a <picture> source. If the image returns 404 or when I use JPG or PNG instead it doesn’t fail.

Thanks @bbuhler do you have this site available on the internet anywhere for us to test?

PROTOCOL_TIMEOUT

Channel: DevTools
Initial URL: https://sites.google.com/view/education-inc/home
Chrome Version: 85.0.4183.121
Stack Trace: LHError: PROTOCOL_TIMEOUT
    at eval (devtools://devtools/remote/serve_file/@a81aa729a8e1fd413943a339393c82e7b8055ddc/lighthouse_worker/lighthouse_worker_module.js:1453:229)

Method: Runtime.evaluate

@jyothi-krishnamurthy do you have a public URL?

Nope.

Lighthouse v6.3.0 running on a Heroku worker (with Chrome build pack)…

ERROR performing audit LighthouseError [LHError]: PROTOCOL_TIMEOUT
    at Timeout._onTimeout (/app/node_modules/lighthouse/lighthouse-core/gather/driver.js:352:21)
    at listOnTimeout (internal/timers.js:549:17)
    at processTimers (internal/timers.js:492:7) {
  code: 'PROTOCOL_TIMEOUT',
  friendlyMessage: 'Waiting for DevTools protocol response has exceeded the allotted time. (Method: Emulation.setScriptExecutionDisabled)',
  lhrRuntimeError: true,
  protocolMethod: 'Emulation.setScriptExecutionDisabled'

Hi, I’m trying to run Lighthouse CLI on a bunch of pages in a dockerized environment and I get this error 10/10 times :

Screen Shot 2020-09-24 at 3 02 57 PM

☁️ Internet (not localhost) ☑️ Performance ☑️ Best practices ☑️ SEO

PROTOCOL_TIMEOUT
Channel: DevTools
Initial URL: xxxxxxxx
Chrome Version: 85.0.4183.121
Stack Trace: LHError: PROTOCOL_TIMEOUT
    at eval (devtools://devtools/remote/serve_file/@a81aa729a8e1fd413943a339393c82e7b8055ddc/lighthouse_worker/lighthouse_worker_module.js:1453:229)

I ma facing the same issue for the website I want to perform the test

☁️ Internet (not localhost) ☑️ Performance ☑️ Best practices ☑️ SEO

PROTOCOL_TIMEOUT
Channel: DevTools
Initial URL: xxxxxxxx
Chrome Version: 85.0.4183.121
Stack Trace: LHError: PROTOCOL_TIMEOUT
    at eval (devtools://devtools/remote/serve_file/@a81aa729a8e1fd413943a339393c82e7b8055ddc/lighthouse_worker/lighthouse_worker_module.js:1453:229)

I was making some changes to our website, to solve some issues marked by Lighthouse, suddendly it started throwing the next error on both Desktop and Mobile

PROTOCOL_TIMEOUT
Channel: DevTools
Initial URL: X.X.X.X.X.X.X.X.X.X.X
Chrome Version: 85.0.4183.102
Stack Trace: LHError: PROTOCOL_TIMEOUT
    at eval (devtools://devtools/remote/serve_file/@ffe848af6a5df4fa127e2929331116b7f9f1cb30/lighthouse_worker/lighthouse_worker_module.js:1453:229)

PROTOCOL_TIMEOUT

Channel: DevTools
Initial URL: http://localhost/cn/download
Chrome Version: 84.0.4147.105
Stack Trace: LHError: PROTOCOL_TIMEOUT
    at eval (devtools://devtools/remote/serve_file/@a6b12dfad6663f13a7e16e9a42a6a4975374096b/lighthouse_worker/lighthouse_worker_module.js:1453:229)

PROTOCOL_TIMEOUT

Channel: DevTools
Initial URL: https://oautah.org/
Chrome Version: 84.0.4147.89
Stack Trace: LHError: PROTOCOL_TIMEOUT
    at eval (devtools://devtools/remote/serve_file/@19abfe7bcba9318a0b2a6bc6634a67fc834aa592/lighthouse_worker/lighthouse_worker_module.js:1453:229)

PROTOCOL_TIMEOUT

Channel: DevTools
Initial URL: https://dev-bongfood-explorer.web.app/home
Chrome Version: 84.0.4147.105
Stack Trace: LHError: PROTOCOL_TIMEOUT
    at eval (devtools://devtools/remote/serve_file/@a6b12dfad6663f13a7e16e9a42a6a4975374096b/lighthouse_worker/lighthouse_worker_module.js:1453:229)

This was caused due to missing file named asset-manifest.json But is this fire really required??

@patrickhulce

Looks like most of the time, this error is produced by Network.clearBrowserCache.

That’s legit, but do you think that in order to mitigate these kinds of problems, could be a thing the ability to skip browser setup & teardown?

At least for my use cases, these steps aren’t necessary (since a browser is bootstrapped before the audit and it dies after the audit)

Disabling these stages can have better output timing, I guess.

I’ve solved the problem in my machine by following steps:

  • On chrome browser --> Setting (the three vertical dots)–> More tools --> Clear browsing data … Rerun the Lighthouse audit --> OK.

I ran into this issue with lighthouse running on an Alpine docker container within Jenkins. We tried to increase the timeout and modify a few settings and nothing worked. But, what did work was modifying the base container from Alpine to Debian-based. Not entirely sure why, although I thought it would be good to point out here.

@patrickhulce getting this error while using Node API Run on Docker lighthouse Version: 5.4.0 LHError: PROTOCOL_TIMEOUT at Timeout._onTimeout (/docker/xxx/node_modules/lighthouse/lighthouse-core/gather/driver.js:409:21) at listOnTimeout (internal/timers.js:549:17) at processTimers (internal/timers.js:492:7)

We can consistently reproduce this error when running Lighthouse on slower hardware. Here’s an example result in WPT on a Raspberry Pi. It runs successfully on a decent laptop. I can also reproduce this in SpeedCurve’s test agents (LH fails on a c4.large EC2 instance but succeeds on on a c5.2xlarge).

Last few lines of output from a failed run:

Mon, 03 Feb 2020 03:14:46 GMT status Gathering trace
Mon, 03 Feb 2020 03:14:48 GMT status Gathering devtoolsLog & network records
Mon, 03 Feb 2020 03:14:48 GMT status Gathering: CSSUsage
Mon, 03 Feb 2020 03:16:20 GMT status Disconnecting from browser...
Runtime error encountered: Waiting for DevTools protocol response has exceeded the allotted time. (Method: Runtime.evaluate)
LHError: PROTOCOL_TIMEOUT
    at Timeout.setTimeout [as _onTimeout] (/usr/lib/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)

PROTOCOL_TIMEOUT

Channel: DevTools
Initial URL: https://localhost:44313/customers
Chrome Version: 78.0.3904.108
Stack Trace: LHError: PROTOCOL_TIMEOUT
    at eval (devtools://devtools/remote/serve_file/@4b26898a39ee037623a72fcfb77279fce0e7d648/audits_worker/audits_worker_module.js:1250:210)

I get this error whether or not “clear cache” is checked. The error noted is without it checked.

Sample repo: https://github.com/NexulAcademy/classroom-simple-crm-v2/commit/94c0c3441c60f587c75adc77c58e2c178ba0cba4

Start the sample repo by running the .net project, which serves the API and Angular app. API requires the Entity Framework Db migrations to run. directions in the repo. (README-MIGRATIONS.md)

Same as the others

PROTOCOL_TIMEOUT

Channel: DevTools
Initial URL: https://www.ecoconcepts.co/
Chrome Version: 78.0.3904.108
Stack Trace: LHError: PROTOCOL_TIMEOUT
    at eval (devtools://devtools/remote/serve_file/@4b26898a39ee037623a72fcfb77279fce0e7d648/audits_worker/audits_worker_module.js:1250:210)

For the record, unchecking clear local storage prevents the error.

A work around not really a long term fix.

PROTOCOL_TIMEOUT

Channel: DevTools
Initial URL: 
Chrome Version: 78.0.3904.108
Stack Trace: LHError: PROTOCOL_TIMEOUT
    at eval (devtools://devtools/remote/serve_file/@4b26898a39ee037623a72fcfb77279fce0e7d648/audits_worker/audits_worker_module.js:1250:210)

PROTOCOL_TIMEOUT Channel: DevTools Initial URL: https://www.reesby.com.au/ Chrome Version: 74.0.3729.169 Stack Trace: LHError: PROTOCOL_TIMEOUT at eval (chrome-devtools://devtools/remote/serve_file/@78e4f8db3ce38f6c26cf56eed7ea9b331fc67ada/audits2_worker/audits2_worker_module.js:1170:210)

Got error { LHError: PROTOCOL_TIMEOUT at Timeout.setTimeout (/home/chrome/lighthouse/node_modules/lighthouse/lighthouse-core/gather/driver.js:399: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’ } Error: read ECONNRESET at TCP.onStreamRead (internal/stream_base_commons.js:111:27)

A workaround for me was to un-check the “Clear storage” option

Can confirm the same “solution” based upon the following response:

PROTOCOL_TIMEOUT

Channel: DevTools
Initial URL: https://(revoked)
Chrome Version: 74.0.3729.131
Stack Trace: LHError: PROTOCOL_TIMEOUT
    at eval (chrome-devtools://devtools/remote/serve_file/@518a41c1fa7ce1c8bb5e22346e82e42b4d76a96f/audits2_worker/audits2_worker_module.js:1170:210)

Tried running LH on work website to after reading an article about FCP and FMP scoring. LH ran for about 30-45 seconds, the page disappeared to be replaced with ‘about:blank’ and then the error pops up.

PROTOCOL_TIMEOUT

Channel: DevTools
Initial URL: https://nmsnewhaven.org/
Chrome Version: 74.0.3729.131
Stack Trace: LHError: PROTOCOL_TIMEOUT
    at eval (chrome-devtools://devtools/remote/serve_file/@518a41c1fa7ce1c8bb5e22346e82e42b4d76a96f/audits2_worker/audits2_worker_module.js:1170:210)

Came here to report it, thought "well, try it on another site, tried it here, and got the same type of error, slightly different message:

PROTOCOL_TIMEOUT

Channel: DevTools
Initial URL: https://github.com/GoogleChrome/lighthouse/issues
Chrome Version: 74.0.3729.131
Stack Trace: LHError: PROTOCOL_TIMEOUT
    at eval (chrome-devtools://devtools/remote/serve_file/@518a41c1fa7ce1c8bb5e22346e82e42b4d76a96f/audits2_worker/audits2_worker_module.js:1170:210)

A workaround for me was to un-check the “Clear storage” option

Lighthouse Version: 3.3.0.4001 Lighthouse Commit: 66100367e39d970f8208bd30c10bd97cc7240784 Chrome Version: 70.0.3538.110 Initial URL: https://golftocs.com/ Error Message: PROTOCOL_TIMEOUT Method: Storage.clearDataForOrigin Stack Trace:

LHError: PROTOCOL_TIMEOUT Method: Storage.clearDataForOrigin
    at _ (chrome-extension://blipmdconlkpinefehnmjammfjpmpbjk/scripts/lighthouse-ext-bundle.js:18993:11)

Very strange - I just ran LightHouse successfully 2 days ago on this site.