GitLab 13 Migration Failed; Service Dead

After upgrading to 13 on xenial.

    System Info:
    ------------
    chef_version=14.14.29
    platform=ubuntu
    platform_version=16.04
    ruby=ruby 2.6.6p146 (2020-03-31 revision 67876) [x86_64-linux]
    program_name=/opt/gitlab/embedded/bin/chef-client
    executable=/opt/gitlab/embedded/bin/chef-client
bash[migrate gitlab-rails database] (gitlab::database_migrations line 55) had an error: Mixlib::ShellOut::ShellCommandFailed: Expected process to exit with [0], but received '1'
---- Begin output of "bash"  "/tmp/chef-script20200523-27504-4xsqos" ----
STDOUT: rake aborted!
NoMethodError: undefined method `parent_class' for MergeRequest:Class
Did you mean?  parents
/opt/gitlab/embedded/service/gitlab-rails/lib/api/notes.rb:11:in `block in <class:Notes>'
/opt/gitlab/embedded/service/gitlab-rails/lib/api/notes.rb:10:in `each'
/opt/gitlab/embedded/service/gitlab-rails/lib/api/notes.rb:10:in `<class:Notes>'
/opt/gitlab/embedded/service/gitlab-rails/lib/api/notes.rb:4:in `<module:API>'
/opt/gitlab/embedded/service/gitlab-rails/lib/api/notes.rb:3:in `<top (required)>'
/opt/gitlab/embedded/service/gitlab-rails/lib/api/api.rb:170:in `block in <class:API>'
/opt/gitlab/embedded/service/gitlab-rails/lib/api/api.rb:117:in `<class:API>'
/opt/gitlab/embedded/service/gitlab-rails/lib/api/api.rb:4:in `<module:API>'
/opt/gitlab/embedded/service/gitlab-rails/lib/api/api.rb:3:in `<top (required)>'
(eval):4:in `draw_route'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/patch/draw_route.rb:30:in `instance_eval'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/patch/draw_route.rb:30:in `draw_route'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/patch/draw_route.rb:17:in `draw_ce'
/opt/gitlab/embedded/service/gitlab-rails/lib/gitlab/patch/draw_route.rb:11:in `draw'
/opt/gitlab/embedded/service/gitlab-rails/config/routes.rb:243:in `block in <top (required)>'
/opt/gitlab/embedded/service/gitlab-rails/config/routes.rb:4:in `<top (required)>'
/opt/gitlab/embedded/service/gitlab-rails/config/application.rb:301:in `block in <class:Application>'
/opt/gitlab/embedded/service/gitlab-rails/config/environment.rb:5:in `<top (required)>'
/opt/gitlab/embedded/bin/bundle:23:in `load'
/opt/gitlab/embedded/bin/bundle:23:in `<main>'
Tasks: TOP => gitlab:db:configure => environment
(See full trace by running task with --trace)

Rollback to 12.10.6 was successful. Tried again to upgrade to 13.0.0 and it again failed to migrate: NoMethodError: undefined method `parent_class' for MergeRequest:Class.

Rollback to 12.10.6 was again successful; set a hold on the package to stay at 12.10.6.

Hi @mcconnors I had a similar problem, here’s what I did to resolve it:

  • upgrade to 12.10.6 (sounds like you already did this)
  • resolve any warnings in gitlab-ctl check-config or gitlab-rake gitlab:check
  • run gitlab-rake db:migrate, gitlab-ctl reconfigure, and gitlab-ctl restart
  • sudo apt update && sudo apt upgrade gitlab-ee -y
  • gitlab-ctl reconfigure

Let me know how it goes!

Thanks. No warnings from check-config nor gitlab:check. I did run reconfigure after the first upgrade attempt and before the last upgrade attempt, but I’ll give it another go with db:migrate and restart before the upgrade…

Same error while applying the 13.0.0 migrations (NoMethodError: undefined method `parent_class' for MergeRequest:Class).

  • Upgraded 12.10.6-ce.0 to 12.10.8-ce.0
  • No warnings from check-config
  • No warnings from gitlab:check
  • Upgrade 12.10.8-ce.0 to 13.0.3-ce.0
  • Migration failed; gitlab-rails could not start
    • NoMethodError: undefined method `parent_class' for MergeRequest:Class
  • Rolled back to 12.10.8-ce.0

I also got this error, trying a rollback , crossing fingers.

1 Like