Skip to content

Retrying an install whose dependency failed is refused with "Port N is already in use" and the failed app disappears #138

Closed

Description

@nixfred

What happens

When an app that needs another app is installed and the dependency fails, both end up in the error state (the dependent says "Couldn’t install X, which this app needs."). Pressing "Try again" on the dependent calls apps.install for it. In install() (omarchyd/apps.mjs, around lines 1503-1524):

  1. the failed dependent is removed from the list and its folder deleted (lines 1503-1510), only for the app being installed, not for its failed dependency;
  2. the plan is [dependency, app]; the dependency's port check state.apps.some((a) => a.port === src.port) matches the failed dependency's own leftover entry, so it throws CONFLICT "Port N is already in use, so can’t be installed".

The message is wrong (nothing is using the port), and the dependent app, which was just deleted, is gone from the list. The user has to find and retry the dependency card first. (A leftover failed dependency is only removed later, at line 1559, after the checks.)

How to reproduce

I ran createApps with a store holding base and main (dependencies: [base]), and a stand-in run whose docker-compose pull fails once.

await P('apps.install', {appId: 'main'})   // base fails, main fails because of it
await P('apps.install', {appId: 'main'})   // retry, with pull working now

Actual: the first call leaves base and main both in error. The retry throws CONFLICT Port 31706 is already in use, so base can’t be installed, and afterwards apps.list shows only base (main has been removed).

Expected: the retry installs base and main, or at least keeps main and gives a real reason.

Suggested fix

Ignore entries in the error state when checking ports (they are about to be replaced), and clear failed dependencies like the failed app itself, or do the failed-app cleanup only after the plan and checks succeed.

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.

    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. A failed install stays until the plan and the port checks succeed. A later conflict no longer looks like the app disappeared. 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