fix: bump eventsourced/pg to v2.0.2 and harden startup error logging (#851)
schemas / vulnerabilities (push) Successful in 1m43s
schemas / check (push) Successful in 2m25s
schemas / check-release (push) Successful in 2m38s
Release / release (push) Failing after 49s
pre-commit / pre-commit (push) Successful in 6m30s
schemas / build (push) Successful in 5m8s
schemas / deploy-prod (push) Successful in 1m37s
schemas / vulnerabilities (push) Successful in 1m43s
schemas / check (push) Successful in 2m25s
schemas / check-release (push) Successful in 2m38s
Release / release (push) Failing after 49s
pre-commit / pre-commit (push) Successful in 6m30s
schemas / build (push) Successful in 5m8s
schemas / deploy-prod (push) Successful in 1m37s
## 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). Reviewed-on: #851
This commit was merged in pull request #851.
This commit is contained in:
@@ -24,7 +24,7 @@ import (
|
|||||||
"github.com/vektah/gqlparser/v2/ast"
|
"github.com/vektah/gqlparser/v2/ast"
|
||||||
"gitlab.com/unboundsoftware/eventsourced/amqp"
|
"gitlab.com/unboundsoftware/eventsourced/amqp"
|
||||||
"gitlab.com/unboundsoftware/eventsourced/eventsourced"
|
"gitlab.com/unboundsoftware/eventsourced/eventsourced"
|
||||||
"gitlab.com/unboundsoftware/eventsourced/pg"
|
"gitlab.com/unboundsoftware/eventsourced/pg/v2"
|
||||||
|
|
||||||
"gitea.unbound.se/unboundsoftware/schemas/cache"
|
"gitea.unbound.se/unboundsoftware/schemas/cache"
|
||||||
"gitea.unbound.se/unboundsoftware/schemas/domain"
|
"gitea.unbound.se/unboundsoftware/schemas/domain"
|
||||||
@@ -66,6 +66,13 @@ func main() {
|
|||||||
cli,
|
cli,
|
||||||
); err != nil {
|
); err != nil {
|
||||||
logger.With("error", err).Error("process error")
|
logger.With("error", err).Error("process error")
|
||||||
|
// start() defers the OTel SDK shutdown, so by the time we get here the
|
||||||
|
// log exporter may already be torn down and the line above never
|
||||||
|
// reaches Alloy. Write to stderr too so startup failures are always
|
||||||
|
// visible in `kubectl logs`, and exit non-zero so the container is
|
||||||
|
// reported as failed (CrashLoopBackOff) instead of "Completed".
|
||||||
|
fmt.Fprintf(os.Stderr, "fatal: process error: %v\n", err)
|
||||||
|
os.Exit(1)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
@@ -18,8 +18,8 @@ require (
|
|||||||
github.com/vektah/gqlparser/v2 v2.5.33
|
github.com/vektah/gqlparser/v2 v2.5.33
|
||||||
github.com/wundergraph/graphql-go-tools/v2 v2.4.0
|
github.com/wundergraph/graphql-go-tools/v2 v2.4.0
|
||||||
gitlab.com/unboundsoftware/eventsourced/amqp v1.9.1
|
gitlab.com/unboundsoftware/eventsourced/amqp v1.9.1
|
||||||
gitlab.com/unboundsoftware/eventsourced/eventsourced v1.21.0
|
gitlab.com/unboundsoftware/eventsourced/eventsourced v1.23.0
|
||||||
gitlab.com/unboundsoftware/eventsourced/pg v1.20.0
|
gitlab.com/unboundsoftware/eventsourced/pg/v2 v2.0.2
|
||||||
go.opentelemetry.io/contrib/bridges/otelslog v0.18.0
|
go.opentelemetry.io/contrib/bridges/otelslog v0.18.0
|
||||||
go.opentelemetry.io/otel v1.43.0
|
go.opentelemetry.io/otel v1.43.0
|
||||||
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.43.0
|
go.opentelemetry.io/otel/exporters/otlp/otlpmetric/otlpmetrichttp v1.43.0
|
||||||
|
|||||||
@@ -202,10 +202,10 @@ github.com/wundergraph/graphql-go-tools/v2 v2.4.0 h1:Vdv6GmApSE5I0YxDDOOxev26tef
|
|||||||
github.com/wundergraph/graphql-go-tools/v2 v2.4.0/go.mod h1:xH7XBGtKJkNTi6w6TnCDLRa7Jo2gyBBRUipIYwC5vLI=
|
github.com/wundergraph/graphql-go-tools/v2 v2.4.0/go.mod h1:xH7XBGtKJkNTi6w6TnCDLRa7Jo2gyBBRUipIYwC5vLI=
|
||||||
gitlab.com/unboundsoftware/eventsourced/amqp v1.9.1 h1:X6269JoAzHIKCVmtgMHZH3m7xOpACSp37ca3eODe9iU=
|
gitlab.com/unboundsoftware/eventsourced/amqp v1.9.1 h1:X6269JoAzHIKCVmtgMHZH3m7xOpACSp37ca3eODe9iU=
|
||||||
gitlab.com/unboundsoftware/eventsourced/amqp v1.9.1/go.mod h1:EAs0d6Eh0aDiQkUJlSWErHqgHFQdxx0e8I7aG/2FarY=
|
gitlab.com/unboundsoftware/eventsourced/amqp v1.9.1/go.mod h1:EAs0d6Eh0aDiQkUJlSWErHqgHFQdxx0e8I7aG/2FarY=
|
||||||
gitlab.com/unboundsoftware/eventsourced/eventsourced v1.21.0 h1:iJjDO1ivOwLFx4ttcGvTCTBl2Of2lNUFC3ZOxbu46gI=
|
gitlab.com/unboundsoftware/eventsourced/eventsourced v1.23.0 h1:qcteJH9D7kHaOgLQ0fzlW9dv42hSa0Vluqt7p4kooWA=
|
||||||
gitlab.com/unboundsoftware/eventsourced/eventsourced v1.21.0/go.mod h1:LrA7I7etRmhIC1PjO8c26BHm+gWsy2rC3eSMe5+XUWE=
|
gitlab.com/unboundsoftware/eventsourced/eventsourced v1.23.0/go.mod h1:LrA7I7etRmhIC1PjO8c26BHm+gWsy2rC3eSMe5+XUWE=
|
||||||
gitlab.com/unboundsoftware/eventsourced/pg v1.20.0 h1:RckhEDuWeqac7V7sQKQgkB+3G2ap1PGJmfsCKPDuwyU=
|
gitlab.com/unboundsoftware/eventsourced/pg/v2 v2.0.2 h1:6pWgKGnxBq7bVFbeo6wPWBNW5OXU7acgexywC3N9dCM=
|
||||||
gitlab.com/unboundsoftware/eventsourced/pg v1.20.0/go.mod h1:XnRbdiIFxRAA1ZoQypSAViBA9yn4jVLlJDVGRrPpusg=
|
gitlab.com/unboundsoftware/eventsourced/pg/v2 v2.0.2/go.mod h1:S0oBU9kHxuAn5G/3DxvlMbf5BSfPPjhiXuwU+yVrTBg=
|
||||||
go.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64=
|
go.opentelemetry.io/auto/sdk v1.2.1 h1:jXsnJ4Lmnqd11kwkBV2LgLoFMZKizbCi5fNZ/ipaZ64=
|
||||||
go.opentelemetry.io/auto/sdk v1.2.1/go.mod h1:KRTj+aOaElaLi+wW1kO/DZRXwkF4C5xPbEe3ZiIhN7Y=
|
go.opentelemetry.io/auto/sdk v1.2.1/go.mod h1:KRTj+aOaElaLi+wW1kO/DZRXwkF4C5xPbEe3ZiIhN7Y=
|
||||||
go.opentelemetry.io/contrib/bridges/otelslog v0.18.0 h1:hhPGP3zvvy1xWT9RTy970wlniSxFttBIsAK1gvMguJM=
|
go.opentelemetry.io/contrib/bridges/otelslog v0.18.0 h1:hhPGP3zvvy1xWT9RTy970wlniSxFttBIsAK1gvMguJM=
|
||||||
|
|||||||
Reference in New Issue
Block a user