PG relation errors after upgrade to 17.4.1

Hello,

this morning I saw that there are errors in the background jobs in the dead tab

ActiveRecord::StatementInvalid: PG::CheckViolation: ERROR: new row for relation "ci_deleted_objects" violates check constraint "check_98f90d6c53" DETAIL: Failing row contains (280402, 1, 2024-10-04 0

I also found a similar error in the logs

"error_message":"PG::CheckViolation: ERROR:  new row for relation \"ci_deleted_objects\" violates check constraint \"check_98f90d6c53\"\nDETAIL:  Failing row contains (280402, 1, 2024-10-04 07:10:02.665836+00, c5/e0/c5e0562a087a92f624baa0dc01f1dbc0bf906bc9e1355cb9adbe8cb5fa..., artifacts.zip, null)

How can I fix this? Gitlab Omnibus v17.4.1 on bundled Psql 14.11

Hey @ug-kbedkows,
this issue has been reported to GitLab here: Ci::DeleteObjectsWorker fails with PG::CheckViolation: ERROR: new row for relation "ci_deleted_objects" violates check constraint "check_98f90d6c53" (#495123) · Issues · GitLab.org / GitLab · GitLab

A fix will be available in v17.5 - and has also been backported to v17.4.2: CHANGELOG.md · master · GitLab.org / GitLab FOSS · GitLab

So updating your instance from v17.4.1 to v17.4.2 should fix the issue.

Kind regards,
Malte

1 Like

Thank you. I noticed that after updating to 17.4.2 the problem is fixed and no longer occurs.

I have upgraded to 17.4.3 and the error occurs again.

image

We are facing this exact issue on our self-hosted 17.5.1-ee.