Cannot upgrade from CE to EE - migrations fails due to already existing column
Summary
I'm migrating an Omnibus CE package to EE on 11.7, and there are migration errors - despite this gitlab-ctl reconfigure says all is OK. but I get 502 HTTP errors when trying to connect.
Re-installing Gitlab CE is OK, so I've got a working server (but not an EE one).
Steps to reproduce
- Update a Gitlab CE 11.7.3 to Gitlab EE 11.7.3
What is the current bug behavior?
Migration errors are reported in the transcript, stopping all later migrations. The configuration still goes through and reports as done. Tons of errors in the logfiles, and impossible to connect to the server.
Previous upgrades from CE release to CE release have executed flawlessly (this has been a Gitlab server for over 3 years, updated monthly).
What is the expected correct behavior?
All migrations run successfully and the server becomes an EE installation.
Relevant logs
gitlab-ctl reconfigure transcript:
Relevant logs
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 "issues_template" of relation "projects" already exists
: ALTER TABLE "projects" ADD "issues_template" text
/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/20150929160851_add_issues_template_to_project.rb:3:in `change'
/opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/db.rake:52: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 "issues_template" of relation "projects" already exists
: ALTER TABLE "projects" ADD "issues_template" text
/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/20150929160851_add_issues_template_to_project.rb:3:in `change'
/opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/db.rake:52: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 "issues_template" of relation "projects" 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/20150929160851_add_issues_template_to_project.rb:3:in `change'
/opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/db.rake:52: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)
== 20150929160851 AddIssuesTemplateToProject: migrating =======================
-- add_column(:projects, :issues_template, :text)
================================================================================
Error executing action `run` on resource 'bash[migrate gitlab-rails database]'
================================================================================
Details of package version
Provide the package version installation details
# dpkg-query -l "gitlab-?e" Desired=Unknown/Install/Remove/Purge/Hold | Status=Not/Inst/Conf-files/Unpacked/halF-conf/Half-inst/trig-aWait/Trig-pend |/ Err?=(none)/Reinst-required (Status,Err: uppercase=bad) ||/ Name Version Architecture Description +++-=========================================================================-=========================================-=========================================-======================================================================================================================================================= ii gitlab-ce 11.7.3-ce.0 amd64 GitLab Community Edition (including NGINX, Postgres, Redis) rc gitlab-ee 11.7.3-ee.0 amd64 GitLab Enterprise Edition (including NGINX, Postgres, Redis)
Environment details
- Operating System:
Ubuntu 14.04.5 LTS - Installation Target, remove incorrect values:
- VM: VMware VSphere
- Installation Type, remove incorrect values:
- Upgrade from version
11.7.3 CE
- Upgrade from version
- Is there any other software running on the machine: no
- Is this a single or multiple node installation? Single
- Resources
- CPU: 2
- Memory total: 4GB
Configuration details
(Irrelevant to this issue.)