GitLab docker upgrade from 11.11.3-ce.0 to 12.0.X-ce.0 fails

When I try to upgrade, the new docker image fails with:
PG::UndefinedColumn: ERROR: column "cache_invalidation_event_id" referenced in foreign key constraint does not exist

I initially tried to upgrade from 11.11.1-ce.0 to 12.0.1-ce.0. When that failed, I went restored from backup and upgraded 11.11.1-ce.0 -> 11.11.2-ce.0 -> 11.11.3-ce.0 successfully, but encountered the same error when I tried to jump to 12.0.0-ce.0.

Is anyone else having this problem?

Yes it is happening to me too using yum, same error, same version

Hello. Do you found an issue to this problem ?

It appears to be caused by changes made when we tried out Enterprise Edition back on version 7 (or maybe 8?). This post has the right idea for fixing it, but it appears I have quite a few more missing columns than them. As of yet haven’t had the time to track them all down, but I will post again once I have a working command.

Could you find the missing columns and have a working command? We’re having the exact same problem - without having tested EE at all.

I am not sure if this is the same issue, but when upgrading from 11.11.5 to 12.0.0 on Debian 9, the upgrade process fails with the following:

          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;

Any ideas?

It could be. That is one of the errors I have encountered as I have tried to fix mine. Unfortunately, progress has been slow as the upgrade hasn’t been deemed “critical” so I’ve had to poke at it in my off hours.

So, after going through twenty or so fields with no end in sight, I started looking for another way. As I searched, I stumbled across a blog post that recommended going up to 11.11.5-ce.0, then jumping to 11.11.5-ee.0 before going to 12.0.0-ce.0 and onwards.

Using this path, I was able to update to latest.

2 Likes

I wasn’t expecting that this will work, but well, it did.

Thanks for pointing that out!

@jarckn Glad to hear that this worked for you.

For error-free major version upgrades, GitLab recommends upgrading to the latest available minor version (latest 11.11.x) before upgrading major versions (11.x > 12.x).
https://docs.gitlab.com/ee/policy/maintenance.html#upgrade-recommendations

Thanks a lot for your suggestion! I just gave it a go and it actually worked.

Glad you found it useful. Made my head spin for a day :slight_smile: