Conversation
Connection state can be fully green while every action-layer command times out: 'bsk browsers' lists the browser, 'bsk doctor' is all ok, and metadata commands still answer, so the symptom points at the extension by default. The distinguishing evidence is in 'bsk logs': a single instance_id whose generation keeps climbing alongside 'client did not send handshake in time' and 'handshake first-frame timeout'. That is one extension control plane being dropped for missing HANDSHAKE_FIRST_FRAME_TIMEOUT (5s) and reconnecting into the same registry slot, not two browsers competing for one id. Because a reconnect replaces the registered BrowserClient under the same instance_id, an action RPC issued during the cycle can wait on a connection that is already being replaced. The registry holds a live entry throughout, so nothing reports a lost connection and the caller only sees a timeout. Document the log signature, what it is not (daemon restart, the multi-instance case in Tencent#272/Tencent#246, a stuck CDP session), and the graduated recovery steps. Link it from the connection-verification step and the developer guide index.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Ran into a state today that cost me a couple of hours because every signal the CLI gives you points at the wrong thing, so I wrote up the diagnosis. Docs-only, no code changes.
The symptom
bsk browserslists the browser.bsk doctorisokon every line.bsk tab listanswers. But anything that drives the page hangs:Even
about:blank+evaluate "1+1"times out. I spent a while reloading the extension and restarting the daemon, since "connected" is the only state the CLI surfaces.What the log actually showed
bsk logshad the answer the whole time:{"message":"browser connected","id":"23841dec","generation":5} {"message":"client did not send handshake in time; dropping connection","timeout_secs":5} {"message":"ws connection error","error":"handshake first-frame timeout"} {"message":"browser reconnect: replacing previous registration","old_generation":9,"new_generation":10} {"message":"browser connected","id":"23841dec","generation":10}One
instance_id,generationclimbing 1→10. So it's a single extension control plane that keeps missingHANDSHAKE_FIRST_FRAME_TIMEOUT(crates/bsk-cli/src/daemon/ws.rs, 5s) and reconnecting into the same slot — not two browsers competing for one id, which is what thegenerationnumbers first suggested to me.And then the part that explains why the error is a bare timeout instead of a clean disconnect: a reconnect replaces the registered
BrowserClientunder the sameinstance_id, so an action RPC issued during the cycle can be waiting on a connection that's already being torn down. The registry has a live entry the whole time, so nothing ever reports a lost connection.The doc
docs/troubleshooting-wedged-actions.md:instance_idconstant,generationclimbing)Debugger is not attached to the tab, which is chrome.debugger wedges for all profiles once a second profile connects (Yandex Browser 26.8, bsk 0.3.0) #272)Linked from the "Verify the connection" step in Quick Start, where someone hitting this would be looking, and from the developer guide index next to the other doc links.
Why I think this is worth a page rather than just "reload it"
Every state the CLI prints can be true while actions are unusable.
connected,doctor: ok,browsers: 1— all correct, all misleading. The one line that resolves it (handshake first-frame timeoutnext to a climbing generation) isn't in the summary output, so the default path is to debug the extension. A doc is the cheapest fix; if you'd rather surface that condition indoctor(e.g. warn when a reconnect replaces a live generation more than N times in a window), I'm happy to take a shot at that instead or as well.Verified against the source
Both constants the doc cites are real, and I checked line references against current
main:HANDSHAKE_FIRST_FRAME_TIMEOUT—crates/bsk-cli/src/daemon/ws.rs:173DEFAULT_INITIAL_DELAY_MS/DEFAULT_MAX_DELAY_MS—apps/extension/src/transport/ws-transport.ts:4-5crates/bsk-cli/src/daemon/browsers.rs(Registry::insert)Environment
Windows,
bsk0.3.0, daemon 0.3.0, extension 0.3.0, protocol 1.3, Chrome 153, default profile. Recovered after the reconnect cycle settled; I did not capture a clean before/after on an idle machine, so I've deliberately written the doc around the log signature rather than claiming a specific trigger.