Upgrade from 11.11.4 to 12.0.2 fails on missing parent_id-column
Summary
Upgrade from 11.11.4 to 12.0.2 on CentOS 7 fails with: Your database is missing the 'parent_id' column from the 'epics' table that is present for GitLab EE.
Steps to reproduce
- Upgrading from 11.10.4 to 11.11.4:
Package gitlab-ce.x86_64 0:11.10.4-ce.0.el7 will be updated
Package gitlab-ce.x86_64 0:11.11.4-ce.0.el7 will be an update
- Upgrading postgresql:
gitlab-ctl pg-upgrade
- Upgrading from 11.11.4 to 12.0.2:
Package gitlab-ce.x86_64 0:11.11.4-ce.0.el7 will be updated
Package gitlab-ce.x86_64 0:12.0.2-ce.0.el7 will be an update
What is the current bug behavior?
Post-Scripts fail, see below.
What is the expected correct behavior?
All updates should be applied without failure
Relevant logs
...
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-script20190628-16293-356ppm" ----
STDOUT: rake aborted!
Exception: Your database is missing the 'parent_id' column from the 'epics' table that is present for GitLab EE.
Even though it looks like you're running a CE installation, it appears
you may have installed GitLab EE at some point. To migrate to GitLab 12.0:
1. Install GitLab 11.11.3 EE
2. Install GitLab 12.0.x CE
/opt/gitlab/embedded/service/gitlab-rails/db/migrate/20190402150158_backport_enterprise_schema.rb:916:in `raise_ee_migration_error!'
/opt/gitlab/embedded/service/gitlab-rails/db/migrate/20190402150158_backport_enterprise_schema.rb:896:in `check_ee_columns!'
/opt/gitlab/embedded/service/gitlab-rails/db/migrate/20190402150158_backport_enterprise_schema.rb:888:in `block in check_schema!'
/opt/gitlab/embedded/service/gitlab-rails/db/migrate/20190402150158_backport_enterprise_schema.rb:887:in `each'
/opt/gitlab/embedded/service/gitlab-rails/db/migrate/20190402150158_backport_enterprise_schema.rb:887:in `check_schema!'
/opt/gitlab/embedded/service/gitlab-rails/db/migrate/20190402150158_backport_enterprise_schema.rb:120: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)
== 20190327163904 AddNotificationEmailToNotificationSettings: migrating =======
-- add_column(:notification_settings, :notification_email, :string)
-> 0.0050s
== 20190327163904 AddNotificationEmailToNotificationSettings: migrated (0.0050s)
== 20190402150158 BackportEnterpriseSchema: migrating =========================
-- column_exists?(:epics, :parent_id)
-> 0.0011s
STDERR:
---- End output of "bash" "/tmp/chef-script20190628-16293-356ppm" ----
Ran "bash" "/tmp/chef-script20190628-16293-356ppm" returned 1
Running handlers complete
Chef Client failed. 23 resources updated in 29 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/server.json, has reconfigure 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:64: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.0.2-ce.0.el7.x86_64) scriptlet failed, exit status 1
Non-fatal POSTTRANS scriptlet failure in rpm package gitlab-ce-12.0.2-ce.0.el7.x86_64
Verifying : gitlab-ce-12.0.2-ce.0.el7.x86_64 1/2
Verifying : gitlab-ce-11.11.4-ce.0.el7.x86_64 2/2
Updated:
gitlab-ce.x86_64 0:12.0.2-ce.0.el7
Complete!
Details of package version
gitlab-ce-12.0.2-ce.0.el7.x86_64
Environment details
- Operating System: CentOS 7
- Installation Type:
- Upgrade from version 11.11.4