fix: bump eventsourced/pg to v2.0.2 and harden startup error logging #851

Merged
argoyle merged 2 commits from fix/pg-v2-startup-logging into main 2026-05-25 20:45:23 +00:00

2 Commits

Author SHA1 Message Date
argoyle 381816a66e fix: log startup errors to stderr and exit non-zero
schemas / vulnerabilities (pull_request) Successful in 1m49s
schemas / check (pull_request) Successful in 3m5s
schemas / check-release (pull_request) Successful in 3m45s
pre-commit / pre-commit (pull_request) Successful in 6m15s
schemas / build (pull_request) Successful in 5m51s
schemas / deploy-prod (pull_request) Has been skipped
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.
2026-05-25 22:34:57 +02:00
argoyle 5c77e0a455 fix(deps): bump eventsourced/pg to v2.0.2, eventsourced to v1.23.0
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.
2026-05-25 22:34:20 +02:00