ops: push-gated CI live (12+2 suites, red-test proven, merge gate on); fail-closed config validators shipped to gateway+chat and proven; three backfilled incident write-ups (yaml outage, Loomio invite blast, stale-image deploy) + the 69-var portal env manifest

This commit is contained in:
inference-bot committed 2026-11-11 04:13:00 +00:00
1 parent 2c38f4d2c3
commit 206c3d5379
6 files changed
+698 -28

No files matched your search

@@ -0,0 +1,84 @@
# Incident 2026-10-31 — a `customFooter:` key in librechat.yaml kept the chat API from ever starting; the SPA kept serving 200
Backfilled 2026-11-11 (the incident predates ops-docs' incident practice; the
knowledge lived only in the steward skill until the codebase audit flagged the
gap). Written from the skill reference, the git history around the footer work
and the deployed build's own validator. No values, only names.
## What happened
A footer customisation for chat.inference.coop was made by adding a
`customFooter:` top-level key to `/app/data/librechat.yaml` (the persistent
volume) and restarting the app. LibreChat's config loader runs the yaml
through its **strict config schema** (`configSchema.strict()` from
`librechat-data-provider`, in `@librechat/api`'s config load) and exits on an
unrecognized top-level key:
```
logger.error("Exiting due to invalid configuration. Set CONFIG_BYPASS_VALIDATION=true …");
process.exit(1);
```
`customFooter` is not a key of that schema in the deployed build — this build
reads the footer **only** from the `CUSTOM_FOOTER` env var. So the API server
(node `api/server/index.js`) never came up.
## Blast radius
- **Every API route of chat.inference.coop down for members** — login, chat,
/api/config, key checks — from the yaml edit + restart until the key was
removed and the app restarted again.
- The **SPA kept serving HTTP 200**: Cloudron's health check and the homepage
stayed green (the static shell is served regardless of the API process), so
the app looked "up" on every status surface. Any check that scored the app
by a 200 was testing the shell, not the service.
- No data loss (config-only; the yaml was fixed in place).
## Detection gap
Nothing detected it while members hit it. The failure signature —
`/api/config` returning the HTML shell instead of JSON — was only found by a
human-side check, and the recovery was scored by exactly that probe
afterwards. The gap was twofold:
1. No pre-boot validation: the yaml was edited on the volume with nothing
checking it against the schema before the restart.
2. No post-restart behavioural check: a green 200 from a single-page app
proves the vhost, not the app.
## Resolution
- Removed the `customFooter:` key from `/app/data/librechat.yaml`; the footer
was later shipped correctly through `CUSTOM_FOOTER` in `/app/data/env`
(the value channel that actually reaches the node process).
- Restart → `/api/config` returned JSON again → recovery declared on that
evidence, not on the homepage 200.
## The fix that now exists (2026-11-11)
The chat image (overlay `librechat-custom`, tag `20261111-179fd7c`) now
carries a **fail-closed config validator wired at the top of the boot path**:
- `validate_config.py` (canonical copy in `ops-docs/scripts/`, shipped
byte-identical into the image) runs the deployed build's own strict schema —
`configSchema.strict().safeParse()` from the container's
`librechat-data-provider` — against `/app/data/librechat.yaml` **before**
anything starts.
- `patch_start_validator.py` inserts the check into `/app/pkg/start.sh` at
build time (idempotent, non-fatal to apply; fatal at runtime **only** when
the config is actually invalid).
- On an unknown key the boot dies loudly with one line naming the key
(`CONFIG VALIDATION FAILED: customFooter: Unrecognized key(s) …`), instead of
an API server that never starts behind a healthy-looking shell.
Proven before deploy: live yaml passes (7 top-level keys accepted); the
reproduced outage config (live yaml + `customFooter`) fails naming the key,
through both the deployed-schema path and the static fallback; the served
`/api/config` is JSON after the deploy.
## Prevention rules recorded
- Treat any librechat.yaml key as schema-validated: check it against the
deployed build's `configSchema` before writing it to the volume.
- After ANY chat config edit or restart, assert `/api/config` returns JSON —
never score recovery by a 200 from the SPA shell.
@@ -0,0 +1,77 @@
# Incident 2026-11-04 — the Loomio sync rehearsal ran against the live services and invited the whole membership
Backfilled 2026-11-11 (self-reported by the audit's missing-write-ups list).
The operator's brief dates this 2026-11-05; the delegation record that fixed it
(fixed the same evening) dates the blast itself to 2026-11-04 — that verified
date is used here.
## What happened
The portal's Loomio integration keeps the co-op's Loomio group in step with the
membership: it adds members who join, removes members who deactivate, and
notifies by email on invite. A **rehearsal** of the sync/deactivation path was
run to verify proposed behaviour. The harness was not made structurally
incapable of a write: the function's dependencies pointed at the **live portal
database** and the **live Loomio API**, and a rehearsed path calls exactly the
path it was given. The rehearsal re-ran a full membership sync against both,
and Loomio issued a **whole-group invite notification — ~83 in-app recipients
(Loomio notification id 744)** — to essentially the entire membership, plus the
invite emails that path sends.
## Blast radius
- ~83 members received a redundant Loomio invite notification and its email
for a group most of them were already in. No member data was changed
destructively (the sync's add path is additive); the damage was a
membership-wide bogus notification, and trust.
- The portal database was not corrupted; the live Loomio group state ended up
correct (the invited people were mostly already members — which is why the
notifications were noise, not access changes).
## Detection gap
Our own code recorded nothing — a rehearsal leaves no "blast" record in the
portal, and the sync had no per-subject send log. The evidence came from the
**third party's own notification log** (Loomio's notification 744), not from
anything we monitor. A rehearsal that touches live services does not announce
itself; only the receiver's records showed it.
## Resolution (same day, deployed and verified)
The fix job (`deleg_8b616d58`, completed 2026-11-04 ~19:00 UTC) re-enabled the
sync with the guard that was missing and deployed portal image
`20261104-c78acf5` (manifest pinned `d945ba1`):
1. **Idempotent add path** — the sync now checks the destination's actual
state before acting: a member already in the Loomio group is never invited
or emailed again, no matter how many times the sync runs. The normal
schedule keeps admitting genuinely new people.
2. **Removal reconciliation preserved** — the guard must not block removals:
a deactivated member still propagates (removals verified idempotent too),
so the invite guard cannot silently strand lapsed members in the group.
3. **Verified by the operation's own class of effect**: 0 notification
deliveries after the deploy, group total 84 vs 94 portal members (the only
roster email not in the portal is `bot@inference.coop`, the allowlist
account, correctly excluded), 26/26 portal tests passing
(`tests/test_loomio_guard.py` among them).
## Root cause
A rehearsal brief that said "test the sync path" without making production
unreachable. "Use a fixture, never the live row" is not a control: any function
whose dependencies point at live services WILL act on them. The harness must be
*structurally incapable* of a write — stub the network layer, copy the
database and point the code at the copy, and **prove the isolation before the
harness runs** (assert the stub recorded the call instead of the service
receiving it).
## The fix that now exists
- The add-path idempotence and preserved removal reconciliation above (in the
portal image since 2026-11-04; guarded by `tests/test_loomio_guard.py`, which
has run green on every push since 2026-11-11 via Woodpecker).
- The standing rule, recorded in the steward skill: a rehearsal brief must make
production unreachable, and the boundary must be verified before the harness
runs — plus a per-subject send record for any path that notifies, seeded from
live state, so a first enabled run cannot re-blast the population it is
meant to leave alone.
@@ -0,0 +1,89 @@
# Incident 2026-11-09 — a gateway deploy shipped the previous build's image; every surface said it succeeded
Backfilled 2026-11-11 (self-reported by the audit's missing-write-ups list;
facts from the steward skill's deploy reference, verified there on 2026-11-09,
and re-confirmed by a live recurrence on 2026-11-11 — see the end).
## What happened
During the 2026-11-09 gateway upgrade window, the LiteLLM gateway was updated
expecting the new build. Two distinct mechanisms of this platform's update
path combined to ship the WRONG code while everything reported success:
1. **`cloudron update --image <tag>` was a silent no-op for this app.** The
CLI exited 0, printed `App is updated.`, recreated the container, wrote the
tag into the app record — and the running code was unchanged. The builder
pushes images to the registry (`registry.inference.coop/<repo>`), never
into the host's docker, so a bare `local/…` reference cannot be pulled.
`cloudron status --app` also reported the new tag, so **every surface agreed
with the lie**.
2. **`cloudron update` without `--image` reuses the LAST builder build.** The
update does not build on-server; it takes the previous build package. A
deploy performed before (or without) a fresh build ships the PREVIOUS
commit's image under a fresh manifest. That day: new manifest shipped, old
image ran, both looked like success.
## Blast radius
- The gateway ran the **previous commit's code** after a deploy that was
believed to carry the new code — the deploy's intended change (and any
verification done against it) silently proved nothing.
- No data loss, no downtime: the old image was healthy. The damage was
epistemic — a deploy recorded as done that had not happened, which the next
session would have inherited as fact.
## Detection gap
`App is updated.` and a green health check are the platform's success story,
and they are true even for a wrong deploy. Nothing in the flow forced the
question "is the NEW code actually running?" — the check that catches this
(grep the RUNNING container for something only the new code contains) existed
as a rule but was not wired into the deploy itself.
## Resolution and the fix that now exists
The working deploy order, verified 2026-11-09 and again 2026-11-11:
1. **Commit first** — the build context is the git checkout; an uncommitted
overlay edit silently reverts on rebuild.
2. **Build FIRST**, always, via
`~/.hermes/scripts/cloudron_builder_build.sh <repository> <yyyymmdd>-<gitsha>`
from the app's OWN repo dir (the auth triple is not optional).
3. **Then update**: for an app whose repo manifest pins `dockerImage`
(librechat-custom, member-portal), write the built tag into the manifest,
commit, and `cloudron update --app <id> --force` (no `--image` — the pin
wins). For an app with NO pin (litellm's local/… manifest), update from the
app's own repo dir; a bare `--image` with a non-registry path is a no-op.
4. **Verify two facts, never the CLI's output**: the app record's
`manifest.dockerImage` equals the built tag, AND the running container
contains something only the new build produces (`cloudron exec --app <id> --
grep -c <marker> <path>` / an md5 of a changed file / a boot-log line the
new start path prints).
Rollback is the same command with the previous tag — record the running tag
before any deploy.
## Recurrence caught live (2026-11-11) — the trap is broader than "stale"
The 2026-11-11 validator deploys hit the same mechanism from the other side:
a **bare `cloudron update --app <gateway-id> --force`** (no `--image`, run
from a neutral cwd, with no pin in the gateway manifest) deployed **the last
build package globally — which was a different app's build** (the chat
overlay), replacing the gateway's image AND installed manifest. The app
reported healthy the whole time because the wrong image was itself a healthy
web app; the deploy verification battery (manifest tag check) caught it
within minutes and the gateway was redeployed correctly with an explicit
registry-path `--image` from its own repo dir (downtime ≈ 9 minutes,
03:55–04:04 UTC).
Standing rules this recurrence adds:
- A bare `cloudron update` deploys the LAST BUILD PACKAGE — manifest
included — and the "last build" tracking is **global, not per-app**. Never
run it for an app whose own build was not the immediately preceding build.
- An app whose manifest has no `dockerImage` pin must be updated from its own
repo directory; `--image` takes the full registry path
(`registry.inference.coop/<repo>:<tag>`), never a bare `local/…` reference.
- The two-fact verification (manifest tag + in-container marker) is what turns
this trap from an incident into a caught-in-minutes event; do the second
fact every time.