Skip to content

Upgrade reports success and moves current without checking that dashboard, p2pool and tor are healthy #4393

Open

Description

@pithead-developer

What's the problem

In lib/pithead/03-release-verify.sh (upgrade path, around lines 213-223), compose_up_checked -d returns, then the code optionally provisions the dashboard onion and calls update_current_symlink, and the upgrade is reported as done. up -d only waits on services that other services depends_on. The dashboard, p2pool and tor are not waited on, so a release whose dashboard crash-loops still ends in "upgraded". The current -> symlink has already moved and the in-place path has no rollback.

What it impacts

Any operator upgrading to a release with a broken dashboard, p2pool or tor image. They are told the upgrade worked and find out later, with the old version directory no longer the active install.

How I found it

The 2026-11-23 full-repo audit (code reading, skeptic-verified, not run). Re-check on current develop: confirmed the sequence compose_up_checked then onion step then update_current_symlink with no health wait in between. Compose healthchecks exist and have start periods of 60 s (dashboard, p2pool) and 600 s (tor), so health status is available to poll.

How important is it

Medium. A bad image is reported as a good upgrade and the pointer moves, but the stack is usually recoverable by hand. It matters most for unattended or one-click upgrades.

Acceptance criteria

  • After the up, the upgrade polls State.Health.Status of dashboard, p2pool and tor (those that are enabled for this config) until healthy or a bounded timeout.
  • A service that is unhealthy or exited at timeout makes the upgrade fail with the service name, before update_current_symlink runs.
  • A healthy stack still upgrades with no extra operator step; tor's 600 s cold-bootstrap start period does not cause a false failure on a normal upgrade.
  • A test with a stub docker inspect returning unhealthy for the dashboard asserts a non-zero exit and an unmoved symlink.

Possible solutions

  • Add a wait_services_healthy helper that polls docker inspect per service with a per-service timeout based on its start period.
  • Gate only on dashboard and p2pool, and treat tor as warn-only, to keep the wait short.
  • Combine with a rollback of the compose project to the previous version when the gate fails.

From the 2026-11-23 full-repo audit (finding 9), deferred from the 2.0.4 re-cut by the owner.

Release: date 2026-11-30
Who: operator

Activity

  1. added this to the v2.0.5 milestone on Nov 23, 2026
  2. added
    bug
    on Nov 23, 2026
  3. pithead-developer commented on Nov 23, 2026

    @pithead-developer
    ContributorAuthor

    Needs an operator action (do it, then remove the operator-action label):

    PR #4406 needs an owner-only rewrite of head branch agent/4393-clean from observed remote head 49772a30d07bb65003adc351fca7dcf77c544ccc onto develop-v2.0.5 before it can merge. Candidate preparation runs locally; its evidence will follow if available. Verify the candidate, target-base SHA, selected commits, check results and prior review coverage before publication. Publish only to the same PR head branch with an explicit lease on 49772a30d07bb65003adc351fca7dcf77c544ccc, followed by the base change; if the remote head moved, stop and reassess. Preserve the existing PR discussion and review history; a replacement PR requires explicit owner approval. Keep this issue open; remove only the operator-action label after verifying publication. The rewritten head needs fresh checks and review, then any required owner approval; old PASS or approval evidence must not be carried to it.

  4. added
    operator-action
    on Nov 23, 2026
  5. pithead-developer commented on Nov 23, 2026

    @pithead-developer
    ContributorAuthor

    Candidate preparation for PR #4406 (owner publication still required):

    Owner-only in-place rewrite of PR #4406 is needed before merge; nothing was pushed and the PR is unchanged. Head branch agent/4393-clean, observed remote head 49772a3, which carries develop commits that develop-v2.0.5 lacks. Its only own commit is 49772a3.

    Candidate: local branch candidate/4393-v205, one commit, full SHA b092def0561ba856e6f0b4cffd1a199bcb80f3a0, on target base develop-v2.0.5 at 2dd1f61. Diff is 2 files, +75 lines: lib/pithead/03-release-verify.sh and tests/stack/control/test-control-upgrade-lock.sh. The candidate lives in a scratch worktree under the session's $TMPDIR, which the runner deletes when the session ends.

    Selected commit: 49772a3 only, recommitted with the earlier session's uncommitted fixes. The candidate differs from the original in three ways:

    • The test's backticks are escaped (they were command substitution).
    • The expected step order is corrected from "verify,compose," to "compose,", because the stub never emits verify.
    • The test sits in test-control-upgrade-lock.sh instead of test-control-upgrade.sh, which is at its file-budget ceiling.

    Checks on the candidate:

    • make lint-file-budget lint-pithead-build passed with GITHUB_BASE_REF=develop-v2.0.5.
    • shellcheck on the two changed files reported only the existing SC1090/SC2034/SC2329 notes.
    • The new assertion passes in isolation against a freshly built pithead (PASS=1, FAIL=0).
    • It fails with wait_services_healthy stubbed to succeed (got compose,symlink,provision), so the test fails without the gate.
    • The full tests/stack/run.sh could not run on this Mac because BSD awk breaks the block-layout audit. The tests/stack run on GitHub CI is the unrun proof, and no bench job was run.

    Existing review evidence: I found no PASS or approval record for PR #4406 in this session. Any earlier PASS covered 49772a3 and is void for the rewritten head. The new head needs fresh CI, a fresh non-author review and any required owner approval.

    Request: publish b092def0561ba856e6f0b4cffd1a199bcb80f3a0 to agent/4393-clean with git push --force-with-lease=agent/4393-clean:49772a30d07bb65003adc351fca7dcf77c544ccc, then change PR #4406's base to develop-v2.0.5. If the remote head has moved from 49772a3, stop and reassess. Keep the existing PR and its discussion; no replacement PR.

  6. removed
    operator-action
    on Nov 27, 2026
  7. pithead-architect commented on Nov 27, 2026

    @pithead-architect

    Owner decision (2026-11-27): the earlier request to rewrite this work onto develop-v2.0.5 is cancelled, because bug and security fixes now go to develop. The open PR is redone on develop (rebase, conflicts fixed, fresh review); the prepared candidate is not force-pushed. This hold is lifted for that redo.

  8. added
    operator-hold
    on Nov 27, 2026
  9. pithead-architect commented on Nov 27, 2026

    @pithead-architect

    Held again for a few days, without an owner action: the owner's cancellation of the rewrite stands, and this PR will be redone on develop automatically (held until the 2.0.5 fold, or rebuilt on a fresh branch from develop with a replacement PR). This hold only stops wasted review passes until that change is live, and is lifted then.

  10. removed
    operator-hold
    on Nov 28, 2026
  11. pithead-developer commented on Nov 28, 2026

    @pithead-developer
    ContributorAuthor

    Hold lifted: the runner change for the owner's 2026-11-27 decision is live. A PR on the line that folds into develop waits for the fold and then retargets; a PR on a line that does not fold is rebuilt by the runner on a new branch as a replacement PR with a fresh review. No force-push.

  12. pithead-developer commented on Nov 28, 2026

    @pithead-developer
    ContributorAuthor

    Waiting on a transient bench_outage condition, not on another issue. bench-ci list --all --fleet --commit fff4467 --json: connection refused (Errno 61) on all 5 client attempts — the same symptom the reviewer recorded on 2026-11-28. bench-submit --repo pithead --tier tier4-e2e --option mode=targeted held: 'tier1/tier2 not passed for the head' (head's GitHub checks still reporting: Shell lint, Shell tests blocks 1-5, Browser user journeys, dashboard legs); a held submit creates no job. The runner re-checks it (first at 2026-11-28T18:15Z, at most 5 times).

  13. pithead-developer commented on Dec 4, 2026

    @pithead-developer
    ContributorAuthor

    Blocked on #4674. Fixes for every returned finding are pushed (head f715a8e) and the PR body and docs are updated; the fresh targeted tier4-e2e that F4406-6 asks for cannot be submitted yet. bench-submit holds tier4 until all GitHub checks pass, and Build image (tor) fails on every branch because Alpine retired the pinned tor=0.4.9.17-r0 (pithead#4674, no tor file in this diff). The local stack suites pass except environmental reds, and the blocker is explained in a PR comment. What unblocks it: #4674 lands on develop. Then bring develop in, wait for green checks, and submit bench-submit --repo pithead --tier tier4-e2e --commit <new head> --ref 4406 --base develop --option mode=targeted. Paste the evidence block unedited into the PR body.

    The runner resumes this issue when that one closes.

  14. added
    blocked
    on Dec 4, 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

    blockedbug

    Type

    No type

    Projects

    No projects

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions