Error upgrade Omnibus GitLab-ee from 11.2.8 to 11.3.0

Hi,

Platform : CentOS Linux release 7.9.2009 (Core)

When we try to update Gitlab-ee rom 11.2.8 to 11.3.0 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: Index column size too large. The maximum column size is 767 bytes.: CREATE  INDEX `index_packages_maven_metadata_on_package_id_and_path`  ON `packages_maven_metadata` (`package_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:19:in `add_index'
          /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/migration_helpers.rb:69:in `block in add_concurrent_index'
          /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/migration_helpers.rb:244:in `disable_statement_timeout'
          /opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/database/migration_helpers.rb:68:in `add_concurrent_index'
          /opt/gitlab/embedded/service/gitlab-rails/ee/db/migrate/20180720121404_create_packages_maven_metadata.rb:21:in `up'
          /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: Mysql2::Error: Index column size too large. The maximum column size is 767 bytes.: CREATE  INDEX `index_packages_maven_metadata_on_package_id_and_path`  ON `packages_maven_metadata` (`package_id`, `path`) 
    

Can anyone help me ?

Thanks in advance

Best regards
JoseC

Hi @JoseC
This is MySQL issue and since MySQL is not supported for years the docs are archived, but you could search for the old MySQL docs. What I found for similar issues was

my.cnf had innodb_file_format=Barracuda and innodb_large_prefix=1 (see MySQL manual and changing row format).

Hi Balonic

We know that mysql is not supported after 12.0 gitlab. Our gitlab-ee version is old, we know, and what we are trying is update it.

These lines are included in my.cnf file;

Upgrade gitlab

innodb_file_per_table = 1
innodb_file_format=Barracuda
innodb_large_prefix=1

Error message:
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: Index column size too large. The maximum column size is 767 bytes.: CREATE  INDEX `index_packages_maven_metadata_on_package_id_and_path`  ON `packages_maven_metadata` (`package_id`, `path`) 
    

any procedure to solve the error ?
Can anyone help me ?

Thanks in advance

For context, that’s a follow-up question from Error upgrade Omnibus GitLab-ee from 10.2.8 where we identified MySQL as the backend, and thought about a path forward to the last MySQL supported version, then going the PostgreSQL data migration route.

Mysql2::Error: Specified key was too long; max key length is 767 bytes (#35223) · Issues · GitLab.org / GitLab FOSS · GitLab - I 've researched a bit to find the old documentation for MySQL upgrades in doc/install/database_mysql.md · 9199887cce5d99798e7f23b9a0ac64704b61e930 · GitLab.org / GitLab FOSS · GitLab

Next to the config settings for the large prefix, the database tables need to be migrated as well. Maybe this was a step you skipped before with the DB migrations.

Which MySQL version are you running? Installation broken with mysql < 5.7.7 (#26268) · Issues · GitLab.org / GitLab FOSS · GitLab mentions < 5.7.9 and docs instructions at Gitlab from sources : proper utf8mb4 support for MySQL 5.5 to 5.7 (!8508) · Merge requests · GitLab.org / GitLab FOSS · GitLab

Not sure if that is helpful though, the MySQL database backend seems to be out-of-sync what the package upgrade expects. Maybe an alternative approach can be exporting all groups and projects, and import them into a fresh instance setup of 11.3.x with PostgreSQL as the backend.

Question is, how big is the current setup and what effort is required to “start over” from users, git repos, permissions, config, CI/CD, etc.

Cheers,
Michael

Hi Michael

It didn’t work. We also had to recover 10.8.7 release, because
project’s files were lost on the upgrade from 10.8.7 to 11.0.0,
Error message: " 500 Whoops, something went wrong on our end."

Gitlab is quite important for our daily work. Currently we have 300 Projects, 50 users and 50 groups.

Considering that our gitlab-ee release (10.x) is too old, if we install latest gitlab-ee release on a new server, Is there any procedure to migrate from gitlab-ee (10.X) release to a latest gitlab-ee release ? ( I read it is not possible )
Considerations:

  • projects
  • users / groups
  • CI/CD
  • Merge/request
    …etc

Thank you very much

Cheers
JoseC

Hi,

that migration question goes beyond my knowledge unfortunately. It might be better to directly consult the experts in support or professional services for an analysis and getting the migration done: Migration Services | GitLab

Exporting the projects/groups/etc. can be done, though I am not sure about the later import. That’s something engineers and support can tackle and answer.

Cheers,
Michael