Upgrade on Omnibus on Centos7 from 11.11.x to 12.1.x failed in db migration: column "url" does not exist on "geo_nodes" table

I tried to follow other similar Issues, but nothing changed

Summary

The DB migration failed in the script "20190409224933_add_name_to_geo_nodes.rb", due to a missing column "url":

Caused by: PG::UndefinedColumn: ERROR: column "url" does not exist LINE 1: UPDATE geo_nodes SET name = url;

Steps to reproduce

  1. Reset installation before upgrade: install gitlab-ce-11.11.4 as single RPM and restore DB BACKUP before upgrade
  2. Remove gitlab-ce-11.11.4 and install gitlab-ee-11.11.7 (some errors in the upgrade, but gitlab started anyway, see log)
  3. Remove gitlab-ee-11.11.7 and install last release gitlab-ce-12.1.6 (see log)

What is the current bug behavior?

The "url" does not exist in the table "geo_nodes" In the migration status log there is a script "20190404231137 - Remove alternate url from geo nodes", but this is missing in the "/opt/gitlab/embedded/service/gitlab-rails/db/migrate" directory. In my opinion the url was wrongly dropped before the script "20190409224933_add_name_to_geo_nodes.rb"

Relevant logs and/or screenshots

  • geo_nodes table
gitlabhq_production=# \d+ geo_nodes
                                                            Table "public.geo_nodes"
        Column        |       Type        | Collation | Nullable |                Default                | Storage  | Stats target | Description
----------------------+-------------------+-----------+----------+---------------------------------------+----------+--------------+-------------
 id                   | integer           |           | not null | nextval('geo_nodes_id_seq'::regclass) | plain    |              |
 schema               | character varying |           |          |                                       | extended |              |
 host                 | character varying |           |          |                                       | extended |              |
 port                 | integer           |           |          |                                       | plain    |              |
 relative_url_root    | character varying |           |          |                                       | extended |              |
 primary              | boolean           |           |          |                                       | plain    |              |
 internal_url         | character varying |           |          |                                       | extended |              |
 geo_node_key_id      | integer           |           |          |                                       | plain    |              |
 oauth_application_id | integer           |           |          |                                       | plain    |              |
Indexes:
    "geo_nodes_pkey" PRIMARY KEY, btree (id)
    "index_geo_nodes_on_geo_node_key_id" btree (geo_node_key_id)
    "index_geo_nodes_on_host" btree (host)
    "index_geo_nodes_on_primary" btree ("primary")
Referenced by:
    TABLE "geo_node_statuses" CONSTRAINT "fk_rails_0ecc699c2a" FOREIGN KEY (geo_node_id) REFERENCES geo_nodes(id) ON DELETE CASCADE
    TABLE "geo_node_namespace_links" CONSTRAINT "fk_rails_546bf08d3e" FOREIGN KEY (geo_node_id) REFERENCES geo_nodes(id) ON DELETE CASCADE
    TABLE "geo_repositories_changed_events" CONSTRAINT "fk_rails_75ec0fefcc" FOREIGN KEY (geo_node_id) REFERENCES geo_nodes(id) ON DELETE CASCADE
  • gitlab-rake db:migrate:status
database: gitlabhq_production

 Status   Migration ID    Migration Name
--------------------------------------------------
...
   up     20190402150158  Backport enterprise schema
   up     20190402224749  Schedule merge request assignees migration progress check
   up     20190403161806  Update designs index
   up     20190404143330  Add unique constraint to approvals user id and merge request
   up     20190404231137  Remove alternate url from geo nodes
   up     20190408163745  Prometheus knative05 fix
  down    20190409224933  Add name to geo nodes
  down    20190410173409  Add name index to geo nodes
  down    20190412155659  Add merge request blocks
  down    20190412183653  Remove url index from geo nodes
...
  • Log for gitlab-ee-11.11.7 upgrade
...
Recipe: gitlab::database_migrations
  * bash[migrate gitlab-rails database] action run
    [execute] rake aborted!
              StandardError: An error has occurred, this and all later migrations canceled:

              PG::DuplicateColumn: ERROR:  column "secondary_extern_uid" of relation "identities" already exists
              : ALTER TABLE "identities" ADD "secondary_extern_uid" character varying
              /opt/gitlab/embedded/service/gitlab-rails/config/initializers/postgresql_limit_fix.rb:6:in `add_column'
              /opt/gitlab/embedded/service/gitlab-rails/ee/db/migrate/20160303210802_add_secondary_extern_uid_to_identities.rb:3:in `change'
              /opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/db.rake:56:in `block (3 levels) in <top (required)>'
              /opt/gitlab/embedded/bin/bundle:23:in `load'
              /opt/gitlab/embedded/bin/bundle:23:in `<main>'

              Caused by:
              ActiveRecord::StatementInvalid: PG::DuplicateColumn: ERROR:  column "secondary_extern_uid" of relation "identities" already exists
              : ALTER TABLE "identities" ADD "secondary_extern_uid" character varying
              /opt/gitlab/embedded/service/gitlab-rails/config/initializers/postgresql_limit_fix.rb:6:in `add_column'
              /opt/gitlab/embedded/service/gitlab-rails/ee/db/migrate/20160303210802_add_secondary_extern_uid_to_identities.rb:3:in `change'
              /opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/db.rake:56:in `block (3 levels) in <top (required)>'
              /opt/gitlab/embedded/bin/bundle:23:in `load'
              /opt/gitlab/embedded/bin/bundle:23:in `<main>'

              Caused by:
              PG::DuplicateColumn: ERROR:  column "secondary_extern_uid" of relation "identities" already exists
              /opt/gitlab/embedded/service/gitlab-rails/config/initializers/postgresql_limit_fix.rb:6:in `add_column'
              /opt/gitlab/embedded/service/gitlab-rails/ee/db/migrate/20160303210802_add_secondary_extern_uid_to_identities.rb:3:in `change'
              /opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/db.rake:56:in `block (3 levels) in <top (required)>'
              /opt/gitlab/embedded/bin/bundle:23:in `load'
              /opt/gitlab/embedded/bin/bundle:23:in `<main>'
              Tasks: TOP => db:migrate
              (See full trace by running task with --trace)
              == 20160303210802 AddSecondaryExternUidToIdentities: migrating ================
              -- add_column(:identities, :secondary_extern_uid, :string)

    ================================================================================
    Error executing action `run` on resource 'bash[migrate gitlab-rails database]'
    ================================================================================

    Mixlib::ShellOut::ShellCommandFailed
    ------------------------------------
    Expected process to exit with [0], but received '1'
    ---- Begin output of "bash"  "/tmp/chef-script20190819-1190-1qf91ne" ----
    STDOUT: rake aborted!
    StandardError: An error has occurred, this and all later migrations canceled:

    PG::DuplicateColumn: ERROR:  column "secondary_extern_uid" of relation "identities" already exists
    : ALTER TABLE "identities" ADD "secondary_extern_uid" character varying
    /opt/gitlab/embedded/service/gitlab-rails/config/initializers/postgresql_limit_fix.rb:6:in `add_column'
    /opt/gitlab/embedded/service/gitlab-rails/ee/db/migrate/20160303210802_add_secondary_extern_uid_to_identities.rb:3:in `change'
    /opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/db.rake:56:in `block (3 levels) in <top (required)>'
    /opt/gitlab/embedded/bin/bundle:23:in `load'
    /opt/gitlab/embedded/bin/bundle:23:in `<main>'

    Caused by:
    ActiveRecord::StatementInvalid: PG::DuplicateColumn: ERROR:  column "secondary_extern_uid" of relation "identities" already exists
    : ALTER TABLE "identities" ADD "secondary_extern_uid" character varying
    /opt/gitlab/embedded/service/gitlab-rails/config/initializers/postgresql_limit_fix.rb:6:in `add_column'
    /opt/gitlab/embedded/service/gitlab-rails/ee/db/migrate/20160303210802_add_secondary_extern_uid_to_identities.rb:3:in `change'
    /opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/db.rake:56:in `block (3 levels) in <top (required)>'
    /opt/gitlab/embedded/bin/bundle:23:in `load'
    /opt/gitlab/embedded/bin/bundle:23:in `<main>'

    Caused by:
    PG::DuplicateColumn: ERROR:  column "secondary_extern_uid" of relation "identities" already exists
    /opt/gitlab/embedded/service/gitlab-rails/config/initializers/postgresql_limit_fix.rb:6:in `add_column'
    /opt/gitlab/embedded/service/gitlab-rails/ee/db/migrate/20160303210802_add_secondary_extern_uid_to_identities.rb:3:in `change'
    /opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/db.rake:56:in `block (3 levels) in <top (required)>'
    /opt/gitlab/embedded/bin/bundle:23:in `load'
    /opt/gitlab/embedded/bin/bundle:23:in `<main>'
    Tasks: TOP => db:migrate
    (See full trace by running task with --trace)
    == 20160303210802 AddSecondaryExternUidToIdentities: migrating ================
    -- add_column(:identities, :secondary_extern_uid, :string)
    STDERR:
    ---- End output of "bash"  "/tmp/chef-script20190819-1190-1qf91ne" ----
    Ran "bash"  "/tmp/chef-script20190819-1190-1qf91ne" returned 1

    Resource Declaration:
    ---------------------
    # In /opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/recipes/database_migrations.rb

     53: bash "migrate gitlab-rails database" do
     54:   code <<-EOH
     55:     set -e
     56:     log_file="#{node['gitlab']['gitlab-rails']['log_directory']}/gitlab-rails-db-migrate-$(date +%Y-%m-%d-%H-%M-%S).log"
     57:     umask 077
     58:     /opt/gitlab/bin/gitlab-rake gitlab:db:configure 2>& 1 | tee ${log_file}
     59:     STATUS=${PIPESTATUS[0]}
     60:     echo $STATUS > #{db_migrate_status_file}
     61:     exit $STATUS
     62:   EOH
     63:   environment env_variables unless env_variables.empty?
     64:   notifies :run, "execute[clear the gitlab-rails cache]", :immediately
     65:   dependent_services.each do |svc|
     66:     notifies :restart, svc, :immediately
     67:   end
     68:   not_if "(test -f #{db_migrate_status_file}) && (cat #{db_migrate_status_file} | grep -Fx 0)"
     69:   only_if { node['gitlab']['gitlab-rails']['auto_migrate'] }
     70: end

    Compiled Resource:
    ------------------
    # Declared in /opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/recipes/database_migrations.rb:53:in `from_file'

    bash("migrate gitlab-rails database") do
      action [:run]
      default_guard_interpreter :default
      command nil
      backup 5
      returns 0
      user nil
      interpreter "bash"
      declared_type :bash
      cookbook_name "gitlab"
      recipe_name "database_migrations"
      code "    set -e\n    log_file=\"/var/log/gitlab/gitlab-rails/gitlab-rails-db-migrate-$(date +%Y-%m-%d-%H-%M-%S).log\"\n    umask 077\n    /opt/gitlab/bin/gitlab-rake gitlab:tee ${log_file}\n    STATUS=${PIPESTATUS[0]}\n    echo $STATUS > /var/opt/gitlab/gitlab-rails/upgrade-status/db-migrate-873248b1f0d3a7a5535771a3a1635803-c7143c6ecb8\n    exit $STAT
      domain nil
      not_if "(test -f /var/opt/gitlab/gitlab-rails/upgrade-status/db-migrate-873248b1f0d3a7a5535771a3a1635803-c7143c6ecb8) && (cat /var/opt/gitlab/gitlab-rails/upgrade-status/db-ma5535771a3a1635803-c7143c6ecb8 | grep -Fx 0)"
      only_if { #code block }
    end

    System Info:
    ------------
    chef_version=13.6.4
    platform=centos
    platform_version=7.6.1810
    ruby=ruby 2.5.3p105 (2018-10-18 revision 65156) [x86_64-linux]
    program_name=/opt/gitlab/embedded/bin/chef-client
    executable=/opt/gitlab/embedded/bin/chef-client


Running handlers:
There was an error running gitlab-ctl reconfigure:

bash[migrate gitlab-rails database] (gitlab::database_migrations line 53) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1'
---- Begin output of "bash"  "/tmp/chef-script20190819-1190-1qf91ne" ----
STDOUT: rake aborted!
StandardError: An error has occurred, this and all later migrations canceled:

PG::DuplicateColumn: ERROR:  column "secondary_extern_uid" of relation "identities" already exists
: ALTER TABLE "identities" ADD "secondary_extern_uid" character varying
/opt/gitlab/embedded/service/gitlab-rails/config/initializers/postgresql_limit_fix.rb:6:in `add_column'
/opt/gitlab/embedded/service/gitlab-rails/ee/db/migrate/20160303210802_add_secondary_extern_uid_to_identities.rb:3:in `change'
/opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/db.rake:56:in `block (3 levels) in <top (required)>'
/opt/gitlab/embedded/bin/bundle:23:in `load'
/opt/gitlab/embedded/bin/bundle:23:in `<main>'

Caused by:
ActiveRecord::StatementInvalid: PG::DuplicateColumn: ERROR:  column "secondary_extern_uid" of relation "identities" already exists
: ALTER TABLE "identities" ADD "secondary_extern_uid" character varying
/opt/gitlab/embedded/service/gitlab-rails/config/initializers/postgresql_limit_fix.rb:6:in `add_column'
/opt/gitlab/embedded/service/gitlab-rails/ee/db/migrate/20160303210802_add_secondary_extern_uid_to_identities.rb:3:in `change'
/opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/db.rake:56:in `block (3 levels) in <top (required)>'
/opt/gitlab/embedded/bin/bundle:23:in `load'
/opt/gitlab/embedded/bin/bundle:23:in `<main>'

Caused by:
PG::DuplicateColumn: ERROR:  column "secondary_extern_uid" of relation "identities" already exists
/opt/gitlab/embedded/service/gitlab-rails/config/initializers/postgresql_limit_fix.rb:6:in `add_column'
/opt/gitlab/embedded/service/gitlab-rails/ee/db/migrate/20160303210802_add_secondary_extern_uid_to_identities.rb:3:in `change'
/opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/db.rake:56:in `block (3 levels) in <top (required)>'
/opt/gitlab/embedded/bin/bundle:23:in `load'
/opt/gitlab/embedded/bin/bundle:23:in `<main>'
Tasks: TOP => db:migrate
(See full trace by running task with --trace)
== 20160303210802 AddSecondaryExternUidToIdentities: migrating ================
-- add_column(:identities, :secondary_extern_uid, :string)
STDERR:
---- End output of "bash"  "/tmp/chef-script20190819-1190-1qf91ne" ----
Ran "bash"  "/tmp/chef-script20190819-1190-1qf91ne" returned 1

Running handlers complete
Chef Client failed. 10 resources updated in 01 minutes 07 seconds
Restarting previously running GitLab services
ok: run: alertmanager: (pid 2065) 1s
ok: run: gitaly: (pid 31892) 416s
ok: run: gitlab-monitor: (pid 2076) 0s
ok: run: gitlab-workhorse: (pid 2083) 1s
ok: run: logrotate: (pid 2090) 0s
ok: run: nginx: (pid 2096) 0s
ok: run: node-exporter: (pid 2102) 1s
ok: run: postgres-exporter: (pid 2108) 0s
ok: run: postgresql: (pid 32040) 415s
ok: run: prometheus: (pid 2117) 1s
ok: run: redis: (pid 32060) 416s
ok: run: redis-exporter: (pid 2128) 0s
ok: run: sidekiq: (pid 2134) 1s
ok: run: unicorn: (pid 2141) 0s

     _______ __  __          __
    / ____(_) /_/ /   ____ _/ /_
   / / __/ / __/ /   / __ `/ __ \
  / /_/ / / /_/ /___/ /_/ / /_/ /
  \____/_/\__/_____/\__,_/_.___/


Upgrade complete! If your GitLab server is misbehaving try running
  sudo gitlab-ctl restart
before anything else.
If you need to roll back to the previous version you can use the database
backup made during the upgrade (scroll up for the filename).
  • Log for gitlab-ce-12.1.6 upgrade
...
Recipe: gitlab::database_migrations
  * bash[migrate gitlab-rails database] action run
    [execute] rake aborted!
              StandardError: An error has occurred, this and all later migrations canceled:

              PG::UndefinedColumn: ERROR:  column "url" does not exist
              LINE 1: UPDATE geo_nodes SET name = url;
                                                  ^
              : UPDATE geo_nodes SET name = url;
              /opt/gitlab/embedded/service/gitlab-rails/db/migrate/20190409224933_add_name_to_geo_nodes.rb:17:in `up'
              /opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/db.rake:56:in `block (3 levels) in <top (required)>'
              /opt/gitlab/embedded/bin/bundle:23:in `load'
              /opt/gitlab/embedded/bin/bundle:23:in `<main>'

              Caused by:
              ActiveRecord::StatementInvalid: PG::UndefinedColumn: ERROR:  column "url" does not exist
              LINE 1: UPDATE geo_nodes SET name = url;
                                                  ^
              : UPDATE geo_nodes SET name = url;
              /opt/gitlab/embedded/service/gitlab-rails/db/migrate/20190409224933_add_name_to_geo_nodes.rb:17:in `up'
              /opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/db.rake:56:in `block (3 levels) in <top (required)>'
              /opt/gitlab/embedded/bin/bundle:23:in `load'
              /opt/gitlab/embedded/bin/bundle:23:in `<main>'

              Caused by:
              PG::UndefinedColumn: ERROR:  column "url" does not exist
              LINE 1: UPDATE geo_nodes SET name = url;
                                                  ^
              /opt/gitlab/embedded/service/gitlab-rails/db/migrate/20190409224933_add_name_to_geo_nodes.rb:17:in `up'
              /opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/db.rake:56:in `block (3 levels) in <top (required)>'
              /opt/gitlab/embedded/bin/bundle:23:in `load'
              /opt/gitlab/embedded/bin/bundle:23:in `<main>'
              Tasks: TOP => db:migrate
              (See full trace by running task with --trace)
              == 20190409224933 AddNameToGeoNodes: migrating ================================
              -- add_column(:geo_nodes, :name, :string, {})
                 -> 0.0014s
              -- execute("UPDATE geo_nodes SET name = url;")

    ================================================================================
    Error executing action `run` on resource 'bash[migrate gitlab-rails database]'
    ================================================================================

    Mixlib::ShellOut::ShellCommandFailed
    ------------------------------------
    Expected process to exit with [0], but received '1'
    ---- Begin output of "bash"  "/tmp/chef-script20190819-6426-1ofncji" ----
    STDOUT: rake aborted!
    StandardError: An error has occurred, this and all later migrations canceled:

    PG::UndefinedColumn: ERROR:  column "url" does not exist
    LINE 1: UPDATE geo_nodes SET name = url;
                                        ^
    : UPDATE geo_nodes SET name = url;
    /opt/gitlab/embedded/service/gitlab-rails/db/migrate/20190409224933_add_name_to_geo_nodes.rb:17:in `up'
    /opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/db.rake:56:in `block (3 levels) in <top (required)>'
    /opt/gitlab/embedded/bin/bundle:23:in `load'
    /opt/gitlab/embedded/bin/bundle:23:in `<main>'

    Caused by:
    ActiveRecord::StatementInvalid: PG::UndefinedColumn: ERROR:  column "url" does not exist
    LINE 1: UPDATE geo_nodes SET name = url;
                                        ^
    : UPDATE geo_nodes SET name = url;
    /opt/gitlab/embedded/service/gitlab-rails/db/migrate/20190409224933_add_name_to_geo_nodes.rb:17:in `up'
    /opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/db.rake:56:in `block (3 levels) in <top (required)>'
    /opt/gitlab/embedded/bin/bundle:23:in `load'
    /opt/gitlab/embedded/bin/bundle:23:in `<main>'

    Caused by:
    PG::UndefinedColumn: ERROR:  column "url" does not exist
    LINE 1: UPDATE geo_nodes SET name = url;
                                        ^
    /opt/gitlab/embedded/service/gitlab-rails/db/migrate/20190409224933_add_name_to_geo_nodes.rb:17:in `up'
    /opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/db.rake:56:in `block (3 levels) in <top (required)>'
    /opt/gitlab/embedded/bin/bundle:23:in `load'
    /opt/gitlab/embedded/bin/bundle:23:in `<main>'
    Tasks: TOP => db:migrate
    (See full trace by running task with --trace)
    == 20190409224933 AddNameToGeoNodes: migrating ================================
    -- add_column(:geo_nodes, :name, :string, {})
       -> 0.0014s
    -- execute("UPDATE geo_nodes SET name = url;")
    STDERR:
    ---- End output of "bash"  "/tmp/chef-script20190819-6426-1ofncji" ----
    Ran "bash"  "/tmp/chef-script20190819-6426-1ofncji" returned 1

    Resource Declaration:
    ---------------------
    # In /opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/recipes/database_migrations.rb

     53: bash "migrate gitlab-rails database" do
     54:   code <<-EOH
     55:     set -e
     56:     log_file="#{node['gitlab']['gitlab-rails']['log_directory']}/gitlab-rails-db-migrate-$(date +%Y-%m-%d-%H-%M-%S).log"
     57:     umask 077
     58:     /opt/gitlab/bin/gitlab-rake gitlab:db:configure 2>& 1 | tee ${log_file}
     59:     STATUS=${PIPESTATUS[0]}
     60:     echo $STATUS > #{db_migrate_status_file}
     61:     exit $STATUS
     62:   EOH
     63:   environment env_variables unless env_variables.empty?
     64:   notifies :run, "execute[clear the gitlab-rails cache]", :immediately
     65:   dependent_services.each do |svc|
     66:     notifies :restart, svc, :immediately
     67:   end
     68:   not_if "(test -f #{db_migrate_status_file}) && (cat #{db_migrate_status_file} | grep -Fx 0)"
     69:   only_if { node['gitlab']['gitlab-rails']['auto_migrate'] }
     70: end

    Compiled Resource:
    ------------------
    # Declared in /opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/recipes/database_migrations.rb:53:in `from_file'

    bash("migrate gitlab-rails database") do
      action [:run]
      default_guard_interpreter :default
      command nil
      backup 5
      interpreter "bash"
      declared_type :bash
      cookbook_name "gitlab"
      recipe_name "database_migrations"
      code "    set -e\n    log_file=\"/var/log/gitlab/gitlab-rails/gitlab-rails-db-migrate-$(date +%Y-%m-%d-%H-%M-%S).log\"\n    umask 077\n    /opt/gitlab/bin/gitlab-rake gitlab:tee ${log_file}\n    STATUS=${PIPESTATUS[0]}\n    echo $STATUS > /var/opt/gitlab/gitlab-rails/upgrade-status/db-migrate-873248b1f0d3a7a5535771a3a1635803-4016bcac51d\n    exit $STAT
      domain nil
      user nil
      not_if "(test -f /var/opt/gitlab/gitlab-rails/upgrade-status/db-migrate-873248b1f0d3a7a5535771a3a1635803-4016bcac51d) && (cat /var/opt/gitlab/gitlab-rails/upgrade-status/db-ma5535771a3a1635803-4016bcac51d | grep -Fx 0)"
      only_if { #code block }
    end

    System Info:
    ------------
    chef_version=14.13.11
    platform=centos
    platform_version=7.6.1810
    ruby=ruby 2.6.3p62 (2019-04-16 revision 67580) [x86_64-linux]
    program_name=/opt/gitlab/embedded/bin/chef-client
    executable=/opt/gitlab/embedded/bin/chef-client

Recipe: gitlab::gitlab-rails
  * execute[clear the gitlab-rails cache] action run
    - execute /opt/gitlab/bin/gitlab-rake cache:clear
Recipe: <Dynamically Defined Resource>
  * service[gitaly] action restart
    - restart service service[gitaly]
Recipe: gitaly::enable
  * runit_service[gitaly] action hup
    - send hup to runit_service[gitaly]

Running handlers:
There was an error running gitlab-ctl reconfigure:

bash[migrate gitlab-rails database] (gitlab::database_migrations line 53) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1'
---- Begin output of "bash"  "/tmp/chef-script20190819-6426-1ofncji" ----
STDOUT: rake aborted!
StandardError: An error has occurred, this and all later migrations canceled:

PG::UndefinedColumn: ERROR:  column "url" does not exist
LINE 1: UPDATE geo_nodes SET name = url;
                                    ^
: UPDATE geo_nodes SET name = url;
/opt/gitlab/embedded/service/gitlab-rails/db/migrate/20190409224933_add_name_to_geo_nodes.rb:17:in `up'
/opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/db.rake:56:in `block (3 levels) in <top (required)>'
/opt/gitlab/embedded/bin/bundle:23:in `load'
/opt/gitlab/embedded/bin/bundle:23:in `<main>'

Caused by:
ActiveRecord::StatementInvalid: PG::UndefinedColumn: ERROR:  column "url" does not exist
LINE 1: UPDATE geo_nodes SET name = url;
                                    ^
: UPDATE geo_nodes SET name = url;
/opt/gitlab/embedded/service/gitlab-rails/db/migrate/20190409224933_add_name_to_geo_nodes.rb:17:in `up'
/opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/db.rake:56:in `block (3 levels) in <top (required)>'
/opt/gitlab/embedded/bin/bundle:23:in `load'
/opt/gitlab/embedded/bin/bundle:23:in `<main>'

Caused by:
PG::UndefinedColumn: ERROR:  column "url" does not exist
LINE 1: UPDATE geo_nodes SET name = url;
                                    ^
/opt/gitlab/embedded/service/gitlab-rails/db/migrate/20190409224933_add_name_to_geo_nodes.rb:17:in `up'
/opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/db.rake:56:in `block (3 levels) in <top (required)>'
/opt/gitlab/embedded/bin/bundle:23:in `load'
/opt/gitlab/embedded/bin/bundle:23:in `<main>'
Tasks: TOP => db:migrate
(See full trace by running task with --trace)
== 20190409224933 AddNameToGeoNodes: migrating ================================
-- add_column(:geo_nodes, :name, :string, {})
   -> 0.0014s
-- execute("UPDATE geo_nodes SET name = url;")
STDERR:
---- End output of "bash"  "/tmp/chef-script20190819-6426-1ofncji" ----
Ran "bash"  "/tmp/chef-script20190819-6426-1ofncji" returned 1

Running handlers complete
Chef Client failed. 26 resources updated in 01 minutes 23 seconds
Ensuring PostgreSQL is updated:/opt/gitlab/embedded/service/omnibus-ctl/lib/gitlab_ctl/util.rb:52:in `parse_json_file': Attributes not found in /opt/gitlab/embedded/nodes/gitlab-svure been run yet? (GitlabCtl::Errors::NodeError)
        from /opt/gitlab/embedded/service/omnibus-ctl/lib/gitlab_ctl/util.rb:64:in `get_node_attributes'
        from /opt/gitlab/embedded/service/omnibus-ctl/lib/gitlab_ctl/util.rb:105:in `roles'
        from /opt/gitlab/embedded/service/omnibus-ctl/pg-upgrade.rb:79:in `block in load_file'
        from /opt/gitlab/embedded/lib/ruby/gems/2.6.0/gems/omnibus-ctl-0.6.0/lib/omnibus-ctl.rb:204:in `block in add_command_under_category'
        from /opt/gitlab/embedded/lib/ruby/gems/2.6.0/gems/omnibus-ctl-0.6.0/lib/omnibus-ctl.rb:746:in `run'
        from /opt/gitlab/embedded/lib/ruby/gems/2.6.0/gems/omnibus-ctl-0.6.0/bin/omnibus-ctl:31:in `<top (required)>'
        from /opt/gitlab/embedded/bin/omnibus-ctl:23:in `load'
        from /opt/gitlab/embedded/bin/omnibus-ctl:23:in `<main>'
Ensuring PostgreSQL is updated: NOT OK
Error ensuring PostgreSQL is updated. Please check the logs
warning: %posttrans(gitlab-ce-12.1.6-ce.0.el7.x86_64) scriptlet failed, exit status 1
Non-fatal POSTTRANS scriptlet failure in rpm package gitlab-ce-12.1.6-ce.0.el7.x86_64
  Verifying  : gitlab-ce-12.1.6-ce.0.el7.x86_64

Installed:
  gitlab-ce.x86_64 0:12.1.6-ce.0.el7

Complete!

Results of GitLab environment info

Expand for output related to GitLab environment info

System information System: Current User: git Using RVM: no Ruby Version: 2.6.3p62 Gem Version: 2.7.9 Bundler Version:1.17.3 Rake Version: 12.3.2 Redis Version: 3.2.12 Git Version: 2.21.0 Sidekiq Version:5.2.7 Go Version: unknown

GitLab information Version: 12.1.6 Revision: 4016bcac51d Directory: /opt/gitlab/embedded/service/gitlab-rails DB Adapter: PostgreSQL DB Version: 10.7 URL: http://gitlab-svil.int.master.lan HTTP Clone URL: http://gitlab-svil.int.master.lan/some-group/some-project.git SSH Clone URL: git@gitlab-svil.int.master.lan:some-group/some-project.git Using LDAP: yes Using Omniauth: yes Omniauth Providers:

GitLab Shell Version: 9.3.0 Repository storage paths:

  • default: /var/opt/gitlab/git-data/repositories GitLab Shell path: /opt/gitlab/embedded/service/gitlab-shell Git: /opt/gitlab/embedded/bin/git

Results of GitLab application Check

Expand for output related to the GitLab application check

Checking GitLab subtasks ...

Checking GitLab Shell ...

GitLab Shell: ... GitLab Shell version >= 9.3.0 ? ... OK (9.3.0) Running /opt/gitlab/embedded/service/gitlab-shell/bin/check Check GitLab API access: FAILED: Failed to connect to internal API gitlab-shell self-check failed Try fixing it: Make sure GitLab is running; Check the gitlab-shell configuration file: sudo -u git -H editor /opt/gitlab/embedded/service/gitlab-shell/config.yml Please fix the error above and rerun the checks.

Checking GitLab Shell ... Finished

Checking Gitaly ...

Gitaly: ... default ... OK

Checking Gitaly ... Finished

Checking Sidekiq ...

Sidekiq: ... Running? ... no Try fixing it: sudo -u git -H RAILS_ENV=production bin/background_jobs start For more information see: doc/install/installation.md in section "Install Init Script" see log/sidekiq.log for possible errors Please fix the error above and rerun the checks.

Checking Sidekiq ... Finished

Checking Incoming Email ...

Incoming Email: ... Reply by email is disabled in config/gitlab.yml

Checking Incoming Email ... Finished

Checking LDAP ...

LDAP: ... Server: ldapmain LDAP authentication... Success LDAP users with access to your GitLab server (only showing the first 100 results) User output sanitized. Found 100 users of 100 limit.

Checking LDAP ... Finished

Checking GitLab App ...

Git configured correctly? ... yes Database config exists? ... yes All migrations up? ... yes Database contains orphaned GroupMembers? ... no GitLab config exists? ... yes GitLab config up to date? ... yes Log directory writable? ... yes Tmp directory writable? ... yes Uploads directory exists? ... yes Uploads directory has correct permissions? ... yes Uploads directory tmp has correct permissions? ... no Try fixing it: sudo chown -R git /var/opt/gitlab/gitlab-rails/uploads sudo find /var/opt/gitlab/gitlab-rails/uploads -type f -exec chmod 0644 {} ; sudo find /var/opt/gitlab/gitlab-rails/uploads -type d -not -path /var/opt/gitlab/gitlab-rails/uploads -exec chmod 0700 {} ; For more information see: doc/install/installation.md in section "GitLab" Please fix the error above and rerun the checks. Init script exists? ... skipped (omnibus-gitlab has no init script) Init script up-to-date? ... skipped (omnibus-gitlab has no init script) Projects have namespace: ... 50/1 ... yes 2/5 ... yes 19/6 ... yes 15/7 ... yes 16/8 ... yes 17/10 ... yes 12/12 ... yes 18/13 ... yes 20/16 ... yes 20/17 ... yes 20/18 ... yes 22/19 ... yes 28/20 ... yes 2/21 ... yes 22/22 ... yes 31/24 ... yes 22/25 ... yes 36/26 ... yes 36/27 ... yes 20/28 ... yes 37/29 ... yes 42/34 ... yes 43/36 ... yes 42/42 ... yes 50/44 ... yes 43/45 ... yes 52/46 ... yes 18/47 ... yes 18/49 ... yes 2/50 ... yes 42/51 ... yes 42/52 ... yes 42/53 ... yes 42/54 ... yes 52/55 ... yes 42/56 ... yes 18/59 ... yes 18/60 ... yes 52/61 ... yes 21/63 ... yes 52/64 ... yes 52/65 ... yes 20/69 ... yes 4/71 ... yes 66/73 ... yes 50/74 ... yes 42/75 ... yes 42/76 ... yes 25/78 ... yes 43/80 ... yes 43/82 ... yes 18/84 ... yes 18/85 ... yes 18/86 ... yes 4/87 ... yes 27/88 ... yes 77/89 ... yes 17/90 ... yes 4/91 ... yes 71/92 ... yes 76/93 ... yes 78/94 ... yes 52/95 ... yes 79/96 ... yes 81/99 ... yes 81/100 ... yes 81/101 ... yes 82/102 ... yes 83/103 ... yes 52/104 ... yes 18/105 ... yes 52/106 ... yes 18/107 ... yes 4/108 ... yes 86/109 ... yes 8/110 ... yes 87/111 ... yes 64/112 ... yes 23/113 ... yes 88/114 ... yes 68/115 ... yes 4/116 ... yes 61/117 ... yes 83/118 ... yes 56/119 ... yes 89/120 ... yes 4/122 ... yes 93/123 ... yes 4/124 ... yes 4/125 ... yes 30/126 ... yes 41/127 ... yes 103/128 ... yes 104/129 ... yes 25/130 ... yes 50/131 ... yes 106/132 ... yes 105/133 ... yes 108/134 ... yes 107/135 ... yes 23/136 ... yes 4/137 ... yes Redis version >= 2.8.0? ... yes Ruby version >= 2.5.3 ? ... yes (2.6.3) Git version >= 2.21.0 ? ... yes (2.21.0) Git user has default SSH configuration? ... yes Active users: ... 90

Checking GitLab App ... Finished

Checking GitLab subtasks ... Finished

Assignee Loading
Time tracking Loading