Skip to content

Updating an app that has a USB device attached uses a stale compose.usb.yml, which breaks if a service was renamed #528

Closed

Description

@nixfred

What happens

When a USB serial device is attached to an app, writeUsbOverlay() in omarchyd/apps.mjs (~line 1095) writes compose.usb.yml with one devices: entry for every service name in the app's current compose.omarchy.yml. It is rewritten only when the app is started or restarted (lifecycle, ~line 1741). compose() then adds it as a second -f file to every command.

update() does not rewrite it. It calls placeApp() (which writes a new compose.omarchy.yml) and then runs docker-compose ... pull and up -d with the old compose.usb.yml still present. If the new version of the app renamed or removed a service, the overlay still has an entry for the old name, and Compose rejects a service that appears only in an override file:

service "old" has neither an image nor a build context specified: invalid compose project

So the update fails at "downloading the new version" with that message. Separately, a service that is new in the update never gets the device until the user restarts the app.

How to reproduce

I ran this through createApps() with a fake run: install app v1 (one service old), bindUsb('boss', {id: 'u1', path: '/dev/ttyUSB0'}), apps.restart, then change the store listing to v2 with the service renamed web and call apps.update.

After the update, compose.omarchy.yml has only web:, compose.usb.yml still has only:

services:
  old:
    devices:
      - /dev/ttyUSB0:/dev/ttyUSB0

and the commands issued were docker-compose -p omarchy-boss -f .../compose.omarchy.yml -f .../compose.usb.yml pull and ... up -d --remove-orphans. I confirmed with real docker compose -f base.yml -f overlay.yml config that this combination (service web in the base, old only in the overlay) fails with the error above.

Expected: the update rewrites the overlay for the new service names (or removes it) before running Compose.

Suggested fix

Call writeUsbOverlay(app) in update() right after placeApp().

Environment

Omarchy Server main (6aa7f7d, 0.9.52), 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. Updating an app rewrites compose.usb.yml for the services in the new compose file. A renamed service no longer keeps the old overlay. 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