Fresh install - reconfiguring Gitlab ee 11.0.3 failed - mySQL error

Hello,

I install GitLab ee 11.0.3 on Red Hat Enterprise Linux Server release 7.2.
This a fresh installation. To reconfigure it and start it, I first edit my gitlab.rb file (see below).

When I run the command line “gitlab-ctl reconfigure”, I got the following error:

.../...
              ActiveRecord::StatementInvalid: Mysql2::Error: Index column size too large. The maximum column size is 767 bytes.: CREATE UNIQUE INDEX `index_lfs_file_locks_on_project_id_and_path` USING btree 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/schema.rb:1476:in `block in <top (required)>'
              /opt/gitlab/embedded/service/gitlab-rails/db/schema.rb:14:in `<top (required)>'
              /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:
              Mysql2::Error: Index column size too large. The maximum column size is 767 bytes.
              /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/schema.rb:1476:in `block in <top (required)>'
              /opt/gitlab/embedded/service/gitlab-rails/db/schema.rb:14:in `<top (required)>'
              /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:schema:load
              (See full trace by running task with --trace)
.../...
    ================================================================================
    Error executing action `run` on resource 'bash[migrate gitlab-rails database]'
    ================================================================================
.../...
    Ran "bash"  "/tmp/chef-script20180716-26746-9u7uwo" returned 1

    Resource Declaration:
    ---------------------
    # In /opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/recipes/database_migrations.rb

     49: bash "migrate gitlab-rails database" do
     50:   code <<-EOH
     51:     set -e
     52:     log_file="#{node['gitlab']['gitlab-rails']['log_directory']}/gitlab-rails-db-migrate-$(date +%Y-%m-%d-%H-%M-%S).log"
     53:     umask 077
     54:     /opt/gitlab/bin/gitlab-rake gitlab:db:configure 2>& 1 | tee ${log_file}
     55:     STATUS=${PIPESTATUS[0]}
     56:     echo $STATUS > #{db_migrate_status_file}
     57:     exit $STATUS
     58:   EOH
     59:   environment env_variables unless env_variables.empty?
     60:   notifies :run, "execute[clear the gitlab-rails cache]", :immediately
     61:   dependent_services.each do |svc|
     62:     notifies :restart, svc, :immediately
     63:   end
     64:   not_if "(test -f #{db_migrate_status_file}) && (cat #{db_migrate_status_file} | grep -Fx 0)"
     65:   only_if { node['gitlab']['gitlab-rails']['auto_migrate'] }
     66: end

    Compiled Resource:
    ------------------
    # Declared in /opt/gitlab/embedded/cookbooks/cache/cookbooks/gitlab/recipes/database_migrations.rb:49:in `from_file'

    bash("migrate gitlab-rails database") do
      action [:run]
      default_guard_interpreter :default
      command nil
      backup 5
      environment {"GITLAB_ROOT_PASSWORD"=>"P@ssword"}
      returns 0
      user nil
      interpreter "bash"
      declared_type :bash
      cookbook_name "gitlab"
      recipe_name "database_migrations"
      code "    set -e\n    log_file=\"/var/log/gitlab/gitlab-rails/gitlab-rails-db-migrate-$(date +%Y-%m-%d-%H-%M-%S).log\"\n    umask 077\n    /opt/gitlab/bin/gitlab-rake gitlab:db:configure 2>& 1 | tee ${log_file}\n    STATUS=${PIPESTATUS[0]}\n    echo $STATUS > /var/opt/gitlab/gitlab-rails/upgrade-status/db-migrate-a6b6d78cff7a321de45b44f2ff7effcb-f25aa33\n    exit $STATUS\n"
      domain nil
      not_if "(test -f /var/opt/gitlab/gitlab-rails/upgrade-status/db-migrate-a6b6d78cff7a321de45b44f2ff7effcb-f25aa33) && (cat /var/opt/gitlab/gitlab-rails/upgrade-status/db-migrate-a6b6d78cff7a321de45b44f2ff7effcb-f25aa33 | grep -Fx 0)"
      only_if { #code block }
    end

    System Info:
    ------------
    chef_version=13.6.4
    platform=redhat
    platform_version=7.2
    ruby=ruby 2.4.4p296 (2018-03-28 revision 63013) [x86_64-linux]
    program_name=/opt/gitlab/embedded/bin/chef-client
    executable=/opt/gitlab/embedded/bin/chef-client

My Gitlab.rb file:

I setup the “external_url” property and ldap things. We use MySQL as a standard in my enterprise (I can’t change for PostgreSQL), so I setup the following properties:

gitlab_rails['db_adapter'] = "mysql2"
gitlab_rails['db_encoding'] = "utf8"
gitlab_rails['db_host'] = "_mySQLHost_"
gitlab_rails['db_port'] = _mySQLPort_
gitlab_rails['db_database'] = "_mySQLdatabase_"
gitlab_rails['db_username'] = "_mySQLusername_"
gitlab_rails['db_password'] = "_mySQLpassword_"

Here are some of my SQL variables getting from mysql order “show variables” :

character_set_client | utf8
character_set_connection | utf8
character_set_database | utf8
character_set_filesystem | binary
character_set_results | utf8
character_set_server | utf8
character_set_system | utf8
character_sets_dir | /usr/share/mysql/charsets/
collation_connection | utf8_general_ci
collation_database | utf8_general_ci
collation_server | utf8_general_ci

default_storage_engine | InnoDB
default_tmp_storage_engine | InnoDB

innodb_file_format | Barracuda
innodb_file_format_check | ON
innodb_file_format_max | Barracuda
innodb_file_per_table | ON

innodb_large_prefix | ON

version | 5.6.27-log
version_comment | MySQL Community Server (GPL)
version_compile_machine | x86_64
version_compile_os | Linux

I must miss something… I don’t understand why the reconfigure gitlab command crashed :frowning:
thank you for your help…

I tested gitlab installation for the versions 10.x.x and I met the same problem: need to encode the MySQL database in “Latin” to be able to install the product (this is a solution to finalize the installation but not a solution to use the product in my opinion).

Only the 9.x.x versions allow to install GitLab configurated with a MySQL database without special encoding…


Edit: I stopped my research on this issue because we have since the opportunity to use PostgrepSQL in my company. I gave up the installation of Gitlab CE in connection with a MySQL server.
As a result, I mark this topic as resolved.