Skip to content

macOS Desktop 0.43.1: /install/bb-app.tgz returns HTTP 500 with spawn npm ENOENT, blocking Modal provisioning #3773

Closed

Description

@bborn

Summary

Creating a thread with a Modal sandbox from bb Desktop 0.43.1 fails during bb machine setup because the server's /install/bb-app.tgz endpoint returns HTTP 500. The server log records spawn npm ENOENT while generating the host artifact. I expected the sandbox to download the matching bb daemon package and complete provisioning.

Versions and environment

  • bb Desktop 0.43.1, installed at /Applications/bb.app
  • macOS 15.2 (24C101), arm64
  • Bundled environment-modal-sandbox plugin 0.1.0
  • Default server port 38886 and data directory ~/.bb
  • bb Connect enabled; the local and public routes reproduce identically
  • BB launched normally as a macOS desktop application
  • Server process PATH: /usr/bin:/bin:/usr/sbin:/sbin
  • Homebrew npm: /opt/homebrew/bin/npm
  • Tested release tag: desktop-v0.43.1, commit 267938526dfcbc0edb228ce827b5bec202c1af97

Steps to reproduce

The artifact endpoint is the smallest reproduction and does not require allocating Modal compute.

  1. Launch bb Desktop normally on macOS.

  2. Confirm the installed server version:

    curl -sS http://127.0.0.1:38886/install/version
  3. Request the host artifact:

    curl -sS \
      --output /tmp/bb-app.tgz \
      --write-out '%{http_code}\n' \
      http://127.0.0.1:38886/install/bb-app.tgz
  4. Inspect the new entries in ~/.bb/logs/server-stdio.log.

To observe the product impact:

  1. Configure the bundled Modal sandbox plugin with valid credentials.
  2. Create a thread using the Modal sandbox environment.
  3. Provisioning reaches bb machine setup and fails while downloading /install/bb-app.tgz.

Expected vs actual

Expected:

/install/bb-app.tgz returns HTTP 200 with the server-matched bb host artifact.
The Modal machine installs the artifact, connects to BB, and thread provisioning continues.

Actual version and account checks:

$ bb --version
0.43.1

$ curl -sS http://127.0.0.1:38886/install/version
{"version":"0.43.1","protocolVersion":207}

$ bb modal account inspect --json
{"available":true,"message":"Connected to Modal (bb-sandboxes)"}

Actual artifact response:

$ curl -sS \
    --output /tmp/bb-app.tgz \
    --write-out '%{http_code}\n' \
    http://127.0.0.1:38886/install/bb-app.tgz
500

$ cat /tmp/bb-app.tgz
{"code":"internal_error","message":"Internal server error"}

The same request through the account's public *.getbb.app route also returns HTTP 500.

Modal provisioning reports:

Machine bootstrap command failed:

  bb machine setup

✗ Could not download the server's bb-app package from
  https://<account>.getbb.app/install/bb-app.tgz (HTTP 500).

Evidence

Two requests made at 2026-09-16 12:43:34 UTC—one against localhost and one through bb Connect—produced matching server errors:

[07:43:34] ERROR: [server] Unhandled server error
    err: {
      "type": "Error",
      "message": "spawn npm ENOENT",
      "stack":
          Error: spawn npm ENOENT
              at ChildProcess._handle.onexit (node:internal/child_process:287:19)
              at onErrorNT (node:internal/child_process:508:16)
              at process.processTicksAndRejections (node:internal/process/task_queues:90:21)
      "errno": -2,
      "code": "ENOENT",
      "syscall": "spawn npm",
      "path": "npm",
      "spawnargs": [
        "pack",
        "--pack-destination",
        "/Users/<user>/.bb/install-cache"
      ],
      "cmd": "npm pack --pack-destination /Users/<user>/.bb/install-cache",
      "stdout": "",
      "stderr": ""
    }

The running server is the installed desktop binary:

/Applications/bb.app/Contents/MacOS/bb
/Applications/bb.app/Contents/Resources/app.asar.unpacked/node_modules/bb-app/server/dist/index.js

Its environment contains:

PATH=/usr/bin:/bin:/usr/sbin:/sbin

The application ships a functional npm 11.16.0. Invoking it directly works even with an empty PATH:

PATH='' ELECTRON_RUN_AS_NODE=1 \
  /Applications/bb.app/Contents/MacOS/bb \
  /Applications/bb.app/Contents/Resources/app.asar.unpacked/node_modules/npm/bin/npm-cli.js \
  --version
11.16.0

Cause hypothesis

This is separate from the observed reproduction, but the release code strongly supports it.

The artifact builder passes bare "npm" to its command runner:

try {
const stdout = await commandRunner(
"npm",
["pack", "--pack-destination", cacheDir],
hostPackageRoot,
);

The default runner passes that command directly to execFile, requiring npm to be on the desktop server's PATH:

async function defaultCommandRunner(
command: string,
args: readonly string[],
cwd: string,
): Promise<string> {
const result = await execFileAsync(command, [...args], {
cwd,
maxBuffer: 10 * 1024 * 1024,
});
return result.stdout;

The desktop application already ships a working npm, but this artifact-generation path does not resolve or invoke it.

Investigation thread: https://whiny.getbb.app/threads/thr_t5qimadvke

What you ruled out

Suggested priority and effort

High — blocks Modal sandbox provisioning and potentially other fresh machine enrollment from affected macOS desktop installations launched with the normal GUI PATH. There is no supported user-facing workaround and the failure is surfaced only as HTTP 500. Effort is likely Low because the application already bundles a functioning npm and has existing code paths that resolve it explicitly.

AGENT GENERATED

Activity

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

    @bb-slop-cop
    Contributor

    🚨 SLOP COP 🚨 · new-issue-autopilot

    Applied Bug · High priority · Low effort; labels: desktop, confirmed-repro. No existing classifications were replaced.

    Reproduction and root-cause report — REPRODUCED at the artifact-service level, high root-cause confidence.

    At trusted main commit 6084f894305e389604ce19b1cace442b0fc25bad, the default artifact runner launches bare npm, so a restricted PATH produces ENOENT despite the bundled CLI being available. The repeatable test failed identically in two clean checkouts; invoking bundled npm by absolute path packed the same fixture successfully. Both repository builds passed. Installed Electron, HTTP, Connect, and full Modal provisioning were not exercised.

    No PR: the required correction affects host-artifact packaging, which this rule excludes from automatic fixes.

    AGENT GENERATED

  4. self-assigned this
    on Sep 18, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

Labels

confirmed-reprodesktop

Type

Projects

No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions