Skip to content

Uninstalling an app while it is installing leaves its containers and gateway running with no app record #136

Closed

Description

@nixfred

What happens

uninstall() in omarchyd/apps.mjs (around line 1701) never checks busy, unlike update and the start/stop/restart handlers, which refuse with " is busy". While an install is still running (the image pull can take minutes), uninstall closes the gateway, runs compose down, deletes the app folder, drops the app from state.apps and clears the busy entry in its finally. The install loop is still running with the removed app object: it carries on with compose up -d, openGateways(app) and save().

Result: running containers, a re-created app folder and an open gateway port for an app that is no longer installed, shown nowhere in the UI and not removable from it. The same missing check applies to uninstalling during an update.

The Uninstall button is disabled while the list says the app is busy, so this needs a stale page, a second device, or an API/assistant call, but the server should refuse it itself.

How to reproduce

I ran createApps with a stand-in run where pull takes 500 ms:

await P('apps.install', {appId: 'demo-app'}); await sleep(150)
await P('apps.uninstall', {appId: 'demo-app'})   // accepted, returns true
await sleep(1500)

Actual: apps.list is empty, but the recorded compose commands are pull, down, up (the up runs after the uninstall), and the app's gateway port still accepts connections.

Expected: uninstall fails with " is busy" while the app is installing or updating.

Suggested fix

Throw a CONFLICT in uninstall() when busy.has(app.id), as the other procedures do (and set busy before the first await).

Environment

Omarchy Server main (0786ba9, 0.9.50), 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.

    #870, #595, #593, #743, #789, #739, #764, #132, and #681 share the app installer with this and will land in one pull request.

    🤖 Generated with Grok 4.7

  2. calledtoconstruct commented on Nov 22, 2026

    @calledtoconstruct
    Collaborator

    Thank you @nixfred. Uninstall is refused while that app is installing or updating, so the install cannot leave containers running with no record. This is on main in #874.

    🤖 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