You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Resource cache cleanup errors with Postgresql 18 #9619
I bumped the concourse/unit image to use Postgresql 18. The atc/db unit tests started failing with:
ERROR: update or delete on table "resource_configs" violates RESTRICT setting of foreign key constraint "resource_caches_resource_config_id_fkey" on table "resource_caches" (SQLSTATE 23001)
I happened to see this randomly happen yesterday as well, I think because the latest postgres image on Docker hub started using using v18.
Appears to be an issue with applying the migrations. Feels race-y because it doesn't happen every time. Would only be an issue for someone creating a new Concourse cluster. Weird that it happens to an empty DB though.
changed the title [-]Error applying migrations with Postgresql 18[/-][+]Error applying migrations with Postgresql 18 (new Concourse db only)[/+]on Jun 24, 2026
Not a migration issue! Postgres 18 returns a different error, which is why two of the tests were failing. A third test is failing for a different reason; getting a failure when we shouldn't:
changed the title [-]Error applying migrations with Postgresql 18 (new Concourse db only)[/-][+]Resource cache cleanup errors with Postgresql 18[/+]on Jun 24, 2026
Activity
[-]Error applying migrations with Postgresql 18[/-][+]Error applying migrations with Postgresql 18 (new Concourse db only)[/+]taylorsilva commentedon Jun 24, 2026
Not a migration issue! Postgres 18 returns a different error, which is why two of the tests were failing. A third test is failing for a different reason; getting a failure when we shouldn't:
concourse/atc/db/resource_cache_factory_test.go
Line 241 in 7a77cc0
[-]Error applying migrations with Postgresql 18 (new Concourse db only)[/-][+]Resource cache cleanup errors with Postgresql 18[/+]Kump3r commentedon Jun 26, 2026
Figured it out in PG18, the ForeignKeyViolation race we were handling, actually changed to a new status (23001) which is
RestrictViolation. I can try to prepare a fix to unblock failing CI tests. - https://pkg.go.dev/github.com/jackc/pgerrcode#section-readme #class 23Edit: Fix #9621
taylorsilva commentedon Jun 26, 2026
Thanks Kalin! Was just about to circle back to this and felt so much relief seeing your PR!
Kump3r commentedon Jun 26, 2026
Hey, no problem it was simple enough. Teamwork makes the dream work!