Database Migration for upgrade from 14.2.2 to 14.3.0 fails with TypeError: wrong argument type Hash (expected String)

Summary

I currently prepare new gitlab-ce packages for FreeBSD.

While currently testing the new version, I cannot run the database migration. I get the following error message:

root@gitlab:/usr/local/www/gitlab-ce # su -l git -c "cd /usr/local/www/gitlab-ce && rake db:migrate RAILS_ENV=production"
rake aborted!
TypeError: wrong argument type Hash (expected String)
/usr/local/www/gitlab-ce/config/application.rb:15:in `<top (required)>'
/usr/local/www/gitlab-ce/Rakefile:9:in `<top (required)>'
(See full trace by running task with --trace)

Steps to reproduce

Having a version 14.2.2 running, upgrade it to 14.3.0 and run the database migration: su -l git -c "cd /usr/local/www/gitlab-ce && rake db:migrate RAILS_ENV=production"

What is the current bug behavior?

I get the following error message:

root@gitlab:/usr/local/www/gitlab-ce # su -l git -c "cd /usr/local/www/gitlab-ce && rake db:migrate RAILS_ENV=production"
rake aborted!
TypeError: wrong argument type Hash (expected String)
/usr/local/www/gitlab-ce/config/application.rb:15:in `<top (required)>'
/usr/local/www/gitlab-ce/Rakefile:9:in `<top (required)>'
(See full trace by running task with --trace)

What is the expected correct behavior?

It should run the database migration without errors.

Results of GitLab environment info

Expand for output related to GitLab environment info
 su -l git -c "cd /usr/local/www/gitlab-ce && bundle exec rake gitlab:env:info RAILS_ENV=production"
rake aborted!
TypeError: wrong argument type Hash (expected String)
/usr/local/www/gitlab-ce/config/application.rb:15:in `'
/usr/local/www/gitlab-ce/Rakefile:9:in `require'
/usr/local/www/gitlab-ce/Rakefile:9:in `'
/usr/local/bin/bundle:23:in `load'
/usr/local/bin/bundle:23:in `'
(See full trace by running task with --trace)

Results of GitLab application Check

Expand for output related to the GitLab application check

(For installations with omnibus-gitlab package run and paste the output of: sudo gitlab-rake gitlab:check SANITIZE=true)

(For installations from source run and paste the output of: sudo -u git -H bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true) su -l git -c "cd /usr/local/www/gitlab-ce && bundle exec rake gitlab:check RAILS_ENV=production SANITIZE=true" rake aborted! TypeError: wrong argument type Hash (expected String) /usr/local/www/gitlab-ce/config/application.rb:15:in <top (required)>' /usr/local/www/gitlab-ce/Rakefile:9:in require' /usr/local/www/gitlab-ce/Rakefile:9:in <top (required)>' /usr/local/bin/bundle:23:in load' /usr/local/bin/bundle:23:in `' (See full trace by running task with --trace)

Diff of Gemfile.lock to version 14.3.0, with minimal differences (all dev and test dependecies are removed)
 PLATFORMS
-  ruby
+  amd64-freebsd-13

 DEPENDENCIES
   RedCloth (~> 4.3.2)
@@ -1393,7 +1065,6 @@
   atlassian-jwt (~> 0.2.0)
   attr_encrypted (~> 3.1.0)
   autoprefixer-rails (= 10.2.5.1)
-  awesome_print
   aws-sdk-cloudformation (~> 1)
   aws-sdk-core (~> 3)
   aws-sdk-s3 (~> 1)
@@ -1402,30 +1073,19 @@
   batch-loader (~> 2.0.1)
   bcrypt (~> 3.1, >= 3.1.14)
   bcrypt_pbkdf (~> 1.0)
-  benchmark-ips (~> 2.3.0)
   benchmark-memory (~> 0.1)
-  better_errors (~> 2.9.0)
   bootsnap (~> 1.4.6)
   bootstrap_form (~> 4.2.0)
   browser (~> 4.2)
-  bullet (~> 6.1.3)
-  bundler-audit (~> 0.7.0.1)
-  capybara (~> 3.35.3)
-  capybara-screenshot (~> 1.0.22)
   carrierwave (~> 1.3)
   charlock_holmes (~> 0.7.7)
   commonmarker (~> 0.21)
-  concurrent-ruby (~> 1.1)
   connection_pool (~> 2.0)
   countries (~> 3.0)
   creole (~> 0.5.0)
-  crystalball (~> 0.7.0)
-  database_cleaner (~> 1.7.0)
   deckar01-task_list (= 2.3.1)
   declarative_policy (~> 1.0.0)
   default_value_for (~> 3.4.0)
-  deprecation_toolkit (~> 1.5.1)
-  derailed_benchmarks
   device_detector
   devise (~> 4.7.2)
   devise-two-factor (~> 4.0.0)
@@ -1439,14 +1099,11 @@
   elasticsearch-model (~> 6.1)
   elasticsearch-rails (~> 6.1)
   email_reply_trimmer (~> 0.1)
-  email_spec (~> 2.2.0)
   erubi (~> 1.9.0)
   escape_utils (~> 1.1)
-  factory_bot_rails (~> 6.2.0)
   faraday (~> 1.0)
   faraday_middleware-aws-sigv4 (~> 0.3.0)
   fast_blank
-  ffaker (~> 2.10)
   flipper (~> 0.21.0)
   flipper-active_record (~> 0.21.0)
   flipper-active_support_cache_store (~> 0.21.0)
@@ -1459,7 +1116,6 @@
   fog-openstack (~> 1.0)
   fog-rackspace (~> 0.1.1)
   fugit (~> 1.2.1)
-  fuubar (~> 2.2.0)
   gemojione (~> 3.3)
   gettext (~> 3.3)
   gettext_i18n_rails (~> 1.8.0)
@@ -1467,7 +1123,6 @@
   gitaly (~> 14.3.0.pre.rc1)
   github-markup (~> 1.7.0)
   gitlab-chronic (~> 0.10.5)
-  gitlab-dangerfiles (~> 2.3.0)
   gitlab-experiment (~> 0.6.4)
   gitlab-fog-azure-rm (~> 1.1.1)
   gitlab-labkit (~> 0.21.1)
@@ -1477,7 +1132,6 @@
   gitlab-net-dns (~> 0.9.1)
   gitlab-omniauth-openid-connect (~> 0.8.0)
   gitlab-sidekiq-fetcher (= 0.5.6)
-  gitlab-styles (~> 6.3.0)
   gitlab_chronic_duration (~> 0.10.6.2)
   gitlab_omniauth-ldap (~> 2.1.1)
   gon (~> 6.4.0)
@@ -1491,11 +1145,8 @@
   graphiql-rails (~> 1.4.10)
   graphlient (~> 0.4.0)
   graphql (~> 1.11.8)
-  graphql-docs (~> 1.6.0)
   grpc (~> 1.30.2)
   gssapi
-  guard-rspec
-  haml_lint (~> 0.36.0)
   hamlit (~> 2.15.0)
   hangouts-chat (~> 0.0.5)
   hashie
@@ -1514,12 +1165,8 @@
   jwt (~> 2.1.0)
   kaminari (~> 1.0)
   kas-grpc (~> 0.0.2)
-  knapsack (~> 1.21.1)
   kramdown (~> 2.3.1)
   kubeclient (~> 4.9.2)
-  lefthook (~> 0.7.0)
-  letter_opener_web (~> 1.4.0)
-  license_finder (~> 6.0)
   licensee (~> 9.14.1)
   lockbox (~> 0.6.2)
   lograge (~> 0.5)
@@ -1531,9 +1178,8 @@
   memory_profiler (~> 0.9)
   method_source (~> 1.0)
   mini_magick (~> 4.10.1)
-  minitest (~> 5.11.0)
   multi_json (~> 1.14.1)
-  net-ldap (~> 0.16.3)
+  net-ldap (~> 0.16)
   net-ntp
   net-ssh (~> 6.0)
   nokogiri (~> 1.11.4)
@@ -1560,17 +1206,12 @@
   omniauth-twitter (~> 1.4)
   omniauth_crowd (~> 2.4.0)
   org-ruby (~> 0.9.12)
-  parallel (~> 1.19)
   parslet (~> 1.8)
   peek (~> 1.1)
   pg (~> 1.1)
   pg_query (~> 2.1)
-  png_quantizator (~> 0.2.1)
   premailer-rails (~> 1.10.3)
   prometheus-client-mmap (~> 0.15.0)
-  pry-byebug
-  pry-rails (~> 0.3.9)
-  pry-shell (~> 0.4.0)
   puma (~> 5.3.1)
   puma_worker_killer (~> 0.3.1)
   rack (~> 2.2.3)
@@ -1580,15 +1221,13 @@
   rack-proxy (~> 0.6.0)
   rack-timeout (~> 0.5.1)
   rails (~> 6.1.3.2)
-  rails-controller-testing
   rails-i18n (~> 6.0)
   rainbow (~> 3.0)
-  rblineprof (~> 0.3.6)
   rbtrace (~> 0.4)
   rdoc (~> 6.3.2)
   re2 (~> 1.2.0)
   recaptcha (~> 4.11)
-  redis (~> 4.1.4)
+  redis (~> 4.1)
   redis-actionpack (~> 5.2.0)
   redis-namespace (~> 1.8.1)
   request_store (~> 1.5)
@@ -1597,11 +1236,6 @@
   rexml (~> 3.2.5)
   rouge (~> 3.26.0)
   rqrcode-rails3 (~> 0.1.7)
-  rspec-parameterized
-  rspec-rails (~> 5.0.1)
-  rspec-retry (~> 0.6.1)
-  rspec_junit_formatter
-  rspec_profiling (~> 0.0.6)
   ruby-fogbugz (~> 0.2.1)
   ruby-magic (~> 0.4)
   ruby-prof (~> 1.3.0)
@@ -1613,32 +1247,20 @@
   sanitize (~> 5.2.1)
   sassc-rails (~> 2.1.0)
   seed-fu (~> 2.3.7)
-  selenium-webdriver (~> 3.142)
   sentry-raven (~> 3.1)
   settingslogic (~> 2.0.9)
-  shoulda-matchers (~> 4.0.1)
   sidekiq (~> 5.2.7)
   sidekiq-cron (~> 1.0)
-  simple_po_parser (~> 1.1.2)
-  simplecov (~> 0.18.5)
-  simplecov-cobertura (~> 1.3.1)
   slack-messenger (~> 2.3.4)
   snowplow-tracker (~> 0.6.1)
-  solargraph (~> 0.43)
   spamcheck (~> 0.1.0)
-  spring (~> 2.1.0)
-  spring-commands-rspec (~> 1.0.4)
   sprockets (~> 3.7.0)
   sshkey (~> 2.0)
   stackprof (~> 0.2.15)
   state_machines-activerecord (~> 0.8.0)
   sys-filesystem (~> 1.1.6)
   terser (= 1.0.2)
-  test-prof (~> 0.12.0)
-  test_file_finder (~> 0.1.3)
-  thin (~> 1.8.0)
   thrift (>= 0.14.0)
-  timecop (~> 0.9.1)
   toml-rb (~> 2.0)
   truncato (~> 0.7.11)
   u2f (~> 0.2.1)
@@ -1650,10 +1272,8 @@
   vmstat (~> 2.3.0)
   warning (~> 1.2.0)
   webauthn (~> 2.3)
-  webmock (~> 3.9.1)
-  webrick (~> 1.6.1)
   wikicloth (= 0.8.1)
   yajl-ruby (~> 1.4.1)

 BUNDLED WITH
-   2.1.4
+   2.2.25

A trace shows the following information:

root@gitlab:~ # su -l git -c "cd /usr/local/www/gitlab-ce && rake db:migrate RAILS_ENV=production --trace"
rake aborted!
TypeError: wrong argument type Hash (expected String)
/usr/local/lib/ruby/gems/2.7/gems/kas-grpc-0.0.3/lib/internal/module/agent_tracker/rpc/rpc_pb.rb:11:in `optional'
/usr/local/lib/ruby/gems/2.7/gems/kas-grpc-0.0.3/lib/internal/module/agent_tracker/rpc/rpc_pb.rb:11:in `block (4 levels) in <top (required)>'
/usr/local/lib/ruby/gems/2.7/gems/kas-grpc-0.0.3/lib/internal/module/agent_tracker/rpc/rpc_pb.rb:10:in `instance_eval'
/usr/local/lib/ruby/gems/2.7/gems/kas-grpc-0.0.3/lib/internal/module/agent_tracker/rpc/rpc_pb.rb:10:in `oneof'
/usr/local/lib/ruby/gems/2.7/gems/kas-grpc-0.0.3/lib/internal/module/agent_tracker/rpc/rpc_pb.rb:10:in `block (3 levels) in <top (required)>'
/usr/local/lib/ruby/gems/2.7/gems/kas-grpc-0.0.3/lib/internal/module/agent_tracker/rpc/rpc_pb.rb:9:in `instance_eval'
/usr/local/lib/ruby/gems/2.7/gems/kas-grpc-0.0.3/lib/internal/module/agent_tracker/rpc/rpc_pb.rb:9:in `add_message'
/usr/local/lib/ruby/gems/2.7/gems/kas-grpc-0.0.3/lib/internal/module/agent_tracker/rpc/rpc_pb.rb:9:in `block (2 levels) in <top (required)>'
/usr/local/lib/ruby/gems/2.7/gems/kas-grpc-0.0.3/lib/internal/module/agent_tracker/rpc/rpc_pb.rb:8:in `instance_eval'
/usr/local/lib/ruby/gems/2.7/gems/kas-grpc-0.0.3/lib/internal/module/agent_tracker/rpc/rpc_pb.rb:8:in `add_file'
/usr/local/lib/ruby/gems/2.7/gems/kas-grpc-0.0.3/lib/internal/module/agent_tracker/rpc/rpc_pb.rb:8:in `block in <top (required)>'
/usr/local/lib/ruby/gems/2.7/gems/kas-grpc-0.0.3/lib/internal/module/agent_tracker/rpc/rpc_pb.rb:7:in `instance_eval'
/usr/local/lib/ruby/gems/2.7/gems/kas-grpc-0.0.3/lib/internal/module/agent_tracker/rpc/rpc_pb.rb:7:in `build'
/usr/local/lib/ruby/gems/2.7/gems/kas-grpc-0.0.3/lib/internal/module/agent_tracker/rpc/rpc_pb.rb:7:in `<top (required)>'
/usr/local/lib/ruby/gems/2.7/gems/activesupport-6.1.3.2/lib/active_support/dependencies.rb:332:in `require'
/usr/local/lib/ruby/gems/2.7/gems/activesupport-6.1.3.2/lib/active_support/dependencies.rb:332:in `block in require'
/usr/local/lib/ruby/gems/2.7/gems/activesupport-6.1.3.2/lib/active_support/dependencies.rb:299:in `load_dependency'
/usr/local/lib/ruby/gems/2.7/gems/activesupport-6.1.3.2/lib/active_support/dependencies.rb:332:in `require'
/usr/local/lib/ruby/gems/2.7/gems/kas-grpc-0.0.3/lib/internal/module/agent_tracker/rpc/rpc_services_pb.rb:5:in `<top (required)>'
/usr/local/lib/ruby/gems/2.7/gems/activesupport-6.1.3.2/lib/active_support/dependencies.rb:332:in `require'
/usr/local/lib/ruby/gems/2.7/gems/activesupport-6.1.3.2/lib/active_support/dependencies.rb:332:in `block in require'
/usr/local/lib/ruby/gems/2.7/gems/activesupport-6.1.3.2/lib/active_support/dependencies.rb:299:in `load_dependency'
/usr/local/lib/ruby/gems/2.7/gems/activesupport-6.1.3.2/lib/active_support/dependencies.rb:332:in `require'
/usr/local/lib/ruby/gems/2.7/gems/kas-grpc-0.0.3/lib/kas-grpc.rb:1:in `<top (required)>'
/usr/local/lib/ruby/gems/2.7/gems/bundler-2.2.25/lib/bundler/runtime.rb:60:in `require'
/usr/local/lib/ruby/gems/2.7/gems/bundler-2.2.25/lib/bundler/runtime.rb:60:in `block (2 levels) in require'
/usr/local/lib/ruby/gems/2.7/gems/bundler-2.2.25/lib/bundler/runtime.rb:55:in `each'
/usr/local/lib/ruby/gems/2.7/gems/bundler-2.2.25/lib/bundler/runtime.rb:55:in `block in require'
/usr/local/lib/ruby/gems/2.7/gems/bundler-2.2.25/lib/bundler/runtime.rb:44:in `each'
/usr/local/lib/ruby/gems/2.7/gems/bundler-2.2.25/lib/bundler/runtime.rb:44:in `require'
/usr/local/lib/ruby/gems/2.7/gems/bundler-2.2.25/lib/bundler.rb:174:in `require'
/usr/local/www/gitlab-ce/config/application.rb:15:in `<top (required)>'
/usr/local/lib/ruby/site_ruby/2.7/rubygems/core_ext/kernel_require.rb:54:in `require'
/usr/local/lib/ruby/site_ruby/2.7/rubygems/core_ext/kernel_require.rb:54:in `require'
/usr/local/www/gitlab-ce/Rakefile:9:in `<top (required)>'
/usr/local/lib/ruby/gems/2.7/gems/rake-13.0.6/lib/rake/rake_module.rb:29:in `load'
/usr/local/lib/ruby/gems/2.7/gems/rake-13.0.6/lib/rake/rake_module.rb:29:in `load_rakefile'
/usr/local/lib/ruby/gems/2.7/gems/rake-13.0.6/lib/rake/application.rb:710:in `raw_load_rakefile'
/usr/local/lib/ruby/gems/2.7/gems/rake-13.0.6/lib/rake/application.rb:104:in `block in load_rakefile'
/usr/local/lib/ruby/gems/2.7/gems/rake-13.0.6/lib/rake/application.rb:186:in `standard_exception_handling'
/usr/local/lib/ruby/gems/2.7/gems/rake-13.0.6/lib/rake/application.rb:103:in `load_rakefile'
/usr/local/lib/ruby/gems/2.7/gems/rake-13.0.6/lib/rake/application.rb:82:in `block in run'
/usr/local/lib/ruby/gems/2.7/gems/rake-13.0.6/lib/rake/application.rb:186:in `standard_exception_handling'
/usr/local/lib/ruby/gems/2.7/gems/rake-13.0.6/lib/rake/application.rb:80:in `run'
/usr/local/lib/ruby/gems/2.7/gems/rake-13.0.6/exe/rake:27:in `<top (required)>'
/usr/local/bin/rake:23:in `load'
/usr/local/bin/rake:23:in `<main>'
Edited by Matthias Fechner