Skip to content

Apps: a failed Start, Stop or Restart shows only "Internal error" #632

Closed

Description

@nixfred

What happens

lifecycle() in omarchyd/apps.mjs (about line 1735, used by apps.start, apps.stop and apps.restart) runs compose(app, ...) in a try/finally with no catch. A failing docker-compose up, stop or restart (the port is taken by something else outside Omarchy Server, the image is gone, the disk is full, Podman is stuck) is a plain Error (execP() builds its message from the engine's last stderr lines), so sendError() in omarchyd/rpc.mjs answers 500 Internal error and the reason is only in the server log. The app screen's toast (useAction in web/src/data.ts) shows Internal error.

By contrast apps.update already wraps its errors (Couldn’t update Demo App while downloading the new version: ...). The machines screen has the same gap for power actions (#214); this is the apps side, which is a separate code path.

How to reproduce

I ran a real startOmarchyd with two stand-in executables first on PATH (podman, and docker-compose that fails up, stop and restart with the engine's usual text), a file-based store with one app, installed it, then:

docker-compose says: Error response from daemon: failed to bind host port 0.0.0.0:31001/tcp: address already in use

apps.stop    -> 500 {"error":{"message":"Internal error","code":-32000,"data":{"code":"INTERNAL_SERVER_ERROR","httpStatus":500}}}
apps.start   -> 500 "Internal error"
apps.restart -> 500 "Internal error"

The server log has the real reason (docker-compose: Error response from daemon: failed to bind host port ...). Expected: the toast shows the reason, as apps.update does, for example Demo App couldn’t start: docker-compose: Error response from daemon: failed to bind host port 0.0.0.0:31001/tcp: address already in use.

Suggested fix

Catch errors in lifecycle() and rethrow an RpcError with a short sentence plus the engine's last line (as the update code does), keeping RpcErrors unchanged.

Environment

Omarchy Server main (6aa7f7d, 0.9.52), Node 26.

Activity

  1. added a commit that references this issue on Nov 21, 2026
    2297fb7
  2. calledtoconstruct commented on Nov 21, 2026

    @calledtoconstruct
    Collaborator

    Thank you @nixfred. When an app fails to start, stop, or restart, the screen shows the container error. This is on main in #858.

    🤖 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