Skip to content

Remote bridge verification discards actionable errors and reports only HTTP 500/502 #352

Closed

Description

@devswha

What happens

Remote-PC verification discards the structured error from /api/bridge. When Herdr’s socket/Windows marker is absent, the bridge knows that the file is missing, but the user sees only:

Bridge verification failed (500). Reconnect after checking the remote bridge.

This prevents distinguishing a missing marker from another internal error and gives no actionable Herdr/session diagnosis. A connection failure similarly loses its connect_failed detail behind a generic 502.

Verified reproduction

Tested archived source 31a8c2124798e730acdb4e6cbe6f155a55e17172, package v0.3.43, macOS arm64, existing Bun 1.3.14 and Node 22.23.1. Bun is below the documented >=1.4 minimum; the status/body loss is explicit source behavior and was exercised directly.

  1. Point HERDR_SOCKET at a nonexistent file in a new temporary directory.
  2. Start createServer on loopback with a disposable token/stateDir, machines:false, registerBridge:false, and tailscaleOwner:null.
  3. GET /api/bridge with the fixture token.
  4. Exercise the original MachineManager.prototype.verify against that server using a fake SSH forward implemented as a second loopback HTTP proxy. No remote SSH connection is needed.
  5. Repeat after creating a regular placeholder file at the same path, with no daemon listening.

Sanitized output:

{"state":"missing socket/marker","status":500,"response":{"error":{"code":"internal_error","message":"ENOENT: no such file or directory, stat '<qa-temp>/herdr.sock'"}}}
{"state":"missing socket/marker","verificationMessage":"Bridge verification failed (500). Reconnect after checking the remote bridge."}
{"state":"marker exists but no daemon","status":502,"response":{"error":{"code":"connect_failed","message":"cannot reach herdr at <qa-temp>/herdr.sock: Failed to connect"}}}
{"state":"marker exists but no daemon","verificationMessage":"Bridge verification failed (502). Reconnect after checking the remote bridge."}

Source

  • server/bridge.ts, bridgeIdentity(): calls statSync(socket) before ping(). Missing or unreadable marker/socket errors can become HTTP 500 through errorResponse.
  • server/machines.ts:398–399, verify(): checks response.ok, then throws the generic status-only message without reading the structured body.
  • A successful response’s bundle/protocol/socket checks are later and produce different messages. Missing PTY support follows the mirror path. Those cases do not explain this exact message.

Expected

Give a safe, actionable explanation such as “Herdr’s socket/marker is missing for this session”, retaining bounded diagnostic information without exposing credentials or blindly displaying arbitrary upstream response text. A retry alone cannot explain what the operator must inspect.

Scope

The live app displayed a remote-PC 500, but its root cause is not proven. Remote logs were unavailable under the no-reconnect QA constraint. The confirmed defect here is loss of diagnostic information, reproduced entirely with owned loopback fixtures. This is not a claim that the Windows PC’s socket was missing.

Duplicate search found no matching report; #185/#256 cover old bundle versions, and #227 fixed dead-descriptor selection, which is a different condition. No source fix, commit, push, paid prompt, install/update, remote reconnect, permission change, pairing or live-session modification. All fixture servers stopped and temporary state removed.

Activity

  1. added a commit that references this issue on Oct 2, 2026
    3110a68
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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions