Skip to content

An app with an unplugged USB stick bound to it is started with that stick's path in devices: anyway #804

Closed

Description

@nixfred

What happens

The USB passthrough design (docs/superpowers/specs/2026-11-18-usb-passthrough-design.md, section 6 "Persistence" and section 11 "Error handling") says:

  • "each entry with a live path is added as a compose devices: bind ... Missing path (unplugged) is skipped at start and shown on the tab as unplugged."
  • "Compose start with a bound stick that is unplugged: start anyway; skip that bind; tab shows Unplugged"

The code does not check whether the stick is there. writeUsbOverlay() in omarchyd/apps.mjs (around line 1132) passes every stored app.usbDevices entry to usbComposeOverlay() in omarchyd/usb.mjs, and that function only checks that the stored path matches SERIAL_PATH:

const binds = (devices ?? []).map((d) => d.path).filter((p) => SERIAL_PATH.test(p)).map((p) => `${p}:${p}`)

The stored path is the /dev/serial/by-id/... link saved when the stick was attached, so it is always a well-formed string, whether or not the link exists today. Nothing looks at the host at start time.

Consequence: unplug the Zigbee stick (or reboot with it removed) and press Start or Restart on Home Assistant. The compose file handed to docker-compose up -d still contains devices: - /dev/serial/by-id/usb-...:/dev/serial/by-id/usb-.... Podman does not create a container whose device source does not exist (it reports "no such file or directory"), so the app should fail to start, which is exactly what the design says must not happen. The person has to open the Devices tab and press Remove on a stick that is not even plugged in, and then bind it again later.

How to reproduce

I ran the real createApps() against a throwaway data dir with one installed app that has one bound stick, with a recording run and no /dev/serial tree on the host at all:

// apps.json: {apps:[{id:'ha', state:'running', usbDevices:[{id:'usb-X-if00', path:'/dev/serial/by-id/usb-X-if00'}]}]}
await apps.procedures['apps.start'].run({appId: 'ha'})

Actual: docker-compose ... -f compose.omarchy.yml -f compose.usb.yml up -d is run, and compose.usb.yml contains

services:
  ha:
    devices:
      - /dev/serial/by-id/usb-X-if00:/dev/serial/by-id/usb-X-if00

I did not run this against a real Podman; the refusal of a missing device source is Podman's documented and usual behaviour.

Expected: the path is not on the host, so no overlay is written (compose.usb.yml removed) and the app starts without the stick.

Suggested fix

In writeUsbOverlay(), keep only the entries whose path currently exists (for example access(path) or membership in a fresh listHostUsb() result) before building the overlay.

Environment

Omarchy Server main (9e1bd67, 0.9.53), Node 26.

Activity

  1. calledtoconstruct commented on Nov 21, 2026

    @calledtoconstruct
    Collaborator

    Working to resolve this.

    No open pull request references this issue, and no one has commented that they are working on it.

    This shares the app manager with #804, #688, #138, #679, #528, and #134. They share code and will land in one pull request.

    🤖 Generated with Grok 4.7

  2. calledtoconstruct commented on Nov 21, 2026

    @calledtoconstruct
    Collaborator

    Thank you @nixfred. An unplugged stick stays bound to the app, and its path is left out of the overlay until the node is there. This is on main in #844.

    🤖 Generated with Grok 4.7

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