NoMethodError... when executing sudo gitlab-rails c. So I waited 2 mins, exited and tried it again with success. Is that ok?

[solved] - NoMethodError… when executing ‘sudo gitlab-rails c’ when trying to fix the BackgroundMigration.remaining’ to be zero 0 in between software upgrades.

  • Did I solve this the correct way by just waiting 2 mins and trying the command again? Was there a better way?

  • Would anyone happen to know what caused the error when I tried the what-do-i-do-if-my-background-migrations-are-stuck ? weird because another upgrade path step before this had 1 process and these steps fixed it just fine.

Solution -

  1. I waited 2 mins

  2. Exited.

  3. Then tried the same steps again what-do-i-do-if-my-background-migrations-are-stuck steps again and it worked the 2nd time.

It worked. I checked the background migration remaining status again and it was good at 0.
sudo gitlab-rails runner -e production ‘puts Gitlab::BackgroundMigration.remaining’

These are all the status checks I was doing before doing the next upgrade path install.
gitlab-ctl status
gitlab-rake gitlab:check
gitlab-rake gitlab:env:info
sudo gitlab-rails runner -e production ‘puts Gitlab::BackgroundMigration.remaining’

sudo gitlab-rails runner -e production ‘puts Gitlab::BackgroundMigration.remaining’

So there are 4 back ground migration processes but I want 0 before starting the next software upgrade.

So I followed the steps what-do-i-do-if-my-background-migrations-are-stuck and they usually work.

But this time I got this error on this step.

sudo gitlab-rails c

Ruby: ruby 2.7.2p137 (2020-10-01 revision 5445e04352) [x86_64-linux]
GitLab: 13.11.4 (cea3c37b30e) FOSS
GitLab Shell: 13.17.0
PostgreSQL: 12.6

Loading production environment (Rails
irb(main):001:0> scheduled_queue =
=> #<Sidekiq::ScheduledSet:0x00007f5d055474c8 @name=“schedule”, @_size=8>
irb(main):002:0> pending_job_classes = { |job| job[“class”] == “BackgroundMigrationWorker” }.map { |j
ob| job[“args”].first }.uniq
=> [“UserMentions::CreateResourceUserMention”, “BackfillJiraTrackerDeploymentType2”]
irb(main):003:0> pending_job_classes.each { |job_class| Gitlab::BackgroundMigration.steal(job_class) }
Traceback (most recent call last):
16: from lib/banzai/filter/references/reference_filter.rb:204:in with_update_nodes' 15: from lib/banzai/filter/references/reference_filter.rb:34:in block in call_and_update_nodes’
14: from lib/banzai/filter/references/abstract_reference_filter.rb:150:in call' 13: from lib/banzai/filter/references/abstract_reference_filter.rb:150:in each_with_index’
12: from lib/banzai/filter/references/abstract_reference_filter.rb:150:in each' 11: from lib/banzai/filter/references/abstract_reference_filter.rb:152:in block in call’
10: from lib/banzai/filter/references/reference_filter.rb:139:in replace_text_when_pattern_matches' 9: from lib/banzai/filter/references/abstract_reference_filter.rb:153:in block (2 levels) in call’
8: from lib/banzai/filter/references/abstract_reference_filter.rb:202:in object_link_filter' 7: from lib/banzai/filter/references/abstract_reference_filter.rb:96:in references_in’
6: from lib/banzai/filter/references/abstract_reference_filter.rb:46:in references_in' 5: from lib/banzai/filter/references/abstract_reference_filter.rb:46:in gsub’
4: from lib/banzai/filter/references/abstract_reference_filter.rb:48:in block in references_in' 3: from lib/banzai/filter/references/abstract_reference_filter.rb:206:in block in object_link_filter’
2: from lib/banzai/filter/references/abstract_reference_filter.rb:404:in full_project_path' 1: from lib/banzai/filter/references/abstract_reference_filter.rb:376:in current_parent_path’
NoMethodError (undefined method `full_path’ for #Gitlab::BackgroundMigration::UserMentions::Models::Project:0x00007f5cf78fc978)