Old MergeRequest throwing 500 on MergeRequest show page
Created by: brodock
This is related to the reported bug at #3708 (closed), #3806. Using the workaround provided (appending a /edit and trying to save again the mergerequest didn't help)
I've tried to force a close by the rails console, and got a more detailed backtrace that can help fix the problem:
NoMethodError: undefined method `id' for nil:NilClass
from /home/git/gitlab/app/services/notification_service.rb:199:in `block in close_resource_email'
from /home/git/gitlab/app/services/notification_service.rb:198:in `each'
from /home/git/gitlab/app/services/notification_service.rb:198:in `close_resource_email'
from /home/git/gitlab/app/services/notification_service.rb:73:in `close_mr'
from /home/git/gitlab/app/observers/merge_request_observer.rb:9:in `after_close'
from /home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/state_machine-1.2.0/lib/state_machine/integrations/active_model/observer.rb:24:in `update_with_transition'
from /home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/activemodel-3.2.13/lib/active_model/observing.rb:231:in `update'
from /home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/activemodel-3.2.13/lib/active_model/observing.rb:74:in `block in notify_observers'
from /home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/activemodel-3.2.13/lib/active_model/observing.rb:74:in `each'
from /home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/activemodel-3.2.13/lib/active_model/observing.rb:74:in `notify_observers'
from /home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/state_machine-1.2.0/lib/state_machine/integrations/active_model.rb:572:in `block (3 levels) in notify'
from /home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/state_machine-1.2.0/lib/state_machine/integrations/active_model.rb:570:in `each'
from /home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/state_machine-1.2.0/lib/state_machine/integrations/active_model.rb:570:in `block (2 levels) in notify'
from /home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/state_machine-1.2.0/lib/state_machine/integrations/active_model.rb:569:in `each'
from /home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/state_machine-1.2.0/lib/state_machine/integrations/active_model.rb:569:in `block in notify'
from /home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/state_machine-1.2.0/lib/state_machine/integrations/active_model.rb:568:in `each'
... 29 levels...
from /home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/state_machine-1.2.0/lib/state_machine/transition_collection.rb:154:in `each'
from /home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/state_machine-1.2.0/lib/state_machine/transition_collection.rb:154:in `block in run_actions'
from /home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/state_machine-1.2.0/lib/state_machine/transition_collection.rb:170:in `catch_exceptions'
from /home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/state_machine-1.2.0/lib/state_machine/transition_collection.rb:148:in `run_actions'
from /home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/state_machine-1.2.0/lib/state_machine/transition_collection.rb:60:in `perform'
from /home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/state_machine-1.2.0/lib/state_machine/transition.rb:219:in `perform'
from /home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/state_machine-1.2.0/lib/state_machine/event.rb:172:in `fire'
from /home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/state_machine-1.2.0/lib/state_machine/event.rb:247:in `block in add_actions'
from /home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/state_machine-1.2.0/lib/state_machine/machine.rb:765:in `call'
from /home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/state_machine-1.2.0/lib/state_machine/machine.rb:765:in `block (2 levels) in define_helper'
from (irb):2
from /home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/commands/console.rb:47:in `start'
from /home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/commands/console.rb:8:in `start'
from /home/git/gitlab/vendor/bundle/ruby/1.9.1/gems/railties-3.2.13/lib/rails/commands.rb:41:in `<top (required)>'
from script/rails:6:in `require'
from script/rails:6:in `<main>'
There is one more important thing:
m.merge_status
=> "unchecked"
I don't know for sure, but I believe that this can have some relations to the problem