[...]
StandardError: An error has occurred, this and all later migrations canceled:
PG::DependentObjectsStillExist: ERROR: cannot drop desired object(s) because other objects depend on them
DETAIL: default value for column id of table vulnerability_user_mentions depends on sequence vulnerability_user_mentions_id_seq
[...]
[...]
up 20240703104831 post 17.3 AddFkFromPCiBuildTagsToTags
down 20240709014310 post 17.3 CleanupBigintConversionsForPCiBuildsAttempt2
down 20240709060152 post 17.3 FinalizeBackfillFindingInitialPipelineId
down 20240711092719 post 17.3 EnsureUniqueIdForPCiJobAnnotation
I have the same issue with GitLab CE omnibus on Debian, after updating it with aptitude.
PG::DependentObjectsStillExist: ERROR: cannot drop desired object(s) because other objects depend on them
DETAIL: default value for column id of table merge_request_assignees depends on sequence merge_request_assignees_id_seq
HINT: Use DROP ... CASCADE to drop the dependent objects too.
The system is now bricked and I do not know how to roll back, and if it is safe.
Rolling back is in general not a good idea because we need to update every software sooner or later.
How can this problem be solved?
gitlab-rake db:migrate:status: also shows exactly the same
up 20240703104831 post 17.3 AddFkFromPCiBuildTagsToTags
down 20240709014310 post 17.3 CleanupBigintConversionsForPCiBuildsAttempt2
down 20240709060152 post 17.3 FinalizeBackfillFindingInitialPipelineId
down 20240711092719 post 17.3 EnsureUniqueIdForPCiJobAnnotation
Identify the error statement:
gitlab-psql:
SELECT seq_pg_class.relname AS seq_name, dep_pg_class.relname AS table_name, pg_attribute.attname AS col_name FROM pg_class seq_pg_class INNER JOIN pg_depend ON seq_pg_class.oid = pg_depend.objid INNER JOIN pg_class dep_pg_class ON pg_depend.refobjid = dep_pg_class.oid INNER JOIN pg_attribute ON dep_pg_class.oid = pg_attribute.attrelid AND pg_depend.refobjsubid = pg_attribute.attnum WHERE seq_pg_class.relkind = ‘S’ AND (dep_pg_class.relname = ‘ci_builds’ OR dep_pg_class.relname = ‘p_ci_builds’);
It showed me something with:
seq_name | table_name | col_name
------------------±------------±---------
ci_builds_id_seq | p_ci_builds | id
vulnerability_user_mentions.id …