lighthouse icon indicating copy to clipboard operation
lighthouse copied to clipboard

☂️ PROTOCOL_TIMEOUT

Open patrickhulce opened this issue 5 years ago • 361 comments

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

patrickhulce avatar Nov 09 '18 15:11 patrickhulce

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.

kinggolf avatar Dec 03 '18 18:12 kinggolf

Lighthouse Version: 3.3.0.4001 Lighthouse Commit: 66100367e39d970f8208bd30c10bd97cc7240784 Chrome Version: 70.0.3538.110 Initial URL: https://bags.sas.se/ 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)

kapilvats avatar Dec 04 '18 11:12 kapilvats

@Hoten where exactly do we stand here? Have we increased the timeout back to 60 and these are just stragglers?

patrickhulce avatar Jan 02 '19 19:01 patrickhulce

Also the report in #6918 (https://googlechrome.github.io/lighthouse/viewer/?gist=6d3d0224e5ebdaf3b2c787de38a6befa) suggests that some of these cases might be the root cause behind NO_FCP as well!

patrickhulce avatar Jan 02 '19 19:01 patrickhulce

4.0.0-alpha.1 set the default timeout to 30s (changelog). alpha.0 had it at 60. Master still has it at 30s btw.

Looks like clearX is being problematic. Should explore those.

connorjclark avatar Jan 02 '19 20:01 connorjclark

Yeah we've officially crossed into the period where we'd expect these to all disappear (30s timeout should be more than enough for clearDataForOrigin if it's working properly).

Do we have any ideas what's going on here?

patrickhulce avatar Jan 12 '19 19:01 patrickhulce

Lighthouse Version: 4.0.0 Lighthouse Commit: bfa10f1ac4ba8cdf95c809858d8bc4c8ac1c1da8 Chrome Version: 72.0.3626.109 Initial URL: https://deardiary.wtf/ Error Message: PROTOCOL_TIMEOUT Stack Trace:

LHError: PROTOCOL_TIMEOUT
    at setTimeout (chrome-extension://blipmdconlkpinefehnmjammfjpmpbjk/scripts/lighthouse-ext-bundle.js:19252:11)

Lighthouse had been working just fine as long as my serviceworker wasn't registering. Now that it's registered in the Network panel, Lighthouse is continuously crashing.

Zeesy avatar Feb 19 '19 19:02 Zeesy

@Zeesy something is wrong with your service worker. Just visiting your page at all causes Chrome to hang for me while the service worker is installing.

patrickhulce avatar Feb 19 '19 19:02 patrickhulce

Lighthouse Version: 4.2.0 Chrome Version: 73.0.3683.75 (Official Build) (64-bit) Initial URL: https://townhall.klick.com/ Error Message: PROTOCOL_TIMEOUT Method: Page.getAppManifest Command: lighthouse --chrome-flags="--headless" https://townhall.klick.com --output=json > report.json

Stack Trace:

...

  [34;1mstatus [0mRetrieving in-page: Hreflang [34m+1ms[0m
  [34;1mstatus [0mRetrieving in-page: EmbeddedContent [34m+2ms[0m
  [34;1mstatus [0mRetrieving in-page: Canonical [34m+0ms[0m
  [34;1mstatus [0mRetrieving in-page: RobotsTxt [34m+1ms[0m
  [34;1mstatus [0mRetrieving in-page: TapTargets [34m+12ms[0m
  [31;1mDriver:error [0mFailed fetching manifest { LHError: PROTOCOL_TIMEOUT
    at Timeout.setTimeout [as _onTimeout] (/usr/local/lib/node_modules/lighthouse/lighthouse-core/gather/driver.js:291: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: 'lighthouse-core/lib/lh-error.js | protocolTimeout # 0',
  lhrRuntimeError: true,
  protocolMethod: 'Page.getAppManifest' } [31m+3s[0m
  [34;1mstatus [0mRetrieving trace [34m+6ms[0m
  [34;1mstatus [0mRetrieving devtoolsLog & network records [34m+930ms[0m
  [34;1mstatus [0mRetrieving: Scripts [34m+1s[0m
  [34;1mstatus [0mRetrieving: CSSUsage [34m+8s[0m
  [34;1mstatus [0mRetrieving: ViewportDimensions [34m+14s[0m
  [34;1mstatus [0mRetrieving: RuntimeExceptions [34m+1s[0m

...

manifest.json

{
  "short_name": "Test Thing",
  "name": "Test Thing",
  "icons": [
    {
      "src": "favicon.ico",
      "sizes": "64x64 32x32 24x24 16x16",
      "type": "image/x-icon"
    }
  ],
  "start_url": "./",
  "display": "standalone",
  "theme_color": "#ffffff",
  "background_color": "#ffffff"
}

This seems to only happen when you run headless. The following command works just fine, and runs in half the time, but does pop up a browser window. (not what we need) Command: lighthouse https://townhall.klick.com --output=json > report.json

iDVB avatar Mar 21 '19 14:03 iDVB

Thanks for the additional context @iDVB!

To clarify though, in your case it is not a fatal error correct just the error in the logs?

patrickhulce avatar Mar 21 '19 15:03 patrickhulce

Yes, sorry @patrickhulce , I wasn't sure of the specific context of this issue. But in our case we're repeatedly getting this error in the logs and only for certain sites it seems? The real issue is that its causing the test to timeout and take 10x as long. Should it not just continue and not wait as long?

Questions:

  • What does the error even mean that we're getting in the log?
  • Why is it only happening on some sites and not others?
  • Why does it only happen when run as headless?
  • Why do the lighthouse perf scores drastically increase between headless (perf:0.54) and browser (perf:0.84)

Really want to use lighthouse as one of our defacto tests, but can't seem to get a reliable baseline. Is there a better venue to troubleshoot this issue?

iDVB avatar Mar 21 '19 19:03 iDVB

The manifest fetch timeout is capped to 3s so the error log itself is not the problem, but it seems like trying to fetch the manifest hangs Chrome for a very long time before it responds to all our other commands. This seems like a browser bug that should be filed over on crbug.com if it can be repro'd just by fetching the manifest.

patrickhulce avatar Mar 21 '19 19:03 patrickhulce

Too many similar issues

henrypan avatar Apr 02 '19 21:04 henrypan

Initial URL: https://nicholasireland.ca/ Chrome Version: 73.0.3683.86 Error Message: PROTOCOL_TIMEOUT Stack Trace:

LHError: PROTOCOL_TIMEOUT
    at eval (chrome-devtools://devtools/remote/serve_file/@f9b0bec6063ea50ce2b71f5b9abbae7beee319a6/audits2_worker/audits2_worker_module.js:1027:210)

Note: I only get this trying to run mobile insights, desktop seems to work fine.

xp-bar avatar Apr 13 '19 14:04 xp-bar

LHError: PROTOCOL_TIMEOUT
    at eval (chrome-devtools://devtools/remote/serve_file/@e82a658d8159cabbd4938c1660f9bb00b4a82a23/audits2_worker/audits2_worker_module.js:1027:210)

pankaj-nikam avatar Apr 21 '19 03:04 pankaj-nikam

Initial URL: http://curryhunter.com/restaurant-and-takeaways-near-me Chrome Version: 73.0.3683.103 Error Message: PROTOCOL_TIMEOUT Stack Trace:

LHError: PROTOCOL_TIMEOUT
    at eval (chrome-devtools://devtools/remote/serve_file/@e82a658d8159cabbd4938c1660f9bb00b4a82a23/audits2_worker/audits2_worker_module.js:1027:210)

almaruf avatar Apr 29 '19 13:04 almaruf

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)

dkreidler avatar May 03 '19 19:05 dkreidler

This has also been happening more frequently for me as well. I'm convinced that something on the Chrome-side (perhaps network service related to clearing cache?) has happened to make this more problematic. I'm not sure how to go about hunting such a thing down unfortunately :/

patrickhulce avatar May 03 '19 19:05 patrickhulce

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

ralf57 avatar May 08 '19 10:05 ralf57

Initial URL: http://kuafor.me/ Chrome Version: 73.0.3683.103 Error Message: PROTOCOL_TIMEOUT Stack Trace:

LHError: PROTOCOL_TIMEOUT
    at eval (chrome-devtools://devtools/remote/serve_file/@e82a658d8159cabbd4938c1660f9bb00b4a82a23/audits2_worker/audits2_worker_module.js:1027:210)

I can load http://kuafor.me in my browser just fine however when I run the lighthouse audit it crashes. When I try to run lighthouse against this URL programmatically I get:

Error: not opened
    at WebSocket.send (/var/task/node_modules/ws/lib/WebSocket.js:344:18)
    at CriConnection.sendRawMessage (/var/task/node_modules/lighthouse/lighthouse-core/gather/connections/cri.js:172:14)
    at CriConnection.sendCommand (/var/task/node_modules/lighthouse/lighthouse-core/gather/connections/connection.js:65:10)
    at Driver._innerSendCommand (/var/task/node_modules/lighthouse/lighthouse-core/gather/driver.js:432:29)
    at Promise (/var/task/node_modules/lighthouse/lighthouse-core/gather/driver.js:406:35)
    at new Promise (<anonymous>)
    at Driver.sendCommand (/var/task/node_modules/lighthouse/lighthouse-core/gather/driver.js:397:12)
    at /var/task/node_modules/lighthouse/lighthouse-core/gather/driver.js:1033:22
    at <anonymous> friendlyMessage: undefined }

Error: connect ECONNREFUSED 127.0.0.1:34387
    at Object._errnoException (util.js:1022:11)
    at _exceptionWithHostPort (util.js:1044:20)
    at TCPConnectWrap.afterConnect [as oncomplete] (net.js:1198:14)

bcam909 avatar May 09 '19 06:05 bcam909

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)

johnmcclumpha avatar May 13 '19 23:05 johnmcclumpha

Here's the error I'm getting, which I don't see here. I have tried unchecking "clear storage" but that didn't resolve. I've had this issue on two sites. Not sure if it's an issue, but we do have an htpasswd set up on this (dev) site.

NO_FCP

Channel: DevTools
Initial URL: https://hed-dev.brownrice.com/
Chrome Version: 74.0.3729.131
Stack Trace: LHError: NO_FCP
    at eval (chrome-devtools://devtools/remote/serve_file/@518a41c1fa7ce1c8bb5e22346e82e42b4d76a96f/audits2_worker/audits2_worker_module.js:1199:206)

paulwrightxyn avatar May 14 '19 19:05 paulwrightxyn

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

Developerayo avatar May 16 '19 08:05 Developerayo

I'm getting the same error as @ralf57... PROTOCOL_TIMEOUT

Channel: DevTools
Initial URL: https://staging.digitary.net/
Chrome Version: 74.0.3729.157
Stack Trace: LHError: PROTOCOL_TIMEOUT
    at eval (chrome-devtools://devtools/remote/serve_file/@7b16107ab85c5364cdcd0b2dea2539a1f2dc327a/audits2_worker/audits2_worker_module.js:1170:210)

PodClay avatar May 20 '19 05:05 PodClay

Same Error for me

PROTOCOL_TIMEOUT Channel: DevTools Initial URL: http://127.0.0.1:8000/me 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:21

tjp2021 avatar May 20 '19 13:05 tjp2021

Lighthouse Version: 5.0.0 Chrome Version: 74.0.3729.157 Error Message: PROTOCOL_TIMEOUT

Stack Trace:

LHError: PROTOCOL_TIMEOUT
    at Timeout.setTimeout [as _onTimeout] (/lighthouse/node_modules/lighthouse/lighthouse-core/gather/driver.js:399:21)

Kuzarek avatar May 23 '19 14:05 Kuzarek

PROTOCOL_TIMEOUT

Channel: DevTools
Initial URL: https://device.andreyalexeich.ru/#
Chrome Version: 74.0.3729.169
Stack Trace: LHError: PROTOCOL_TIMEOUT
    at eval (chrome-devtools://devtools/remote/serve_file/@78e4f8db3ce38f6c26cf56eed7ae9b331fc67ada/audits2_worker/audits2_worker_module.js:1170:210)

Eternal-Rise avatar May 25 '19 15:05 Eternal-Rise

PROTOCOL_TIMEOUT

Channel: DevTools
Initial URL: http://webtest.services.thron.com/alberto.deagostini/test-seo/examples/
Chrome Version: 74.0.3729.169
Stack Trace: LHError: PROTOCOL_TIMEOUT
    at eval (chrome-devtools://devtools/remote/serve_file/@78e4f8db3ce38f6c26cf56eed7ae9b331fc67ada/audits2_worker/audits2_worker_module.js:1170:210

albertodeago avatar May 28 '19 13:05 albertodeago

LHError: PROTOCOL_TIMEOUT at Timeout.setTimeout [as _onTimeout] (/lighthouse/node_modules/lighthouse/lighthouse-core/gather/driver.js:399:21)

what is the fix for this issue?

nagsrinath avatar May 31 '19 22:05 nagsrinath

@nagsrinath Chrome sometimes stops responding, most commonly when trying to clear the cache, so uncheck "Clear storage" and try again.

patrickhulce avatar May 31 '19 22:05 patrickhulce