Skip to content

macOS desktop 0.42.0: missing README.md makes daemon auto-update return HTTP 500 #3118

Closed

Description

@ben-vargas

Summary

After upgrading a two-Mac setup to bb Desktop 0.42.0, the enrolled execution machine remained offline with Needs update · daemon protocol 176 · server protocol 180, even though both desktop apps were already updated. The primary desktop server's /install/bb-app.tgz endpoint returns HTTP 500 because host-package generation tries to copy a README.md missing from the installed application. The enrolled daemon should download the matching package, restart, and reconnect automatically.

Versions and environment

  • Primary: bb Desktop 0.42.0, /Applications/bb.app, macOS 26.6.2 (25G83), arm64; server protocol 180.
  • Enrolled machine: bb Desktop 0.42.0, macOS 27.0 (26A5425a), arm64; separate launchd-managed bb-app daemon still at 0.41.0, protocol 176.
  • Daemon runtime: Node 24.14.0, npm 11.9.0.
  • Existing enrollment uses host-daemon --auto-update, a private npm prefix under ~/.bb-machines/<server>/npm, and its original pairing/configuration.
  • The local desktop targets the primary's custom HTTPS URL over Tailscale, on port 38886. The enrolled daemon listens locally on 38888.
  • No provider-specific operation is needed to reproduce this.
  • Live reproduction used installed release binaries. Source inspection used commit 7d5de7301544de3073996b4f8a8c33b311ecb2db; a source-built server was not tested.

Steps to reproduce

The smallest reproduced failure is the download endpoint on the running macOS desktop server; a second machine is not needed to exercise that failure.

  1. Run the installed macOS bb Desktop 0.42.0 application as a server.

  2. Set BB_REPRO_SERVER to that server's reachable URL. For the observed setup this was an existing Tailscale HTTPS URL:

    BB_REPRO_SERVER='https://YOUR-PRIMARY.YOUR-TAILNET.ts.net:38886'
    curl -sS -i "$BB_REPRO_SERVER/install/version"
    curl -sS -i "$BB_REPRO_SERVER/install/bb-app.tgz"
  3. Observe a successful version response followed by HTTP 500 for the package download.

  4. On the primary Mac, check the expected source file:

    test -f /Applications/bb.app/Contents/Resources/app.asar.unpacked/node_modules/bb-app/README.md \
      && echo README_PRESENT || echo README_MISSING

    Actual output: README_MISSING.

  5. Inspect the primary's ~/.bb/logs/server.*.log for the ENOENT copy failure below.

Observed upgrade impact: an existing launchd-managed 0.41.0 daemon with --auto-update reaches this endpoint after the primary starts serving protocol 180. Its download fails repeatedly, so it stays on protocol 176 and Settings → Machines shows it offline. This was observed in the existing installation; a fresh enrollment was not tested.

Expected vs actual

Expected: /install/bb-app.tgz serves the server-matched daemon package, allowing the existing enrolled machine to update and reconnect.

Actual response excerpts, reproduced again on September 5 after recovering the client:

HTTP/2 200
content-type: application/json

{"version":"0.42.0","protocolVersion":180}
HTTP/2 500
content-type: application/json

{"code":"internal_error","message":"Internal server error"}

Exact daemon error messages:

Failed to open session: 400 Bad Request - Daemon protocol version 176 does not match server protocol version 180
Package download failed: 500 Internal Server Error
Daemon self-update failed; keeping the current daemon running and retrying normally.

Evidence

Primary server log excerpt. Only the username and generated temporary-directory suffix are redacted:

ENOENT: no such file or directory, copyfile '/Applications/bb.app/Contents/Resources/app.asar.unpacked/node_modules/bb-app/README.md' -> '/Users/<user>/.bb/install-cache/host-package-<suffix>/README.md'
    at async copyFile (node:internal/fs/promises:622:10)
    at async materializePackagedHostPackage (.../bb-app/server/dist/start-server.js:322892:3)
    at async buildArtifact (.../bb-app/server/dist/start-server.js:322932:34)

The observed exception matches the unconditional README copy in materializePackagedHostPackage, lines 208–211. The download route calls getArtifact() before returning the tarball, so this missing documentation file prevents the update payload from being served.

This packaged-host materialization path was introduced by PR #2969, merged September 2. The failure is confirmed in the released desktop installation; the build-stage reason the README is absent has not been independently traced.

Verified recovery: installed the official [email protected] npm package into the enrolled daemon's existing private prefix and gracefully restarted its launchd service. The daemon logged Connected to server, retained the same machine identity, and both machines appeared online with all 11 project associations intact. The primary's download endpoint still returns HTTP 500, so this is a workaround, not a fix for the server bug.

What you ruled out

  • Tailscale reachability or TLS failure: SSH and HTTPS requests to the primary succeeded; /install/version returned HTTP 200 and the daemon reached the server's protocol validation.
  • Disabled daemon auto-update: the existing launchd arguments include --auto-update, and logs show repeated self-update attempts and backoff.
  • Merely an outdated desktop app: both desktop applications were already 0.42.0; the enrolled daemon is a separate installation.
  • An npm install failure causing this incident: the updater fails at the server's package-download step, before npm installation. Manual installation of 0.42.0 succeeded.
  • Broken pairing: the updated daemon reconnected using its original identity and configuration.
  • Duplicate reports: searched open and closed issues/PRs for the README copy error, artifact endpoint, and daemon update failure. #2968 requests the host-only artifact feature; #2997 concerns skipped daemon startup with BB_INSTALL_SKIP_SERVICE=1, which is a different failure.

Suggested priority and effort

High: blocks automatic recovery of an enrolled machine after its desktop primary upgrades to an incompatible protocol. Manual npm update is a verified workaround; project associations were preserved in this recovery. Effort needs triage, including coverage against the actual packaged macOS layout.

AGENT GENERATED - GPT-6 Astra High

Activity

  1. added theissue type on Sep 5, 2026
  2. added
    desktop
    confirmed-repro
    on Sep 5, 2026
  3. bb-slop-cop commented on Sep 5, 2026

    @bb-slop-cop
    Contributor

    🚨 SLOP COP 🚨 · new-issue-autopilot

    • Classification: Type Bug · Priority High · Effort Low · labels desktop, confirmed-repro
    • Report: https://get-bb.github.io/reports/issues/3118.html
    • Verdict: REPRODUCED · root-cause confidence: high
    • Root cause: Electron Builder omits the bb-app README from packaged node modules, while host-artifact materialization unconditionally copies it, producing ENOENT and an HTTP 500 response.
    • Reproduction label: confirmed-repro
    • Pull request: none — every root-cause correction changes packaging, which this autopilot's simple-fix rules exclude.
  4. skillet07 commented on Sep 5, 2026

    @skillet07

    Confirming this on a different setup — same root cause, but with a Linux host daemon rather than a second Mac, so the failure is not macOS-daemon-specific.

    Environment

    • Server: bb Desktop 0.42.0 on macOS (arm64), reachable through its *.getbb.app URL (Cloudflare-fronted). /install/version → {"version":"0.42.0","protocolVersion":180}.

    • Enrolled machine: Ubuntu 24.04 (kernel 7.0.0-30-generic), x86_64. No bb Desktop there — a systemd user unit runs the daemon directly:

      ExecStart="/usr/bin/node" "/home/<user>/.bb-machines/<server>/npm/bin/bb-app" host-daemon --auto-update --host-daemon-port "38888" --server-url "https://<user>.getbb.app"
      Environment="BB_APP_NPM_PREFIX=/home/<user>/.bb-machines/<server>/npm"
      
    • Daemon package stuck at 0.41.0 (protocol 176) against server protocol 180.

    Observed

    bb machine show on the client:

    { "status": "disconnected", "lastRejectedProtocolVersion": 176 }

    Daemon log, repeating every ~30s:

    Failed to open session: 400 Bad Request - Daemon protocol version 176 does not match server protocol version 180
    Package download failed: 500 Internal Server Error
    Daemon self-update failed; keeping the current daemon running and retrying normally.
    

    bb machine retry-update <id> is accepted by the server but cannot help, since the daemon is already disconnected and its own retry path hits the same 500.

    Endpoint probe from two different networks (the server Mac itself and the Linux host), unauthenticated:

    /install/bb-app.tgz     500   {"code":"internal_error","message":"Internal server error"}
    /install/bb-app.tar.gz  401
    /install                401
    /api/health             401
    

    Only /install/bb-app.tgz reaches a handler that throws; everything else stops at the auth wall. Server log on the Mac, matching #3118 exactly:

    ENOENT: no such file or directory, copyfile
      '/Applications/bb.app/Contents/Resources/app.asar.unpacked/node_modules/bb-app/README.md'
      -> '/Users/<user>/.bb/install-cache/host-package-<suffix>/README.md'
        at async materializePackagedHostPackage (.../server/dist/start-server.js:322892:3)
        at async buildArtifact (.../server/dist/start-server.js:322932:34)
    

    And README.md is indeed absent from /Applications/bb.app/Contents/Resources/app.asar.unpacked/node_modules/bb-app/ in the shipped 0.42.0 build (siblings present: app, dist, host-daemon, package.json, scripts, server, src, tsconfig.json, vitest.config.ts).

    Workaround for non-desktop enrolled machines

    Since the daemon on Linux is a plain npm install, bypassing the server artifact works — install the version matching the server's from the public registry and restart the unit:

    npm install -g --prefix ~/.bb-machines/<server>/npm [email protected]
    systemctl --user restart bb-host-daemon-<server>.service

    After that the daemon logs Connected to server and bb machine show reports "status": "connected", "lastRejectedProtocolVersion": null.

    Suggestions

    1. Ship README.md in the packaged bb-app (or make materializePackagedHostPackage tolerate optional files — a missing README should not take down host enrollment).
    2. Make buildArtifact failures return a diagnosable error rather than a generic internal_error 500; the daemon-side message Package download failed: 500 gives an operator nothing to act on.
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

    confirmed-reprodesktop

    Type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions