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

☔️ Protocol error (Tracing.start): Tracing is already started #1091

Closed
maulanaahmadarif opened this issue Dec 1, 2016 · 25 comments
Closed

Comments

@maulanaahmadarif
Copy link

maulanaahmadarif commented Dec 1, 2016

NOTICE FOR DUPLICATE BUG FILERS: The only known fix for this is usually completely restarting the browser, and sometimes with a completely fresh profile.

Lighthouse Version: 1.2.2
Chrome Version: 57.0.2937.0
Error Message: Protocol error (Tracing.start): Tracing is already started
Stack Trace:

   at ExtensionConnection.handleRawError (chrome-extension://blipmdconlkpinefehnmjammfjpmpbjk/scripts/lighthouse-background.js:7377:11)
   at Object.chrome.debugger.sendCommand.result [as callback] (chrome-extension://blipmdconlkpinefehnmjammfjpmpbjk/scripts/lighthouse-background.js:7526:33)
   at safeCallbackApply (extensions::sendRequest:21:15)
   at handleResponse (extensions::sendRequest:74:7)```
@ebidel
Copy link
Contributor

ebidel commented Dec 1, 2016 via email

@maulanaahmadarif
Copy link
Author

I'm using canary right now
https://lab.ydigital.asia/precision/

@paulirish
Copy link
Member

This one is hard to solve. It happens on occasion and the best solution is restarting chrome right now.

If this continues we can look into ways of forcing Chrome to stop tracing even after we've disconnected.

@brendankenny
Copy link
Member

for errors that are causing this, we could add an attempt to stop tracing in the gather-runner cleanup. If the error caused us to lose connection to devtools it won't work, but it may help in some cases

@paulirish
Copy link
Member

@caseq tells me that the tracing backend should stop the trace is the protocol client has disconnected. So everything is lined up to make this work, though there may be a race condition.

I'm having trouble reproducing this bug (though I have hit it before).

If anyone can find a reliable repro for this, please comment with it.

@gauntface
Copy link

I have a reproducible test case. Will try and reduce so you can either use it for debugging OR add it as part of the integration tests.

@ebidel
Copy link
Contributor

ebidel commented Apr 7, 2017

Yes, I switched tabs originally and came back and it was still running, then it appeared to be running in all of my tabs, then I closed the window and now clicking the extension button gives me the error here.

@patrickhulce
Copy link
Collaborator

crazy idea: we could always try to stop tracing before doing anything and just throw away any exception that results

@mssodhi
Copy link

mssodhi commented Jan 24, 2019

Here's an attached screen shot from www.yahoo.com site audit. Tested on Version 73.0.3681.0 (Official Build) canary (64-bit). The error message says "Something went wrong with recording the trace over your page load. Please run Lighthouse again.", in case that helps. I've quit/closed the app, and restarted, and it still happens.
screen shot 2019-01-23 at 4 49 04 pm

@connorjclark
Copy link
Collaborator

@mssodhi thanks for reporting. I can share that we are aiming to push 4.0.0 to the next Chrome (not yet in Canary), and in doing so I see that this tracing error no longer happens. Could be that next Canary will have this issue resolved.

@mssodhi
Copy link

mssodhi commented Jan 24, 2019

@hoten thanks for the update!

@exterkamp exterkamp added P1.5 and removed P1 labels Jul 23, 2019
@patrickhulce
Copy link
Collaborator

patrickhulce commented Aug 26, 2020

We believe this is primarily due to Chrome tracing in the background and is fixed with chrome-launcher v0.13.3 (GoogleChrome/chrome-launcher#203).

If you cannot use that version of chrome-launcher because you're running from DevTools or another channel make sure Chrome is started with the following flag --force-fieldtrials=*BackgroundTracing/default/.

@paulirish
Copy link
Member

Moreover, there are some Chrome changes that happened recently that may have resolved this at the Chrome layer.

These changes are in Chrome 88+. googlers, see 🔒 crbug.com/1058632 for discussion.

status:

  • as patrick mentioned, we already have flipped off BackgroundTracing with chrome flags, so that was already addressed.
  • The above changes should make it so that flag isnt necessary anymore and a new tracing session would prempt an existing bg tracing one.
  • we suspect a tracing_already_started case comes from an initiated tracing session that wasn't gracefully completed. the above changes may also solve that case.

so in general we should be good (in Chrome 88+) and any more of these errors can raise eyebrows.

@Daudxu
Copy link

Daudxu commented Aug 17, 2023

Protocol error (Tracing.start): Tracing has already been started (possibly in another tab).

Channel: DevTools
Initial URL: http://127.0.0.1:5173/login
Chrome Version: 116.0.0.0
Stack Trace: w: Protocol error (Tracing.start): Tracing has already been started (possibly in another tab).
    at devtools://devtools/bundled/devtools-frontend/front_end/services/puppeteer/puppeteer.js:1:6938
    at new Promise (<anonymous>)
    at j.send (devtools://devtools/bundled/devtools-frontend/front_end/services/puppeteer/puppeteer.js:1:6871)
    at ProtocolSession.sendCommand (devtools://devtools/bundled/devtools-frontend/front_end/third_party/lighthouse/lighthouse-dt-bundle.js:604:258)
    at Trace.startSensitiveInstrumentation (devtools://devtools/bundled/devtools-frontend/front_end/third_party/lighthouse/lighthouse-dt-bundle.js:152:471)
    at async devtools://devtools/bundled/devtools-frontend/front_end/third_party/lighthouse/lighthouse-dt-bundle.js:610:696
    at async collectPhaseArtifacts (devtools://devtools/bundled/devtools-frontend/front_end/third_party/lighthouse/lighthouse-dt-bundle.js:610:827)
    at async _navigation (devtools://devtools/bundled/devtools-frontend/front_end/third_party/lighthouse/lighthouse-dt-bundle.js:623:67)
    at async _navigations (devtools://devtools/bundled/devtools-frontend/front_end/third_party/lighthouse/lighthouse-dt-bundle.js:625:637)
    at async devtools://devtools/bundled/devtools-frontend/front_end/third_party/lighthouse/lighthouse-dt-bundle.js:625:260

@neha023
Copy link

neha023 commented Oct 2, 2023

I am facing the same issue, Using chrome browser and when I use lighthouse on my website's admin pages got the below error.

Chrome Version 116.0.5845.96

Protocol error (Tracing.start): Tracing has already been started (possibly in another tab).

Channel: DevTools
Initial URL: https://www.*******.com/admin/catalog/product/edit/id/8565/key/441e91a2d205ac73d47cfcab2cf954c142e0a40a7ce450d74b74366b7fe8d23f/
Chrome Version: 116.0.0.0
Stack Trace: w: Protocol error (Tracing.start): Tracing has already been started (possibly in another tab).
    at devtools://devtools/bundled/devtools-frontend/front_end/services/puppeteer/puppeteer.js:1:6938
    at new Promise (<anonymous>)
    at j.send (devtools://devtools/bundled/devtools-frontend/front_end/services/puppeteer/puppeteer.js:1:6871)
    at ProtocolSession.sendCommand (devtools://devtools/bundled/devtools-frontend/front_end/third_party/lighthouse/lighthouse-dt-bundle.js:604:258)
    at Trace.startSensitiveInstrumentation (devtools://devtools/bundled/devtools-frontend/front_end/third_party/lighthouse/lighthouse-dt-bundle.js:152:471)
    at async devtools://devtools/bundled/devtools-frontend/front_end/third_party/lighthouse/lighthouse-dt-bundle.js:610:696
    at async collectPhaseArtifacts (devtools://devtools/bundled/devtools-frontend/front_end/third_party/lighthouse/lighthouse-dt-bundle.js:610:827)
    at async _navigation (devtools://devtools/bundled/devtools-frontend/front_end/third_party/lighthouse/lighthouse-dt-bundle.js:623:67)
    at async _navigations (devtools://devtools/bundled/devtools-frontend/front_end/third_party/lighthouse/lighthouse-dt-bundle.js:625:637)
    at async devtools://devtools/bundled/devtools-frontend/front_end/third_party/lighthouse/lighthouse-dt-bundle.js:625:260

@shivamconan
Copy link

Facing this issue as well while trying to send CDP command via selenium -

selenium.common.exceptions.WebDriverException: Message: unknown error: unhandled inspector error: {"code":-32000,"message":"Tracing has already been started (possibly in another tab)."}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests