Skip to content

Machines: when Start, Restart or another power action fails, the user only sees "Internal error" #214

Done

Description

@nixfred

What happens

The power actions in lifecycle() (omarchyd/machines.mjs, about lines 584-627: start, shutdown, restart, force stop, pause, resume, hibernate) let plain Error objects escape. Those come from execP (every failing virsh call) and from the deliberate message at line 604:

if (Date.now() > end) throw new Error(`${m.name} didn’t shut down within 3 minutes; use Stop, then Start`)

sendError() in omarchyd/rpc.mjs (lines 17-24) only passes the message through for RpcError; every other error becomes HTTP 500 with the text "Internal error". So the instruction in line 604, and the reason virsh gives (for example "unsupported configuration", "Failed to start domain", a missing passt binary), never reach the user. The web app shows e.message in a toast (for example web/src/desktop/Desktop.tsx line 541 and the power actions in web/src/machines/panels.tsx), so the toast reads "Internal error". The real reason is only in the task history and the server log.

The same applies to machines.updateSettings / markChanged() when virsh define fails.

How to reproduce

I ran createMachines() with a fake run that makes virsh start fail with "error: Failed to start domain: unsupported configuration", created a machine, stopped it, and called machines.start. The thrown error was passed to sendError.

Actual: HTTP 500, body {"error":{"message":"Internal error",...}}.
Expected: a message that says why the machine did not start (or, for the restart timeout, the existing "didn’t shut down within 3 minutes; use Stop, then Start" text).

Real-world trigger for the timeout message: change a hardware setting on a running machine whose guest ignores ACPI shutdown, then press Reboot.

Suggested fix

Wrap the failure in lifecycle() (and markChanged/updateSettings) in an RpcError('PRECONDITION_FAILED' or 'BAD_GATEWAY', error.message) so the message reaches the client, as create() already does by storing error.message for the machine.

Environment

Omarchy Server main (0786ba9, 0.9.50), Node 26.

Activity

  1. nixfred commented on Nov 25, 2026

    @nixfred
    CollaboratorAuthor

    Working to resolve this.

  2. added a commit that references this issue on Nov 25, 2026
    b6b5e2d
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