Hi,
I am using 14.1.8 community edition in my ubuntu server, i am trying to upgrade it to latest version, for that i am trying to upgrade to the next version that is 14.2.0, i downloaded the debian package and trying to install, while installing getting the below error…
Running handlers:
There was an error running gitlab-ctl reconfigure:
rails_migration[gitlab-rails] (gitlab::database_migrations line 51) had an error: Mixlib::ShellOut::ShellCommandFailed: bash[migrate gitlab-rails database] (/opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/resources/rails_migration.rb line 16) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received ‘1’
---- Begin output of “bash” “/tmp/chef-script20230327-319268-1dtc3j8” ----
STDOUT: == 20210611082822 AddPagesFileEntriesToPlanLimits: migrating ==================
– add_column(:plan_limits, :pages_file_entries, :integer, {:default=>200000, :null=>false})
→ 0.1351s
== 20210611082822 AddPagesFileEntriesToPlanLimits: migrated (0.1352s) =========
== 20210628154900 CreateDetachedPartitionsTable: migrating ====================
– create_table(:detached_partitions, {})
– quote_column_name(:table_name)
→ 0.0000s
→ 0.2471s
– quote_table_name(“check_aecee24ba3”)
→ 0.0001s
– quote_table_name(:detached_partitions)
→ 0.0000s
– execute(“ALTER TABLE "detached_partitions"\nADD CONSTRAINT "check_aecee24ba3" CHECK (char_length("table_name") <= 63)\n”)
→ 0.0156s
== 20210628154900 CreateDetachedPartitionsTable: migrated (0.2708s) ===========
== 20210629031900 AssociateExistingDastBuildsWithVariables: migrating =========
== 20210629031900 AssociateExistingDastBuildsWithVariables: migrated (0.0165s)
== 20210630222522 AddCustomersDotJwtSigningKeyToApplicationSettings: migrating
– add_column(:application_settings, :encrypted_customers_dot_jwt_signing_key, :binary)
→ 0.0090s
– add_column(:application_settings, :encrypted_customers_dot_jwt_signing_key_iv, :binary)
→ 0.0009s
== 20210630222522 AddCustomersDotJwtSigningKeyToApplicationSettings: migrated (0.0100s)
== 20210630224625 GenerateCustomersDotJwtSigningKey: migrating ================
== 20210630224625 GenerateCustomersDotJwtSigningKey: migrated (0.3740s) =======
== 20210701033622 FinalizeCiBuildsNeedsBigintConversion: migrating ============
– transaction_open?()
→ 0.0000s
– index_exists?(“ci_build_needs”, [:build_id_convert_to_bigint, :name], {:unique=>true, :name=>“index_ci_build_needs_on_build_id_convert_to_bigint_and_name”, :algorithm=>:concurrently})
→ 0.0040s
– execute(“SET statement_timeout TO 0”)
→ 0.0002s
– add_index(“ci_build_needs”, [:build_id_convert_to_bigint, :name], {:unique=>true, :name=>“index_ci_build_needs_on_build_id_convert_to_bigint_and_name”, :algorithm=>:concurrently})
→ 0.0121s
– execute(“RESET statement_timeout”)
→ 0.0003s
– transaction_open?()
→ 0.0000s
– foreign_keys(“ci_build_needs”)
→ 0.0092s
– execute(“LOCK TABLE ci_builds, ci_build_needs IN SHARE ROW EXCLUSIVE MODE”)
→ 0.0003s
– execute(“ALTER TABLE ci_build_needs\nADD CONSTRAINT fk_rails_3cf221d4ed_tmp\nFOREIGN KEY (build_id_convert_to_bigint)\nREFERENCES ci_builds (id)\nON DELETE CASCADE\nNOT VALID;\n”)
→ 0.0353s
– execute(“SET statement_timeout TO 0”)
→ 0.0002s
– execute(“ALTER TABLE ci_build_needs VALIDATE CONSTRAINT fk_rails_3cf221d4ed_tmp;”)
→ 0.0202s
– execute(“RESET statement_timeout”)
→ 0.0003s
– execute(“LOCK TABLE ci_builds, ci_build_needs IN ACCESS EXCLUSIVE MODE”)
→ 0.0002s
– quote_table_name(“ci_build_needs”)
→ 0.0000s
– quote_column_name(:build_id)
→ 0.0000s
– quote_column_name(“build_id_tmp”)
→ 0.0000s
– execute(“ALTER TABLE "ci_build_needs" RENAME COLUMN "build_id" TO "build_id_tmp"”)
→ 0.0010s
– quote_table_name(“ci_build_needs”)
→ 0.0000s
– quote_column_name(:build_id_convert_to_bigint)
→ 0.0000s
– quote_column_name(:build_id)
→ 0.0000s
– execute(“ALTER TABLE "ci_build_needs" RENAME COLUMN "build_id_convert_to_bigint" TO "build_id"”)
→ 0.0009s
– quote_table_name(“ci_build_needs”)
→ 0.0000s
– quote_column_name(“build_id_tmp”)
→ 0.0000s
– quote_column_name(:build_id_convert_to_bigint)
→ 0.0000s
– execute(“ALTER TABLE "ci_build_needs" RENAME COLUMN "build_id_tmp" TO "build_id_convert_to_bigint"”)
→ 0.0002s
– quote_table_name(“trigger_21e7a2602957”)
→ 0.0000s
– execute(“ALTER FUNCTION "trigger_21e7a2602957" RESET ALL”)
→ 0.0004s
– change_column_default(“ci_build_needs”, :build_id, nil)
→ 0.0200s
– change_column_default(“ci_build_needs”, :build_id_convert_to_bigint, 0)
→ 0.0019s
– execute(“DROP INDEX index_ci_build_needs_on_build_id_and_name”)
→ 0.0019s
– rename_index(“ci_build_needs”, “index_ci_build_needs_on_build_id_convert_to_bigint_and_name”, “index_ci_build_needs_on_build_id_and_name”)
→ 0.0003s
– remove_foreign_key(“ci_build_needs”, {:name=>“fk_rails_3cf221d4ed”})
→ 0.0185s
– quote_table_name(“ci_build_needs”)
→ 0.0000s
– quote_column_name(“fk_rails_3cf221d4ed_tmp”)
→ 0.0000s
– quote_column_name(“fk_rails_3cf221d4ed”)
→ 0.0000s
– execute(“ALTER TABLE "ci_build_needs"\nRENAME CONSTRAINT "fk_rails_3cf221d4ed_tmp" TO "fk_rails_3cf221d4ed"\n”)
→ 0.0004s
== 20210701033622 FinalizeCiBuildsNeedsBigintConversion: migrated (0.4932s) ===
== 20210706151154 AddRemainingCiMinutesToCiPendingBuild: migrating ============
– add_column(:ci_pending_builds, :namespace_id, :bigint)
→ 0.0035s
– add_column(:ci_pending_builds, :minutes_exceeded, :boolean, {:null=>false, :default=>false})
→ 0.0020s
== 20210706151154 AddRemainingCiMinutesToCiPendingBuild: migrated (0.0079s) ===
== 20210706151446 AddNamespaceForeignKeyToCiPendingBuild: migrating ===========
– transaction_open?()
→ 0.0000s
– index_exists?(:ci_pending_builds, :namespace_id, {:name=>“index_ci_pending_builds_on_namespace_id”, :algorithm=>:concurrently})
→ 0.0023s
– execute(“SET statement_timeout TO 0”)
→ 0.0001s
– add_index(:ci_pending_builds, :namespace_id, {:name=>“index_ci_pending_builds_on_namespace_id”, :algorithm=>:concurrently})
→ 0.0543s
– execute(“RESET statement_timeout”)
→ 0.0004s
– transaction_open?()
→ 0.0000s
– foreign_keys(:ci_pending_builds)
→ 0.0052s
– execute(“ALTER TABLE ci_pending_builds\nADD CONSTRAINT fk_fdc0137e4a\nFOREIGN KEY (namespace_id)\nREFERENCES namespaces (id)\nON DELETE CASCADE\nNOT VALID;\n”)
→ 0.0056s
– execute(“SET statement_timeout TO 0”)
→ 0.0002s
– execute(“ALTER TABLE ci_pending_builds VALIDATE CONSTRAINT fk_fdc0137e4a;”)
→ 0.0214s
– execute(“RESET statement_timeout”)
→ 0.0004s
== 20210706151446 AddNamespaceForeignKeyToCiPendingBuild: migrated (0.0941s) ==
== 20210706212710 FinalizeCiJobArtifactsBigintConversion: migrating ===========
– transaction_open?()
→ 0.0000s
– index_exists?(“ci_job_artifacts”, :id_convert_to_bigint, {:unique=>true, :name=>“index_ci_job_artifact_on_id_convert_to_bigint”, :algorithm=>:concurrently})
→ 0.0037s
– execute(“SET statement_timeout TO 0”)
→ 0.0001s
– add_index(“ci_job_artifacts”, :id_convert_to_bigint, {:unique=>true, :name=>“index_ci_job_artifact_on_id_convert_to_bigint”, :algorithm=>:concurrently})
→ 0.0039s
– execute(“RESET statement_timeout”)
→ 0.0002s
– transaction_open?()
→ 0.0000s
– index_exists?(“ci_job_artifacts”, [:project_id, :id_convert_to_bigint], {:name=>“index_ci_job_artifacts_for_terraform_reports_bigint”, :where=>“file_type = 18”, :algorithm=>:concurrently})
→ 0.0036s
– execute(“SET statement_timeout TO 0”)
→ 0.0001s
– add_index(“ci_job_artifacts”, [:project_id, :id_convert_to_bigint], {:name=>“index_ci_job_artifacts_for_terraform_reports_bigint”, :where=>“file_type = 18”, :algorithm=>:concurrently})
→ 0.0045s
– execute(“RESET statement_timeout”)
→ 0.0002s
– transaction_open?()
→ 0.0000s
– index_exists?(“ci_job_artifacts”, [:id_convert_to_bigint], {:name=>“index_ci_job_artifacts_id_for_terraform_reports_bigint”, :where=>“file_type = 18”, :algorithm=>:concurrently})
→ 0.0039s
– execute(“SET statement_timeout TO 0”)
→ 0.0001s
– add_index(“ci_job_artifacts”, [:id_convert_to_bigint], {:name=>“index_ci_job_artifacts_id_for_terraform_reports_bigint”, :where=>“file_type = 18”, :algorithm=>:concurrently})
→ 0.0088s
– execute(“RESET statement_timeout”)
→ 0.0002s
– transaction_open?()
→ 0.0000s
– foreign_keys(:project_pages_metadata)
→ 0.0048s
– execute(“LOCK TABLE ci_job_artifacts, project_pages_metadata IN SHARE ROW EXCLUSIVE MODE”)
→ 0.0002s
– execute(“ALTER TABLE project_pages_metadata\nADD CONSTRAINT fk_69366a119e_tmp\nFOREIGN KEY (artifacts_archive_id)\nREFERENCES ci_job_artifacts (id_convert_to_bigint)\nON DELETE SET NULL\nNOT VALID;\n”)
→ 0.0130s
– execute(“SET statement_timeout TO 0”)
→ 0.0001s
– execute(“ALTER TABLE project_pages_metadata VALIDATE CONSTRAINT fk_69366a119e_tmp;”)rake aborted!
StandardError: An error has occurred, all later migrations canceled:
Expected batched background migration for the given configuration to be marked as ‘finished’, but it is ‘active’: {:job_class_name=>“CopyColumnUsingBackgroundMigrationJob”, :table_name=>“ci_stages”, :column_name=>“id”, :job_arguments=>[[“id”], [“id_convert_to_bigint”]]}
Finalize it manualy by running
sudo gitlab-rake gitlab:background_migrations:finalize[CopyColumnUsingBackgroundMigrationJob,ci_stages,id,'[["id"]\, ["id_convert_to_bigint"]]']
For more information, check the documentation
https://docs.gitlab.com/ee/user/admin_area/monitoring/background_migrations.html#database-migrations-failing-because-of-batched-background-migration-not-finished
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/migration_helpers.rb:1129:in ensure_batched_background_migration_is_finished' /opt/gitlab/embedded/service/gitlab-rails/db/post_migrate/20210707210916_finalize_ci_stages_bigint_conversion.rb:13:in
up’
/opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/db.rake:61:in block (3 levels) in <top (required)>' /opt/gitlab/embedded/bin/bundle:23:in
load’
/opt/gitlab/embedded/bin/bundle:23:in `’
Caused by:
Expected batched background migration for the given configuration to be marked as ‘finished’, but it is ‘active’: {:job_class_name=>“CopyColumnUsingBackgroundMigrationJob”, :table_name=>“ci_stages”, :column_name=>“id”, :job_arguments=>[[“id”], [“id_convert_to_bigint”]]}
Finalize it manualy by running
sudo gitlab-rake gitlab:background_migrations:finalize[CopyColumnUsingBackgroundMigrationJob,ci_stages,id,'[["id"]\, ["id_convert_to_bigint"]]']
For more information, check the documentation
https://docs.gitlab.com/ee/user/admin_area/monitoring/background_migrations.html#database-migrations-failing-because-of-batched-background-migration-not-finished
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/migration_helpers.rb:1129:in ensure_batched_background_migration_is_finished' /opt/gitlab/embedded/service/gitlab-rails/db/post_migrate/20210707210916_finalize_ci_stages_bigint_conversion.rb:13:in
up’
/opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/db.rake:61:in block (3 levels) in <top (required)>' /opt/gitlab/embedded/bin/bundle:23:in
load’
/opt/gitlab/embedded/bin/bundle:23:in `’
Tasks: TOP => db:migrate
(See full trace by running task with --trace)
→ 0.0589s
– execute(“RESET statement_timeout”)
→ 0.0004s
– execute(“LOCK TABLE ci_job_artifacts, project_pages_metadata IN ACCESS EXCLUSIVE MODE”)
→ 0.0002s
– quote_table_name(“ci_job_artifacts”)
→ 0.0000s
– quote_column_name(:id)
→ 0.0000s
– quote_column_name(“id_tmp”)
→ 0.0000s
– execute(“ALTER TABLE "ci_job_artifacts" RENAME COLUMN "id" TO "id_tmp"”)
→ 0.0003s
– quote_table_name(“ci_job_artifacts”)
→ 0.0000s
– quote_column_name(:id_convert_to_bigint)
→ 0.0000s
– quote_column_name(:id)
→ 0.0000s
– execute(“ALTER TABLE "ci_job_artifacts" RENAME COLUMN "id_convert_to_bigint" TO "id"”)
→ 0.0002s
– quote_table_name(“ci_job_artifacts”)
→ 0.0000s
– quote_column_name(“id_tmp”)
→ 0.0000s
– quote_column_name(:id_convert_to_bigint)
→ 0.0000s
– execute(“ALTER TABLE "ci_job_artifacts" RENAME COLUMN "id_tmp" TO "id_convert_to_bigint"”)
→ 0.0002s
– quote_table_name(“trigger_be1804f21693”)
→ 0.0000s
– execute(“ALTER FUNCTION "trigger_be1804f21693" RESET ALL”)
→ 0.0002s
– execute(“ALTER SEQUENCE ci_job_artifacts_id_seq OWNED BY ci_job_artifacts.id”)
→ 0.0021s
– change_column_default(“ci_job_artifacts”, :id, #<Proc:0x00007f825a997800 /opt/gitlab/embedded/service/gitlab-rails/db/post_migrate/20210706212710_finalize_ci_job_artifacts_bigint_conversion.rb:66 (lambda)>)
→ 0.0037s
– change_column_default(“ci_job_artifacts”, :id_convert_to_bigint, 0)
→ 0.0040s
– execute(“ALTER TABLE ci_job_artifacts DROP CONSTRAINT ci_job_artifacts_pkey CASCADE”)
→ 0.0040s
– rename_index(“ci_job_artifacts”, “index_ci_job_artifact_on_id_convert_to_bigint”, “ci_job_artifacts_pkey”)
→ 0.0008s
– execute(“ALTER TABLE ci_job_artifacts ADD CONSTRAINT ci_job_artifacts_pkey PRIMARY KEY USING INDEX ci_job_artifacts_pkey”)
→ 0.0088s
– execute(“DROP INDEX index_ci_job_artifacts_for_terraform_reports”)
→ 0.0011s
– rename_index(“ci_job_artifacts”, “index_ci_job_artifacts_for_terraform_reports_bigint”, “index_ci_job_artifacts_for_terraform_reports”)
→ 0.0118s
– execute(“DROP INDEX index_ci_job_artifacts_id_for_terraform_reports”)
→ 0.0005s
– rename_index(“ci_job_artifacts”, “index_ci_job_artifacts_id_for_terraform_reports_bigint”, “index_ci_job_artifacts_id_for_terraform_reports”)
→ 0.0003s
– quote_table_name(:project_pages_metadata)
→ 0.0000s
– quote_column_name(“fk_69366a119e_tmp”)
→ 0.0000s
– quote_column_name(“fk_69366a119e”)
→ 0.0000s
– execute(“ALTER TABLE "project_pages_metadata"\nRENAME CONSTRAINT "fk_69366a119e_tmp" TO "fk_69366a119e"\n”)
→ 0.0003s
== 20210706212710 FinalizeCiJobArtifactsBigintConversion: migrated (0.1661s) ==
== 20210707210916 FinalizeCiStagesBigintConversion: migrating =================
STDERR:
---- End output of “bash” “/tmp/chef-script20230327-319268-1dtc3j8” ----
Ran “bash” “/tmp/chef-script20230327-319268-1dtc3j8” returned 1
Warnings:
The version of the running postgresql service is different than what is installed.
Please restart postgresql to start the new version.
sudo gitlab-ctl restart postgresql
Running handlers complete
Chef Infra Client failed. 16 resources updated in 32 seconds
Warnings:
The version of the running postgresql service is different than what is installed.
Please restart postgresql to start the new version.
sudo gitlab-ctl restart postgresql
===
There was an error running gitlab-ctl reconfigure. Please check the output above for more
details.
dpkg: error processing package gitlab-ce (–install):
installed gitlab-ce package post-installation script subprocess returned error exit status 1
Errors were encountered while processing:
gitlab-ce