I had 500 error after updating gitlab-ce from 12.3.5 to 12.4.0 and I can't recovery gitlab whole database
Hello everyone,
I ran Gitlab updating 2 days ago by commands sudo apt-get update && apt-get upgrade
as usual.
Gitlab was updated from 12.3.5 to 12.4.0 successfully but something was wrong while database migrate. As a result, I got Gitlab-ce 12.4.0 server that return 500 error all time.
It wasn't problem becouse I have 5 days backup files and 1 last backup that was created by updater and has just database file.
I have removed Gitlab package and installed previous version by
sudo apt-get install gitlab-ce=12.3.5-ce.0
Installation was finished successfully, but backup recovering was finished with some db migration errors:
...
ALTER TABLE
ALTER TABLE
ERROR: insert or update on table "issue_assignees" violates foreign key constraint "fk_b7d881734a"
DETAIL: Key (issue_id)=(17) is not present in table "issues".
ALTER TABLE
ALTER TABLE
...
ALTER TABLE
ERROR: insert or update on table "issue_metrics" violates foreign key constraint "fk_rails_4bb543d85d"
DETAIL: Key (issue_id)=(44) is not present in table "issues".
ALTER TABLE
ALTER TABLE
...
ALTER TABLE
ALTER TABLE
ERROR: insert or update on table "resource_label_events" violates foreign key constraint "fk_rails_5ac1d2fc24"
DETAIL: Key (issue_id)=(113) is not present in table "issues".
ALTER TABLE
ALTER TABLE
...
ALTER TABLE
ALTER TABLE
ERROR: insert or update on table "merge_requests_closing_issues" violates foreign key constraint "fk_rails_f8540692be"
DETAIL: Key (issue_id)=(95) is not present in table "issues".
ALTER TABLE
ALTER TABLE
...
As result, Gitlab-ce starts and works successfully but no one issue is accessible. Issues lists are empty in all projects. What am I doing wrong?