Date: Fri, 11 Nov 2022 18:22:59 +0000 From: bugzilla-noreply@freebsd.org To: ports-bugs@FreeBSD.org Subject: [Bug 267716] www/gitlab-ce upgrade to 15.4.4 fails during database migration Message-ID: <bug-267716-7788@https.bugs.freebsd.org/bugzilla/>
next in thread | raw e-mail | index | archive | help
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=3D267716 Bug ID: 267716 Summary: www/gitlab-ce upgrade to 15.4.4 fails during database migration Product: Ports & Packages Version: Latest Hardware: Any OS: Any Status: New Severity: Affects Only Me Priority: --- Component: Individual Port(s) Assignee: mfechner@FreeBSD.org Reporter: gwright@antiope.com Assignee: mfechner@FreeBSD.org Flags: maintainer-feedback?(mfechner@FreeBSD.org) I upgraded from www/gitlab-ce 15.3.4 to 15.4.4. The upgrade failed in the database migration phase: root@gitlab:/usr/local/www/gitlab-ce # su -l git -c "cd /usr/local/www/gitlab-ce && rake db:migrate RAILS_ENV=3Dproduction" WARNING: Nokogiri was built against libxml version 2.10.2, but has dynamica= lly loaded 2.10.3 main: =3D=3D 20220902204048 MoveSecurityFindingsTableToGitlabPartitionsDynamicSchema: migrating main: -- transaction_open?() main: -> 0.0000s main: -- execute("LOCK TABLE vulnerability_scanners, security_scans, security_findings IN ACCESS EXCLUSIVE MODE\n") main: -> 0.0006s main: -- execute("SELECT\n=20 pg_get_constraintdef(pg_catalog.pg_constraint.oid)\nFROM\n=20 pg_catalog.pg_constraint\nINNER JOIN pg_class ON pg_class.oid =3D pg_catalog.pg_constr aint.conrelid\nWHERE\n conname =3D 'check_partition_number' AND\n=20 pg_class.relname =3D 'security_findings'\n") main: -> 0.0100s main: -- execute("ALTER TABLE security_findings RENAME TO security_findings_1;\n") main: -> 0.0006s main: -- execute("ALTER INDEX security_findings_pkey RENAME TO security_findings_1_pkey;\n") main: -> 0.0005s main: -- execute("CREATE TABLE security_findings (\n LIKE security_finding= s_1 INCLUDING ALL\n) PARTITION BY LIST (partition_number);\n") main: -> 0.0121s main: -- execute("ALTER SEQUENCE security_findings_id_seq OWNED BY public.security_findings.id;\n") rake aborted! StandardError: An error has occurred, all later migrations canceled: PG::ObjectNotInPrerequisiteState: ERROR: sequence must have same owner as table it is linked to /usr/local/www/gitlab-ce/db/post_migrate/20220902204048_move_security_findi= ngs_table_to_gitlab_partitions_dynamic_schema.rb:80:in `block in up' /usr/local/www/gitlab-ce/lib/gitlab/database/with_lock_retries.rb:123:in `run_block' /usr/local/www/gitlab-ce/lib/gitlab/database/with_lock_retries.rb:134:in `b= lock in run_block_with_lock_timeout' /usr/local/www/gitlab-ce/lib/gitlab/database/with_lock_retries.rb:129:in `run_block_with_lock_timeout' /usr/local/www/gitlab-ce/lib/gitlab/database/with_lock_retries.rb:97:in `ru= n' /usr/local/www/gitlab-ce/lib/gitlab/database/migration_helpers.rb:452:in `with_lock_retries' /usr/local/www/gitlab-ce/lib/gitlab/database/migration_helpers/v2.rb:117:in `with_lock_retries' /usr/local/www/gitlab-ce/db/post_migrate/20220902204048_move_security_findi= ngs_table_to_gitlab_partitions_dynamic_schema.rb:63:in `up' /usr/local/www/gitlab-ce/lib/gitlab/database/migration_helpers/restrict_git= lab_schema.rb:33:in `block in exec_migration' /usr/local/www/gitlab-ce/lib/gitlab/database/query_analyzer.rb:37:in `withi= n' /usr/local/www/gitlab-ce/lib/gitlab/database/migration_helpers/restrict_git= lab_schema.rb:30:in `exec_migration' /usr/local/www/gitlab-ce/lib/gitlab/database/migrations/lock_retry_mixin.rb= :36:in `ddl_transaction' Caused by: ActiveRecord::StatementInvalid: PG::ObjectNotInPrerequisiteState: ERROR:=20 sequence must have same owner as table it is linked to /usr/local/www/gitlab-ce/db/post_migrate/20220902204048_move_security_findi= ngs_table_to_gitlab_partitions_dynamic_schema.rb:80:in `block in up' /usr/local/www/gitlab-ce/lib/gitlab/database/with_lock_retries.rb:123:in `run_block' /usr/local/www/gitlab-ce/lib/gitlab/database/with_lock_retries.rb:134:in `b= lock in run_block_with_lock_timeout' /usr/local/www/gitlab-ce/lib/gitlab/database/with_lock_retries.rb:129:in `run_block_with_lock_timeout' /usr/local/www/gitlab-ce/lib/gitlab/database/with_lock_retries.rb:97:in `ru= n' /usr/local/www/gitlab-ce/lib/gitlab/database/migration_helpers.rb:452:in `with_lock_retries' /usr/local/www/gitlab-ce/lib/gitlab/database/migration_helpers/v2.rb:117:in `with_lock_retries' /usr/local/www/gitlab-ce/db/post_migrate/20220902204048_move_security_findi= ngs_table_to_gitlab_partitions_dynamic_schema.rb:63:in `up' /usr/local/www/gitlab-ce/lib/gitlab/database/migration_helpers/restrict_git= lab_schema.rb:33:in `block in exec_migration' /usr/local/www/gitlab-ce/lib/gitlab/database/query_analyzer.rb:37:in `withi= n' /usr/local/www/gitlab-ce/lib/gitlab/database/migration_helpers/restrict_git= lab_schema.rb:30:in `exec_migration' /usr/local/www/gitlab-ce/lib/gitlab/database/migrations/lock_retry_mixin.rb= :36:in `ddl_transaction' Caused by: PG::ObjectNotInPrerequisiteState: ERROR: sequence must have same owner as table it is linked to /usr/local/www/gitlab-ce/db/post_migrate/20220902204048_move_security_findi= ngs_table_to_gitlab_partitions_dynamic_schema.rb:80:in `block in up' /usr/local/www/gitlab-ce/lib/gitlab/database/with_lock_retries.rb:123:in `run_block' /usr/local/www/gitlab-ce/lib/gitlab/database/with_lock_retries.rb:134:in `b= lock in run_block_with_lock_timeout' /usr/local/www/gitlab-ce/lib/gitlab/database/with_lock_retries.rb:129:in `run_block_with_lock_timeout' /usr/local/www/gitlab-ce/lib/gitlab/database/with_lock_retries.rb:97:in `ru= n' /usr/local/www/gitlab-ce/lib/gitlab/database/migration_helpers.rb:452:in `with_lock_retries' /usr/local/www/gitlab-ce/lib/gitlab/database/migration_helpers/v2.rb:117:in `with_lock_retries' /usr/local/www/gitlab-ce/db/post_migrate/20220902204048_move_security_findi= ngs_table_to_gitlab_partitions_dynamic_schema.rb:63:in `up' /usr/local/www/gitlab-ce/lib/gitlab/database/migration_helpers/restrict_git= lab_schema.rb:33:in `block in exec_migration' /usr/local/www/gitlab-ce/lib/gitlab/database/query_analyzer.rb:37:in `withi= n' /usr/local/www/gitlab-ce/lib/gitlab/database/migration_helpers/restrict_git= lab_schema.rb:30:in `exec_migration' /usr/local/www/gitlab-ce/lib/gitlab/database/migrations/lock_retry_mixin.rb= :36:in `ddl_transaction' Tasks: TOP =3D> db:migrate (See full trace by running task with --trace) root@gitlab:/usr/local/www/gitlab-ce # This seems to have something to do with this recent bug report: https://forum.gitlab.com/t/error-sequence-must-have-same-owner-as-table-it-= is-linked-to/77279 A similar report from last month: https://forum.gitlab.com/t/db-migration-error-when-upgrading-to-gitlab-v15-= 4/75828 This report give more hints on what to do: https://forum.gitlab.com/t/db-migration-fails-on-latest-update/47988/4 I will try to follow the procedure described in the last to see if the prob= lem can be worked around. --=20 You are receiving this mail because: You are the assignee for the bug.=
Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?bug-267716-7788>