"ci_build_tags_100" violates foreign key constraint [...] not present in table "p_ci_builds"

Hello,

while importing a gitlab-backup to a newer Machine (Ubuntu 20.04 -> Ubuntu 24.04), I experience the following error:

2025-09-05 10:53:38 UTC -- ERROR: insert or update on table "ci_build_tags_100" violates foreign key constraint "fk_rails_d7bd025909" DETAIL: Key (partition_id, build_id)=(100, 51256) is not present in table "p_ci_builds".

I tried to mitigate by following the procedure outlined in:

https://support.gitlab.com/hc/en-us/articles/19024767103772-Migration-failure-insert-or-update-on-table-ci-build-tags-100-violates-foreign-key-constraint-fk-rails-8284d35c66

yet, this procedure targets not the table "p_ci_builds" and instead applies to "tags" and "p_ci_build_tags" .

Is there already a way to fix this error in table "p_ci_builds"?

Edited by 🤖 GitLab Bot 🤖