Repository navigation
Description
Desktop: an unreachable saved remote server target leaves the app on a dead-end startup error
Workflow
I run the bb server on a Linux host and point the macOS desktop app at it over Tailscale, using Server ▸ Set Server URL… (a custom target, http://<host>.<tailnet>.ts.net:38886). I updated to the latest desktop build on an M1 MacBook Pro and launched the app.
What happened
The window rendered the startup error screen with a raw Electron internal stack trace:
Could not open bb
Error: ERR_FAILED (-2) loading 'http://<host>.<tailnet>.ts.net:38886'
at rejectAndCleanup (node:electron/js2c/browser_init:2:89743)
at finishListener (node:electron/js2c/browser_init:2:89905)
at WebContents.stopLoadingListener (node:electron/js2c/browser_init:2:90292)
at WebContents.emit (node:events:521:24)
Logs are under /Users/<me>/.bb/logs/.
The screen has no controls. Recovery is only via the Window ▸ Server menu, which the screen does not mention, or by hand-editing ~/Library/Application Support/bb/server-target.json.
What I expected
A screen that names the unreachable server and offers Retry and Use This Mac, the way the builtin and Connect-authentication failures already do.
Where it goes wrong
All references are on main at 0a985e6.
-
At startup, a non-builtin saved target goes to
applyServerTarget()without a guard —apps/desktop/src/main.ts:2214. -
The
custombranch loads the remote URL directly —apps/desktop/src/main.ts:1199-1207:bbAppLoaded = true; await loadWindowUrl({ url: target.url });
BrowserWindow.loadURLrejects withERR_FAILEDwhen the host is unreachable (host asleep, Tailscale down, server not running). Nothing catches it. -
The rejection unwinds to the top-level handler —
apps/desktop/src/main.ts:2219-2228— which renderserror.stack. That is why the user-facing text is Electron internals rather than a description of the problem. -
The error view is static HTML under
default-src 'none'—apps/desktop/src/local-view.ts:55-66,81. It cannot carry a button, so the screen is terminal by construction.
The same unguarded load exists on the connect branch at apps/desktop/src/main.ts:1194. That branch handles authentication failure gracefully (main.ts:1179-1187), but a successful authentication followed by an unreachable page load fails the same way. The builtin branch is the one that already does this well (main.ts:1144-1153).
Two related consequences of the throw:
refreshApplicationMenu()at the end ofapplyServerTarget()(main.ts:1208) never runs, so the Server menu keeps showing the failed target as active.bbAppLoadedis set totrueatmain.ts:1201before the load is known to have succeeded, so the app's own state says the workspace is loaded while the error screen is showing.
Suggested fix
The pieces are already in the tree:
probeBbServer/waitForCompatibleServerinapps/desktop/src/server-probe.tsare used today only for the local server. Probing a remote target before loading it would turn this into a handled outcome rather than a rejected promise.- Wrap the
customandconnectpage loads in the same shape as thebuiltinbranch: on failure, callloadStartupErrorwith a message naming the server and the fact that it is unreachable, thenrefreshApplicationMenu(). - Set
bbAppLoaded = trueonly after the load resolves. - Give the startup error view actionable recovery. That needs either a preload-backed local view instead of the current
data:URL, or at minimum error copy that names Window ▸ Server ▸ This Mac as the way out.
I am happy to open a pull request for this. Flagging it first since the last item touches how the local view is rendered, and per CONTRIBUTING.md that is closer to a UI change than a pure bug fix.
Environment
- macOS on an M1 MacBook Pro (desktop app), server on a separate Linux host
- Target kind:
custom, plainhttp://over a Tailscale hostname - Reproduces on launch, every time the target is unreachable
Activity
SawyerHood commentedon Aug 18, 2026
Reproduction & root-cause report: https://get-bb.github.io/reports/issues/1494.html
The report has copy-paste repro steps, screenshots where the bug is visual, code permalinks at
16ceb3a54, and repro artifacts. It was independently re-run by a second agent (see its Verification section).Recover from an unreachable saved remote server target (#2161)
Show why the Server menu lists no Connect servers (#2168)