Skip to content

daemon.json missing under a live daemon: rig daemon stop refuses, stale daemon-start.lock left behind #3953

Backlog

Description

@davey64

Version: 0.7.19 (found while upgrading to 0.7.21), macOS.

What happened

  • ~/.openrig/daemon.json was missing while the daemon was still running (pid alive, port 7433 answering).
  • rig daemon stop refused to stop it, because there was no state file to read the pid from.
  • daemon.log stopped updating on 11-20 at 10:37, so the file most likely vanished then. We do not know why.
  • A stale daemon-start.lock from the 11-20 start was still present, holding the pid of the live daemon.

Expected
Stop should still work (for example by falling back to the lock file or the port), or the daemon should rewrite its state file when it finds it missing.

Workaround
We recreated daemon.json with the values OpenRig records at start (pid, port, host, db path), archived the stale lock, and then the normal stop and upgrade worked.

Not known: what removed the file. Happy to test a fix or gather more detail if you tell us what to look at.

Activity

  1. added
    bug
    area: install-setup
    needs-triage
    on Nov 25, 2026
  2. mvschwarz commented on Nov 25, 2026

    @mvschwarz
    Owner

    Thanks, @davey64, for the clear report, the workaround and the offer to test.

    We found a possible explanation in the 0.7.19 source: a start that cannot confirm readiness can leave the daemon running, retain the startup lock and return without writing daemon.json. In that situation, the normal stop cannot target it. That fits the missing state file and surviving lock you described, but the lock alone does not prove it; we haven't established whether the file was never written or disappeared later.

    0.7.21 includes recovery code for some pending starts, using extra process-identity fields in newer lock files. That code rejects the older lock format written by 0.7.19. We're working on the stop-recovery gaps for older locks and missing state files; we haven't tested your upgrade scenario yet.

    If you still have the archived lock or the original startup output, could you share the lock's launcherPid, childPid and startedAt fields, and any startup error message? In particular, did it say "Daemon startup is pending after the readiness deadline" or that listener verification was incomplete? That would help narrow down what happened. No need to recreate the failure on your running daemon.

  3. moved this to In Progress in OpenRig roadmapon Nov 25, 2026
  4. mvschwarz commented on Nov 26, 2026

    @mvschwarz
    Owner

    Thanks again, @davey64, for the report. The stop part is fixed on main as f83b04ef (#3957): when daemon.json is missing, rig daemon stop now identifies the running daemon from its own facts (the listener's /healthz PID, whose output goes to this home's daemon.log) and stops it normally, instead of refusing with "Daemon state is missing". So a stop or an upgrade no longer needs daemon.json recreated by hand. It's on main and not yet in a published release.

    We're keeping this issue open because we haven't established why daemon.json went missing in the first place. If it happens again, the startup lock's launcherPid, childPid and startedAt fields and any startup error would still help.

  5. modified the milestones: v0.7.25, v0.7.26 on Nov 27, 2026
  6. mvschwarz commented on Nov 28, 2026

    @mvschwarz
    Owner

    @davey64, an update: #3957 is now released in OpenRig 0.7.25. When daemon.json is missing, rig daemon stop identifies the running daemon from its own facts and stops it normally, instead of refusing. This issue stays open for why daemon.json went missing in the first place; if it happens again, the startup lock's launcherPid, childPid and startedAt fields and any startup error would still help.

  7. modified the milestones: v0.7.26, v0.7.27 on Nov 28, 2026
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

    area: install-setupbugneeds-triage

    Type

    No type

    Projects

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions