[Bug 267716] www/gitlab-ce upgrade to 15.4.4 fails during database migration
- Go to: [ bottom of page ] [ top of archives ] [ this month ]
Date: Fri, 11 Nov 2022 18:22:59 UTC
https://bugs.freebsd.org/bugzilla/show_bug.cgi?id=267716 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=production" WARNING: Nokogiri was built against libxml version 2.10.2, but has dynamically loaded 2.10.3 main: == 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 pg_get_constraintdef(pg_catalog.pg_constraint.oid)\nFROM\n pg_catalog.pg_constraint\nINNER JOIN pg_class ON pg_class.oid = pg_catalog.pg_constr aint.conrelid\nWHERE\n conname = 'check_partition_number' AND\n pg_class.relname = '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_findings_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_findings_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 `block 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 `run' /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_findings_table_to_gitlab_partitions_dynamic_schema.rb:63:in `up' /usr/local/www/gitlab-ce/lib/gitlab/database/migration_helpers/restrict_gitlab_schema.rb:33:in `block in exec_migration' /usr/local/www/gitlab-ce/lib/gitlab/database/query_analyzer.rb:37:in `within' /usr/local/www/gitlab-ce/lib/gitlab/database/migration_helpers/restrict_gitlab_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: sequence must have same owner as table it is linked to /usr/local/www/gitlab-ce/db/post_migrate/20220902204048_move_security_findings_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 `block 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 `run' /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_findings_table_to_gitlab_partitions_dynamic_schema.rb:63:in `up' /usr/local/www/gitlab-ce/lib/gitlab/database/migration_helpers/restrict_gitlab_schema.rb:33:in `block in exec_migration' /usr/local/www/gitlab-ce/lib/gitlab/database/query_analyzer.rb:37:in `within' /usr/local/www/gitlab-ce/lib/gitlab/database/migration_helpers/restrict_gitlab_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_findings_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 `block 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 `run' /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_findings_table_to_gitlab_partitions_dynamic_schema.rb:63:in `up' /usr/local/www/gitlab-ce/lib/gitlab/database/migration_helpers/restrict_gitlab_schema.rb:33:in `block in exec_migration' /usr/local/www/gitlab-ce/lib/gitlab/database/query_analyzer.rb:37:in `within' /usr/local/www/gitlab-ce/lib/gitlab/database/migration_helpers/restrict_gitlab_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 => 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 problem can be worked around. -- You are receiving this mail because: You are the assignee for the bug.