Skip to content

Two apps that use the Tor proxy, uninstalled at the same time, leave the Tor container running #743

Closed

Description

@nixfred

What happens

uninstall() in omarchyd/apps.mjs has no busy check, and stopTorIfIdle(exceptId) (about line 1466) decides by looking at the compose files of every other app still in state.apps. When two Tor-using apps are uninstalled at overlapping times, each call finishes compose down, then each finds the other app still listed with its folder in place, so each decides Tor is still needed. Both apps are then removed and nothing stops omarchy-tor. It stays up (and its system/tor folder stays) until some later Tor app is installed and uninstalled. This is the situation the Tor fix was meant to end.

How to reproduce

I installed two apps whose compose file uses ${TOR_PROXY_IP}, with a fake docker-compose whose down takes 200 ms, then ran both uninstalls at once:

await Promise.all([call('apps.uninstall', {appId: 'a'}), call('apps.uninstall', {appId: 'b'})])

Actual output:

before: tor up = true
apps left: []
after both uninstalled: tor up = true tor dir exists = true

Expected: tor up = false and no system/tor folder.

Suggested fix

Run the Tor idle check after the app is removed from state.apps (and serialise uninstalls), so the last one to finish sees an empty list.

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, #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. Two Tor apps uninstalled together both finish, and the Tor proxy stops. 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