Error upgrade Omnibus GitLab-ee from 10.2.8

Good afternoon

Currently we have installed GitLab Enterprise Edition 10.2.8-ee 715dcf7 ( we know that it is too old ). Our installation is ‘Omnibus’.

Platform : CentOS Linux release 7.9.2009 (Core)

We are having a lot of problems, errors for the upgrade.

We have followed the recommendations from :

We upgraded from 10.2.8 to 10.4.7.
When we try to update from 10.4.7. to 10.5.1 the following error appears:

Recipe: gitlab::database_migrations

  • bash[migrate gitlab-rails database] action run
    [execute] rake aborted!
    StandardError: An error has occurred, all later migrations canceled:

          Mysql2::Error: Specified key was too long; max key length is 767 bytes: CREATE UNIQUE INDEX `index_lfs_file_locks_on_project_id_and_path`  ON `lfs_file_locks` (`project_id`, `path`) 
          /opt/gitlab/embedded/service/gitlab-rails/config/initializers/connection_fix.rb:20:in `execute'
          /opt/gitlab/embedded/service/gitlab-rails/config/initializers/mysql_ignore_postgresql_options.rb:23:in `add_index'
          /opt/gitlab/embedded/service/gitlab-rails/config/initializers/mysql_set_length_for_binary_indexes.rb:15:in `add_index'
          /opt/gitlab/embedded/service/gitlab-rails/db/migrate/20180116193854_create_lfs_file_locks.rb:16:in `up'
          /opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/db.rake:50: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: Mysql2::Error: Specified key was too long; max key length is 767 bytes: CREATE UNIQUE INDEX `index_lfs_file_locks_on_project_id_and_path`  ON `lfs_file_locks` (`project_id`, `path`) 
          /opt/gitlab/embedded/service/gitlab-rails/config/initializers/connection_fix.rb:20:in `execute'
          /opt/gitlab/embedded/service/gitlab-rails/config/initializers/mysql_ignore_postgresql_options.rb:23:in `add_index'
          /opt/gitlab/embedded/service/gitlab-rails/config/initializers/mysql_set_length_for_binary_indexes.rb:15:in `add_index'
          /opt/gitlab/embedded/service/gitlab-rails/db/migrate/20180116193854_create_lfs_file_locks.rb:16:in `up'
          /opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/db.rake:50:in `block (3 levels) in <top (required)>'
          /opt/gitlab/embedded/bin/bundle:23:in `load'
          /opt/gitlab/embedded/bin/bundle:23:in `<main>'
    

Can anyone help me ?

Thanks in advance

Best regards
JoseC

Hi,

this will be a bigger problem, since MySQL was deprecated and removed from GitLab long time ago. The data needs to be migrated to PostgreSQL.

I’m not sure if the migration in 10.x will work already.

Looking at the MySQL index error, a search unveils this workaround. Would be worth a try, before you migrate your backend to PostgreSQL.

Cheers,
Michael

Thanks Michael, it worked !!

We upgraded from 10.4.7 to 11.0.9, and we continue with the updates.

For migrating from mysql to postgresql, is there a recommended release gitlab-ee for to do it ?

Thanks
Regards JoseC

Hi,

I would say the last version where MySQL was supported. Keep backup snapshots in between to stay safe though, so you can restart the upgrade cycle if 12.0 does not work.

Cheers,
Michael