Skip to content

An app that lists itself as a dependency, or two apps that depend on each other, cannot be installed and the error blames a port #789

Closed

Description

@nixfred

What happens

loadStore() (omarchyd/apps.mjs about line 923) builds each listing's needs with orderNeeds() and never removes the app itself, so a listing whose dependencies include its own id (or a pair that depend on each other) gets needs that contain itself. installPlan() then returns the app twice (once as a "need", once as the app). install() checks every port in the plan with ports.has(src.port), finds the same port twice, and answers Port N is already in use, so <app> can’t be installed. The port is free; the real problem is the dependency loop. Nothing in the store view tells the owner that the listing is broken, so the owner will hunt for a program using the port.

How to reproduce

I made a local git store with one app ouro whose omarchy-app.yml has dependencies: [ouro], added it and called apps.install. I did the same with aa -> bb -> aa.

Actual output:

listing: [{"id":"ouro","needs":["ouro"],"deps":["ouro"]}]
install error Port 31044 is already in use, so ouro can’t be installed

listing: [{"id":"aa","needs":["aa","bb"]},{"id":"bb","needs":["bb","aa"]}]
install error: Port 31214 is already in use, so aa can’t be installed

Expected: the listing is marked unsupported ("depends on itself") like a missing dependency is, or install says that the listing has a dependency loop.

Suggested fix

In loadStore() drop the app's own id from needs, and set unsupported when a loop is found, the way an absent dependency already is.

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.

    #870, #136, #595, #593, #743, #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. An app that depends on itself, or on a cycle, is marked unsupported instead of failing with a port error. 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