Database errors during restore to new Instance

Hi,

we have a very old gitlab-ce self hosted instance which got updated a lot. I think we started with gitlab version 6, but I am not sure about it.

We currently use version 15.1.3

We recently decided to migrate to a new server and during our migration tests we had an issue with opening old ci jobs. They are in the pipeline list, but when you click at a job it is missing and the ui is empty.

We then relooked at our logs and found these database errors that probably are related to the issue:

------ BEGIN ERRORS -----
ERROR:  invalid byte sequence for encoding "UTF8": 0xf3 0x2d 0x6f 0x70
CONTEXT:  COPY ci_builds, line 2134973
ERROR:  insert or update on table "ci_unit_test_failures" violates foreign key constraint "fk_0f09856e1f"
DETAIL:  Key (build_id)=(4367992) is not present in table "ci_builds".
ERROR:  insert or update on table "ci_sources_pipelines" violates foreign key constraint "fk_be5624bf37"
DETAIL:  Key (source_job_id)=(2905129) is not present in table "ci_builds".
ERROR:  insert or update on table "ci_builds_metadata" violates foreign key constraint "fk_e20479742e"
DETAIL:  Key (build_id)=(431534) is not present in table "ci_builds".
ERROR:  insert or update on table "ci_build_report_results" violates foreign key constraint "fk_rails_16cb1ff064"
DETAIL:  Key (build_id)=(2451191) is not present in table "ci_builds".
ERROR:  insert or update on table "ci_build_needs" violates foreign key constraint "fk_rails_3cf221d4ed"
DETAIL:  Key (build_id)=(2028094) is not present in table "ci_builds".
ERROR:  insert or update on table "ci_builds_runner_session" violates foreign key constraint "fk_rails_70707857d3"
DETAIL:  Key (build_id)=(2899800) is not present in table "ci_builds".
ERROR:  insert or update on table "ci_build_trace_metadata" violates foreign key constraint "fk_rails_aebc78111f"
DETAIL:  Key (build_id)=(3083792) is not present in table "ci_builds".
ERROR:  insert or update on table "ci_job_artifacts" violates foreign key constraint "fk_rails_c5137cb2c1"
DETAIL:  Key (job_id)=(1063911) is not present in table "ci_builds".
ERROR:  insert or update on table "ci_running_builds" violates foreign key constraint "fk_rails_da45cfa165"
DETAIL:  Key (build_id)=(4416524) is not present in table "ci_builds".
ERROR:  insert or update on table "ci_job_variables" violates foreign key constraint "fk_rails_fbf3b34792"
DETAIL:  Key (job_id)=(993214) is not present in table "ci_builds".
------ END ERRORS -------

Can anybody help us with any tips how we can get more information about which items in the database cause the problems or how to overcome the errors in general?

If we would decide to ignore these errors and just live with the situation of missing old job information. Can anybody think of problems that can occur from it in the future?

Thanks for any support in advance.

1 Like