Skip to content

K2GO-450 fix(install): trust the Ansible PLAY RECAP, not stray [ERROR] lines - #631

Merged
luisguzman-adfa merged 5 commits into
mainfrom
fix/K2GO-450-forgejo-seed-fail-loud
Oct 5, 2026
Merged

luisguzman-adfa merged 5 commits into
mainfrom
fix/K2GO-450-forgejo-seed-fail-loud

Conversation

@luisguzman-adfa

Copy link
Copy Markdown
Collaborator

Installing Forgejo as a module failed with "Couldn't install" even though the
install succeeded (Ansible PLAY RECAP failed=0, exit 0, Forgejo reachable). The
Forgejo role has an ignore_errors task that prints [ERROR]/fatal lines, and
AnsibleRunOutcome treated any [ERROR] as a failure, so the install was marked
FAILED, reverted, and the repo seed (gated behind a successful install) never
ran: no admin user, no example repos.
Change: AnsibleRunOutcome now treats the PLAY RECAP (unreachable=/failed=) as
ansible's authoritative verdict when present; the softer [ERROR] signal is used
only when no recap was emitted. Hard crash signatures (multiprocessing /
heartbeat) and a non-zero exit always fail, even after a clean recap. This is
the single shared verdict for every ansible module install.
Verification:

  • JVM unit tests (AnsibleRunOutcomeTest): ignored-error + clean recap -> not
    failed; real-failure recap -> failed; unreachable -> failed; crash after a
    clean recap -> failed; crash/[ERROR] with no recap -> failed.
  • Device (OnePlus, clean Basic box): Forgejo module install now succeeds and the
    seed creates the admin + example repos (seed idle -> running -> done). The same
    install false-failed before the fix.
    Note on commits: the branch includes two earlier commits that took a wrong
    approach (orchestration _fj_ensure_running + a seed.sh trap) plus their reverts;
    the branch was already pushed, so they were reverted forward rather than
    rewritten. The net diff is the AnsibleRunOutcome change.

An abnormal seed death (unbound var under set -u, a sourced-file abort, any
step that exits the shell) left the status stuck on "running", so the app
polled a dead seed for ~20 min with no signal. An EXIT trap now flips a
lingering "running" to "error" with a log breadcrumb; the app already treats
"error" as failure, so it fails fast. dash-node 1.3.14 ships it via the
Rebuild (no rebake). Cause-independent: the module-install seed failure root
cause is still open (K2GO-450).
…tall path

On module-install the forgejo role enables and restarts forgejo inside a
transient proot that is then killed, so the live proot never starts the
freshly-enabled service: the seed's wait_200 waits the whole window and fails
with an empty log (admin never created; "a relaunch fixes it"). seed_forgejo
now calls _fj_ensure_running first, which starts forgejo idempotently via pdsm
(the sanctioned in-proot control, ADR-5343 section 10) when it is not already
serving: no-op on the Full/boot path and when pdsm is absent. Not a duplicate
owner: it invokes pdsm, the service owner, rather than a new flag or state.
dash-node 1.3.14 ships it via the Rebuild (no rebake).
…] lines

A forgejo module install succeeds (ansible failed=0, exit=0, forgejo reachable)
but the forgejo role has an ignore_errors task that prints [ERROR]/fatal lines.
AnsibleRunOutcome treated any [ERROR] as failure, so the install was marked
FAILED (exit=0) and reverted, which gated out the repo seed: admin never
created, no repos (the K2GO-450 symptom). The PLAY RECAP (unreachable=/failed=)
is ansible's authoritative verdict: trust it when present, and fall back to the
[ERROR]/crash signatures only when no recap was emitted (a crash before the
summary, the original ADFA-4435 case). Shared by every ansible module install.
@luisguzman-adfa
luisguzman-adfa merged commit c53d64d into main Oct 5, 2026
3 checks passed
@luisguzman-adfa
luisguzman-adfa deleted the fix/K2GO-450-forgejo-seed-fail-loud branch October 5, 2026 01:17
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant