Skip to content

bb Connect drops every 20–30s; persistent HTTPS connections to the account endpoint also stall #7500

Open

Description

@am1599567

Summary

On bb 0.49.0 desktop for Windows, the bb Connect tunnel reconnects every 20–30 seconds. Every reconnect drops the enrolled Linux host's daemon WebSocket, so terminal and provider commands fail with 502/504 even though both machines and the remote site remain responsive. An independent curl reproduction shows that a second request over the same HTTPS connection to the account's getbb.app endpoint stalls, while a fresh connection succeeds immediately.

Versions and environment

  • bb 0.49.0, Windows desktop app; confirmed latest release with bb updates --json.
  • Windows 11 Pro, build 26300.
  • Built-in Connect plugin [email protected].
  • bb server runs on the Windows laptop; one manually enrolled persistent Linux host connects through bb Connect.
  • No source install, custom agent provider, or managed worktree is involved in the reproduction.

Steps to reproduce

  1. Run bb desktop on Windows and enroll a Linux machine through bb Connect.
  2. Keep bb Connect enabled and watch logs/server.*.log.
  3. Run a real command on the remote machine, for example bb terminal run --machine <machine> -- sh -c 'uptime', or read an existing terminal's output.
  4. Observe repeated tunnel closed (code 1006) / Daemon WebSocket closed cycles. Commands time out with 504 while the machine status briefly shows connected between reconnects.

A separate reproduction without bb credentials or an agent (replace ACCOUNT with a valid account name; HTTP 401 is expected):

curl -sS -o /dev/null --max-time 15 \
  -w '1: HTTP %{http_code} %{time_total}s\n' https://ACCOUNT.getbb.app/ \
  --next -sS -o /dev/null --max-time 15 \
  -w '2: HTTP %{http_code} %{time_total}s\n' https://ACCOUNT.getbb.app/ \
  --next -sS -o /dev/null --max-time 15 \
  -w '3: HTTP %{http_code} %{time_total}s\n' https://ACCOUNT.getbb.app/

Observed both with the VPN app running and after closing it:

1: HTTP 401 0.305s
curl: (28) Operation timed out after 15013 milliseconds with 0 bytes received
2: HTTP 000 15.014s
3: HTTP 401 0.334s

Expected vs actual

Expected: the Connect WebSocket and ordinary HTTP keep-alive connections remain usable; a remote command returns normally.

Actual sanitized log excerpts:


tunnel connected {"lookupMs":1,"connectMs":37,"tlsMs":116,"upgradeMs":342}
tunnel closed (code 1006) {"transportError":null,"connectedDurationMs":21165,"lastHeartbeatAckAgeMs":null}
Daemon WebSocket closed
Terminal session disconnected with daemon session


Other observed `connectedDurationMs` values in the latest window include 19924, 24281, 30916, and 39215. `lastHeartbeatAckAgeMs` is consistently `null`. Real terminal operations return `504 terminal_open_timeout` or `504 terminal_output_timeout`; provider discovery intermittently returns 502 while the tunnel is down.

Evidence

  • Thirty sequential Node fetch requests to the account endpoint, two seconds apart: 15 completed and 15 exceeded a five-second timeout. Repeating after closing the VPN app produced exactly 15/30 failures again.
  • The curl reproduction above deterministically stalled the second request on the reused HTTPS connection in both runs.
  • An alternate resolved address for the same getbb.app endpoint reproduced the same second-request stall, so this is not tied to one selected edge address.
  • Control WebSocket to an unrelated public echo service stayed open for 75 seconds, returned 14/14 test messages, and closed cleanly with code 1000.
  • Three keep-alive requests to an unrelated Cloudflare-hosted site completed in 0.379s, 0.054s, and 0.065s.
  • Sixty ICMP packets to the local gateway and sixty to 1.1.1.1: zero loss on each path.
  • The remote production HTTPS page returned 200 in 0.13s during the bb failures.
  • Account name, host/thread IDs, local paths, and remote IP addresses are intentionally omitted for privacy. The complete sanitized investigation is contained in this report.

What you ruled out

Suggested priority and effort (optional)

High for this deployment: the enrolled host is effectively unusable through bb Connect, with no configured workaround and no data loss observed. Effort unknown; please check whether the account-edge connection or its return path stops delivering frames/responses after the first request or heartbeat.

Checks

  • I reproduced this on the latest release or on main, or I say above that I could not.
  • I searched open and closed issues for the same problem.
  • If an agent wrote this, the body ends with > AGENT GENERATED and links the thread or report.

AGENT GENERATED

Activity

  1. added theissue type on Nov 13, 2026
  2. added
    remote
    connect
    no-repro
    on Nov 13, 2026
  3. bb-slop-cop commented on Nov 13, 2026

    @bb-slop-cop
    Contributor

    🚨 SLOP COP 🚨 · new-issue-autopilot

    • Classification: Bug · Priority High · Effort Medium. Added remote, connect; no existing classifications were replaced.
    • Reproduction report: NOT REPRODUCED · root-cause confidence low · reproduction label no-repro.
    • Two clean checkouts of trusted main each sustained over 90 seconds: 49/49 HTTPS requests on one TLS connection, 46/46 proxied WebSocket echoes, and acknowledged heartbeats. All 37 selected existing tests passed. These local checks do not cover the affected Windows machine or deployed account-edge path.
    • Root cause remains unestablished. The heartbeat watchdog sends every 20 seconds and terminates only after its 60-second acknowledgement deadline is exceeded; an anonymous 401 response is returned before tunnel forwarding. Neither fact identifies why the reported persistent connections stall.
    • No PR: the initiating failure was not reproduced on trusted main, so no failing regression supports a safe fix. Next: compare alternate network/Windows paths and correlate sanitized request times with stored edge logs.

    AGENT GENERATED

  4. am1599567 commented on Nov 15, 2026

    @am1599567
    Author

    Thanks for the clean-main control results. The failure is still live on the affected Windows path. Here are fresh UTC timestamps and edge request IDs for correlation, plus one correction to my earlier description: the stall is not always on the second request.

    Fresh sequential Node fetch requests using the default keep-alive behavior, same account endpoint, no proxy or active VPN adapter, anonymous 401 expected:

    2026-11-15T07:17:37.195Z  request 1: 401 in 299 ms, CF-RAY a5ac7a295f9cf126-DME
    2026-11-15T07:17:37.501Z  request 2: 401 in 264 ms, CF-RAY a5ac7a2a4ab8f12f-DME
    2026-11-15T07:17:37.765Z  request 3: no response; client timeout after 15011 ms, no CF-RAY
    

    In the same window, the remote production HTTPS page returned 200 in 129 ms. This agrees with your observation that the anonymous 401 is generated before tunnel forwarding and does not itself establish the root cause. It also gives a reproduction that does not involve an agent, the remote application, or the bb origin server.

    One new detail from the latest bb window: the Connect tunnel connected at 2026-11-15T06:53:36.795Z with CF-RAY a5ac56fb2e2af136-DME and did not log another tunnel close in this window. Nevertheless, at 2026-11-15T07:17:55.748Z the server logged Daemon sent nothing within its lease; closing its socket (leaseTimeoutMs: 30000). A replacement daemon WebSocket opened at 07:17:58.398Z; remote operations around it returned 502/504. So the current symptom can be a daemon heartbeat/return-path failure even while the outer Connect tunnel remains connected.

    I cannot test an alternate ISP because no mobile hotspot is available. I am not claiming that the trusted-main code is the root cause; the clean control is useful evidence that this depends on the affected Windows/network/account-edge path.

    Could you please correlate the two successful request IDs and the third request's missing response with the stored edge logs, and check the daemon heartbeat return path around 07:17:55.748Z? If another specific sanitized capture would help, I can collect it.

    AGENT GENERATED

  5. am1599567 commented on Nov 15, 2026

    @am1599567
    Author

    One more live A/B sequence that may help narrow this down. It shows that a reopened daemon session does not necessarily restore the command channel, and that remote resource pressure is absent.

    2026-11-15T07:35:37.116Z  Connect tunnel connected, CF-RAY a5ac9483fb88f131-DME
    2026-11-15T07:36:07.120Z  tunnel closed 1006 after 30002 ms; lastHeartbeatAckAgeMs=null
    ~2026-11-15T07:37:48Z     real `bb terminal run` on the remote host SUCCEEDED
    2026-11-15T07:38:22.516Z  next daemon lease expired: no data within 30000 ms
    2026-11-15T07:38:23.632Z  replacement daemon WebSocket opened
    2026-11-15T07:38:29.032Z  new real `bb terminal run` started
    2026-11-15T07:38:39.671Z  request failed with 504 terminal_open_timeout
    

    The successful command reported remote load average 0.46, 0.32, 0.28, 1.4 GiB available RAM, 1.7 GiB free swap, and 11 GiB free disk. The remote HTTPS page also returned 200 in 140 ms in the same period.

    The significant part is the last interval: the replacement daemon WebSocket was already open before the second command started, yet the terminal-open request still timed out. Thus connected / Daemon WebSocket opened does not prove that requests or heartbeat frames are actually flowing in both directions. This also makes remote CPU, RAM, swap, and disk exhaustion unlikely causes of this failure window.

    AGENT GENERATED

  6. am1599567 commented on Nov 15, 2026

    @am1599567
    Author

    I now ran the missing alternate-ISP check using a mobile hotspot. The result separates ordinary HTTPS keep-alive from the bb daemon/WebSocket failure.

    Alternate network: 30/30 HTTPS requests succeeded. Sequential Node fetch requests with default keep-alive ran for 70 seconds, two seconds apart. All returned the expected 401 with no timeout; all were at HEL:

    2026-11-15T10:34:51.537Z  first: 401, CF-RAY a5ad9b17891557a3-HEL
    2026-11-15T10:35:58.909Z  last:  401, CF-RAY a5ad9cba4da457a3-HEL
    summary: 30/30 succeeded, 0 timeouts in 70 seconds
    

    This contrasts with the home network, where the same test produced 15/30 timeouts. Thirty ICMP packets to 1.1.1.1 over the mobile path also had zero loss (average 71 ms).

    The bb remote-host channel still failed over the same mobile path:

    2026-11-15T10:32:12.964Z  tunnel closed 1006 after 2357 ms, CF-RAY a5ad97241f31f82c-HEL
    2026-11-15T10:32:46.802Z  tunnel closed 1006 after 26994 ms, CF-RAY a5ad975e5e6d2682-ARN
    2026-11-15T10:33:40.886Z  first real remote terminal command failed: 409 Host disconnected
    2026-11-15T10:35:32.125Z  second remote command failed: 504 terminal_output_timeout
    

    The second command was intended to emit a timestamp every 10 seconds for 90 seconds; output stopped before completion. During this period the remote production page returned 200 in 233 ms.

    Unlike the earlier home-network records, some mobile-path tunnel records have a non-null lastHeartbeatAckAgeMs (for example 5433 ms), so some heartbeat acknowledgements do arrive before the drops. The failures also crossed HEL and ARN.

    This suggests two separable behaviors: the anonymous HTTPS keep-alive stall is network-path dependent, but the bb daemon/WebSocket failure persists across ISPs and edge locations. It is therefore not explained by one home ISP, one Cloudflare address/colo, or remote resource pressure.

    AGENT GENERATED

  7. am1599567 commented on Nov 16, 2026

    @am1599567
    Author

    @ymichael Could you please re-triage this issue and reconsider no-repro?

    Since the initial clean-main check, we have added evidence showing:

    1. Path-dependent HTTPS stalls: 15/30 failures on home internet, but 30/30 successes on mobile and with VPN.
    2. BB daemon/WebSocket failures across home, mobile, and VPN, and across DME/HEL/ARN.
    3. A replacement daemon WebSocket opening before a command that still times out.
    4. Exact UTC timestamps and CF-RAY IDs in the comments above.

    The remote VPS is healthy and responds normally. This appears to need account-edge and daemon-heartbeat investigation rather than another local reproduction.

    AGENT GENERATED

  8. peterkimpk1 commented on Nov 16, 2026

    @peterkimpk1

    Additional observed Connect/daemon disruption on macOS, BB 0.49.0 (built-in Connect 0.1.1, Browser Automation 0.1.1 / SDK 0.6.132). A Mac mini serves BB and an enrolled MacBook runs local headless Browser Automation through Connect. This is a related observation, not a reproduction of the Windows HTTPS keep-alive test or a confirmed shared root cause.

    Two capture attempts on 2026-11-16 failed at the transport boundary:

    • 16:14:18.110 UTC: the serving Mini logged tunnel closed (code 1006); its daemon WebSocket closed at .113 and the tunnel reconnected at 16:14:19.358. Browser calls in the same interval returned HTTP 502 and then unknown command 'browser-automation'. The already authenticated browser session became stopped and could not resume.
    • 17:13:42.734 UTC: a fresh supported browser-open request created session bookkeeping. The MacBook daemon disconnected at .763, reconnected at 17:13:44.731, and reported worker ready at 17:13:45.057. The wrapper then failed with command_failed: Host is not connected (observed by 17:13:52.003). An authenticated local application GET had succeeded before browser-open; that does not prove host RPC readiness.

    Both disposable capture jobs cleaned up their own containers, locks, browser sessions, environment files and ports. No service, plugin, host or network restart was performed. Active unrelated providers/jobs were left alone. No further browser retry is being used as a diagnostic loop.

    Current connected/registered metadata does not establish that the interruption is repaired. The inner rejected RPC call ID and the historical in-memory artifact generation were not exposed and are unknown. These observations do not establish sleep, update, server event-loop stall, mount failure, authentication expiry, registry restart or the separate Browser Automation timeout defect as the cause.

    Could the Connect/daemon maintainer advise the supported next diagnostic or recovery path, preserving active providers and jobs, and where to route this timestamped incident for transport correlation? The local logs show the tunnel/session churn, but do not establish why it happened. No BB source patch or runtime intervention is proposed yet.

    Prepared from a read-only Infra packet, NM-876 / thread thr_pabamqfsjx. Private host/account identifiers, credentials and unrestricted logs are intentionally omitted.

    AGENT GENERATED

  9. beaverbeard commented on Nov 23, 2026

    @beaverbeard

    Related production observation from macOS/Linux, not a reproduction of the Windows keep-alive test or proof of a shared root cause.

    On 2026-11-23, after moving this BB server to an Ubuntu24 VPS, ordinary Connect intermittently delays thread loads and interrupts the enrolled Mac's command/browser channel. The server has a private/patched runtime and custom plugins; its installed npm metadata reports BB0.49.0, built-in Connect0.1.1. The Mac desktop reports BB0.49.0. This is not a clean-upstream reproduction.

    Abrupt tunnel close with a fresh heartbeat

    The server's Connect log records:

    2026-11-23T16:02:50.486Z
    tunnel closed (code 1006)
    transportError=null
    connectedDurationMs=21025
    lastHeartbeatAckAgeMs=2
    colo=FRA
    ray=a5f166037ceb3675-FRA
    openHttpStreams=1, openWsStreams=4, bufferedBytes=0
    
    2026-11-23T16:02:53.222Z
    tunnel connected
    lookupMs=25, connectMs=408, tlsMs=441, upgradeMs=771
    ray=a5f166989bfeabab-FRA
    

    Real enrolled-Mac calls intermittently returned Host is not connected, browser timeouts, or stale desktop-generation errors. A later machine-status read said connected; that does not establish continuous command-channel health. Browser cleanup also timed out during this window.

    Same browser profile, same readonly requests, both routes

    An official desktop Browser Automation tab on the Mac measured identical readonly timeline requests through ordinary Connect, then an existing SSH loopback fallback, then Connect again. All returned200 and the same decoded response sizes.

    Request Connect before Direct fallback Connect after
    Timeline A,27575decoded bytes 644ms 111ms 707ms
    Timeline B,16703decoded bytes 446ms 243ms 576ms
    Global providers 782ms 151ms 2417ms

    Connect used HTTP/2; resource timing showed0–3ms before requestStart in this window. This is request timing, not click-to-render timing, and not a statistically controlled benchmark.

    In a separate sample, the existing origin-timing instrumentation reported18.8ms until origin headers for timeline A, versus622ms until headers on the Mac. For timeline B, those were536ms and1248ms. Some origin delays also remain; we do not attribute all perceived slowness to the hosted gate.

    Local disk pressure is being investigated separately. Mail and reindex jobs were paused without a user-observed resolution. No sleep, VPN, host-capacity, auth-expiry, or particular network-hop cause is established by this packet.

    Next fallback currently cannot complete TLS

    The user enabled Connect Next, but it remains offline with remote error: tls: handshake failure. At approximately16:31UTC, a credential-free standard TLS probe from the VPS, with normal SNI and certificate verification, showed:

    • tunnel.next.getbb.app: remote handshake-failure alert.
    • The account's ACCOUNT.next.getbb.app: the same remote alert.
    • The account's ordinary ACCOUNT.getbb.app: TLS1.3 completed.

    An earlier independent probe from the Mac showed the same Next/control distinction, including TLS1.2. These failures occur before BB credentials are sent. Certificate verification was never disabled. We cannot infer missing DNS/certificates or an incorrect FRP configuration from the alert alone.

    Could you correlate the supplied UTC/ray with the gate logs and advise the supported recovery/diagnostic path? Is Next expected to be reachable for ordinary getbb.app accounts at those endpoints? We can provide another bounded, timestamped capture if a specific missing fact would distinguish the failure modes.

    Account label, host/thread IDs, private paths, IP addresses, credentials, request headers and message contents are omitted. No public server port was opened, and no extra model/API inference was used for these tests.

    AGENT GENERATED

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    connectno-reproremote

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions