schemas is crash-looping at startup (exit 0 / Completed, no error in logs). Same root cause as dancefinder: pg v1.19.0+ auto-runs an idempotency migration whose partial index uses a non-IMMUTABLE now() predicate, which modern Postgres rejects (functions in index predicate must be marked IMMUTABLE), failing pg.New(). schemas was on the broken pg v1.20.0.
What
1. Dependency bump (fixes the crash)
gitlab.com/unboundsoftware/eventsourced/pg/v2 → v2.0.2 (the fixed, importable release; v2.0.0/v2.0.1 lacked the required /v2 module path)
gitlab.com/unboundsoftware/eventsourced/eventsourced → v1.23.0 (required by pg/v2)
Only the import path changes (.../pg → .../pg/v2); package stays pg, no call sites change.
2. Startup error logging (diagnosability)
main() now also writes startup errors to stderr (survives the deferred OTel SDK shutdown that was swallowing them) and os.Exit(1) so the pod reports failed instead of Completed.
Verification
go build ./..., go vet, full go test ./... all pass. eventsourced v1.23.0's metrics refactor is unused by schemas.
## Why
schemas is crash-looping at startup (exit 0 / `Completed`, no error in logs). Same root cause as dancefinder: pg v1.19.0+ auto-runs an idempotency migration whose partial index uses a non-IMMUTABLE `now()` predicate, which modern Postgres rejects (`functions in index predicate must be marked IMMUTABLE`), failing `pg.New()`. schemas was on the broken pg v1.20.0.
## What
**1. Dependency bump (fixes the crash)**
- `gitlab.com/unboundsoftware/eventsourced/pg/v2` → **v2.0.2** (the fixed, importable release; v2.0.0/v2.0.1 lacked the required `/v2` module path)
- `gitlab.com/unboundsoftware/eventsourced/eventsourced` → **v1.23.0** (required by pg/v2)
- Only the import path changes (`.../pg` → `.../pg/v2`); package stays `pg`, no call sites change.
**2. Startup error logging (diagnosability)**
- `main()` now also writes startup errors to stderr (survives the deferred OTel SDK shutdown that was swallowing them) and `os.Exit(1)` so the pod reports failed instead of `Completed`.
## Verification
`go build ./...`, `go vet`, full `go test ./...` all pass. eventsourced v1.23.0's metrics refactor is unused by schemas.
Mirrors dancefinder PRs #437 (bump) + #436 (logging).
pg v1.19.0+ auto-runs an idempotency migration whose partial index used a
non-IMMUTABLE now() predicate, which Postgres rejects at creation. That
failed pg.New() at startup and crash-looped the service (silently, exit 0).
schemas was on the broken pg v1.20.0.
The fix is in pg's v2 line; v2.0.0/v2.0.1 were unconsumable (go.mod module
path lacked the required /v2 suffix), corrected in v2.0.2. Bump to:
- gitlab.com/unboundsoftware/eventsourced/pg/v2 v2.0.2
- gitlab.com/unboundsoftware/eventsourced/eventsourced v1.23.0 (required by pg/v2)
Only the import path changes (.../pg -> .../pg/v2); package stays `pg`, no
call sites change.
When start() returns an error, main() logged it via the slog logger and
returned normally (exit 0), so a crash-looping pod showed as "Completed"
with no error in the logs: start() defers the OTel SDK shutdown, tearing
down the log exporter before main() logs, so with LOG_FORMAT=otel the
record never reaches Alloy.
Also write the error to stderr (always captured by `kubectl logs`) and
os.Exit(1) so the container is correctly reported as failed.
argoyle
scheduled this pull request to auto merge when all checks succeed 2026-05-25 20:40:33 +00:00
argoyle
merged commit 3f22773f58 into main2026-05-25 20:45:23 +00:00
Blocking a user prevents them from interacting with repositories, such as opening or commenting on pull requests or issues. Learn more about blocking a user.
Why
schemas is crash-looping at startup (exit 0 /
Completed, no error in logs). Same root cause as dancefinder: pg v1.19.0+ auto-runs an idempotency migration whose partial index uses a non-IMMUTABLEnow()predicate, which modern Postgres rejects (functions in index predicate must be marked IMMUTABLE), failingpg.New(). schemas was on the broken pg v1.20.0.What
1. Dependency bump (fixes the crash)
gitlab.com/unboundsoftware/eventsourced/pg/v2→ v2.0.2 (the fixed, importable release; v2.0.0/v2.0.1 lacked the required/v2module path)gitlab.com/unboundsoftware/eventsourced/eventsourced→ v1.23.0 (required by pg/v2).../pg→.../pg/v2); package stayspg, no call sites change.2. Startup error logging (diagnosability)
main()now also writes startup errors to stderr (survives the deferred OTel SDK shutdown that was swallowing them) andos.Exit(1)so the pod reports failed instead ofCompleted.Verification
go build ./...,go vet, fullgo test ./...all pass. eventsourced v1.23.0's metrics refactor is unused by schemas.Mirrors dancefinder PRs #437 (bump) + #436 (logging).