HOTFIX: mig 134 violates paliad_proceeding_code_shape (paliad.de offline, crash-loop) #130

Open
opened 2026-05-26 13:05:32 +00:00 by mAi · 0 comments
Collaborator

Incident

paliad.de is offline. Container compose-transmit-multi-byte-driver-v7jth9-web-1 on mlake is crash-looping every ~65s since 2026-05-26 12:48 UTC, immediately after the Slice B1 deploy (commit 426b90b).

Diagnosis

internal/db/migrations/134_berufung_unification.up.sql line 89 attempts to insert code = 'upc.apl' into paliad.proceeding_types. The table carries this check constraint (pre-existing, unchanged):

CONSTRAINT paliad_proceeding_code_shape CHECK (
  (code ~ '^[a-z]+\.[a-z]+\.[a-z]+$') OR (code ~ '^_archived_')
)

upc.apl has only 2 dot-segments and fails the check. The whole migration TXN rolls back on every retry, so the DB is unchanged from pre-deploy state.

Fix

Rename the unified Berufung code from upc.apl to upc.apl.unified (3 segments, satisfies the constraint, preserves the design intent). The constraint stays as-is — it enforces a useful jurisdiction.category.specific shape across the catalog.

Files to edit

  1. internal/db/migrations/134_berufung_unification.up.sql — replace all 'upc.apl' string literals with 'upc.apl.unified' (lines 89, 123, 191, 224, 243, and any RAISE NOTICE messages that quote the literal — keep prose mentions readable). Check grep -n "'upc\.apl'" 134_berufung_unification.up.sql.
  2. internal/db/migrations/134_berufung_unification.down.sql line 47 — DELETE FROM paliad.proceeding_types WHERE code = 'upc.apl'; → use 'upc.apl.unified'.
  3. frontend/src/verfahrensablauf.tsx line 42 — { code: "upc.apl", ... }"upc.apl.unified".
  4. frontend/src/client/verfahrensablauf.ts lines 67 and 81 — "upc.apl""upc.apl.unified".
  5. frontend/src/i18n-keys.ts line 1520 — "deadlines.upc.apl""deadlines.upc.apl.unified".
  6. frontend/src/client/i18n.ts — find both deadlines.upc.apl keys (DE + EN translation rows added by mig 134's frontend changes) and rename to deadlines.upc.apl.unified.
  7. pkg/litigationplanner/types.go line 185 — prose comment, can stay as upc.apl.unified for accuracy.

Do NOT change prose-only mentions in comments / docstrings that aren't string literals — they're descriptive.

Acceptance

  1. grep -n "'upc\.apl'\|\"upc\.apl\"" internal/ frontend/ pkg/ returns zero hits (only the 3-segment form remains).
  2. go build ./... and cd frontend && bun run build clean.
  3. go test ./... green.
  4. Commit pushed to main → Dokploy auto-deploys → mig 134 applies cleanly → paliad.de responds 200.
  5. Comment on this issue with the commit SHA + verification that the container is no longer restarting (ssh mlake "docker ps --filter name=compose-transmit-multi-byte" shows Up, not Restarting).

Why

The check constraint paliad_proceeding_code_shape is a long-standing invariant. Cronus's Slice B1 design assumed a 2-segment code without grepping the constraint first. The fix preserves both the constraint and the design intent.

Priority: production-down. No design choices to revisit — just rename and ship.

## Incident paliad.de is offline. Container `compose-transmit-multi-byte-driver-v7jth9-web-1` on mlake is crash-looping every ~65s since 2026-05-26 12:48 UTC, immediately after the Slice B1 deploy (commit `426b90b`). ## Diagnosis `internal/db/migrations/134_berufung_unification.up.sql` line 89 attempts to insert `code = 'upc.apl'` into `paliad.proceeding_types`. The table carries this check constraint (pre-existing, unchanged): ```sql CONSTRAINT paliad_proceeding_code_shape CHECK ( (code ~ '^[a-z]+\.[a-z]+\.[a-z]+$') OR (code ~ '^_archived_') ) ``` `upc.apl` has only 2 dot-segments and fails the check. The whole migration TXN rolls back on every retry, so the DB is unchanged from pre-deploy state. ## Fix Rename the unified Berufung code from `upc.apl` to `upc.apl.unified` (3 segments, satisfies the constraint, preserves the design intent). The constraint stays as-is — it enforces a useful jurisdiction.category.specific shape across the catalog. ## Files to edit 1. `internal/db/migrations/134_berufung_unification.up.sql` — replace all `'upc.apl'` string literals with `'upc.apl.unified'` (lines 89, 123, 191, 224, 243, and any RAISE NOTICE messages that quote the literal — keep prose mentions readable). Check `grep -n "'upc\.apl'" 134_berufung_unification.up.sql`. 2. `internal/db/migrations/134_berufung_unification.down.sql` line 47 — `DELETE FROM paliad.proceeding_types WHERE code = 'upc.apl';` → use `'upc.apl.unified'`. 3. `frontend/src/verfahrensablauf.tsx` line 42 — `{ code: "upc.apl", ... }` → `"upc.apl.unified"`. 4. `frontend/src/client/verfahrensablauf.ts` lines 67 and 81 — `"upc.apl"` → `"upc.apl.unified"`. 5. `frontend/src/i18n-keys.ts` line 1520 — `"deadlines.upc.apl"` → `"deadlines.upc.apl.unified"`. 6. `frontend/src/client/i18n.ts` — find both `deadlines.upc.apl` keys (DE + EN translation rows added by mig 134's frontend changes) and rename to `deadlines.upc.apl.unified`. 7. `pkg/litigationplanner/types.go` line 185 — prose comment, can stay as `upc.apl.unified` for accuracy. Do NOT change prose-only mentions in comments / docstrings that aren't string literals — they're descriptive. ## Acceptance 1. `grep -n "'upc\.apl'\|\"upc\.apl\"" internal/ frontend/ pkg/` returns zero hits (only the 3-segment form remains). 2. `go build ./...` and `cd frontend && bun run build` clean. 3. `go test ./...` green. 4. Commit pushed to main → Dokploy auto-deploys → mig 134 applies cleanly → paliad.de responds 200. 5. Comment on this issue with the commit SHA + verification that the container is no longer restarting (`ssh mlake "docker ps --filter name=compose-transmit-multi-byte"` shows Up, not Restarting). ## Why The check constraint `paliad_proceeding_code_shape` is a long-standing invariant. Cronus's Slice B1 design assumed a 2-segment code without grepping the constraint first. The fix preserves both the constraint and the design intent. Priority: production-down. No design choices to revisit — just rename and ship.
mAi self-assigned this 2026-05-26 13:05:32 +00:00
Sign in to join this conversation.
1 Participants
Notifications
Due Date
No due date set.
Dependencies

No dependencies set.

Reference: m/paliad#130
No description provided.