Check-ins are invisible: log every one, persist last refusal per licence (Cairn #437 companion) #40
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
During the cairn-enc 60→50 incident (Cairn #437) the server side could not answer a single question: the
/v1/checkinhandler logs nothing — not successes, not 403s, not reasons — andlastSeenis one overwritten timestamp. A customer's instance self-revoked off a 403 this server almost certainly emitted during the Aug 24–26 redeploy/migration era, and there is no trace.Build:
last_refused_at,last_refused_reason,refusal_counton the licence record (staff console surfacing can follow later).unknownhere self-heals within a day — but this server should strive never to 403unknownfor a licence it merely can't read yet (e.g. mid-migration): consider 503 for storage-unavailable, which the client already treats as connectivity (grace path) rather than revocation.Shipped in PR #41 (merged), deployed to the VPS via
deploy.yml(healthz ok, service active).What landed:
checkin ok(id/org/seats/expires/keyReturned),checkin refused(id/reason/refusals), bad-request warns.lastRefusedAt/lastRefusedReason/refusalCountin the SQLitedataJSON — stamped per 403 for known licences, never cleared by success, survives store reopen (tested).TDD: 503 + logging tests witnessed red on the runner (empty store answered 403; nothing logged); refusal-history fields witnessed compile-red; full suite green.
Live verify: probe check-in against production →
403 {"reason":"unknown"}and the journal now showscheckin refused id=lic-verify-40 reason=unknown refusals=0.Docs: wiki page Check-in Logging and Refusal History (log lines, SQL to read the history, 503 semantics, incident playbook) + entry in the Cairn wiki Home working log.
Together with Cairn #437 (client-side 14-day revoked watch, v0.6.133) the incident class is closed from both ends.