Skip to content

LastPushEventService#project_cache_key: undefined method `id' for nil:NilClass

https://sentry.gitlap.com/gitlab/gitlabcom/issues/98371/

NoMethodError: undefined method `id' for nil:NilClass
  app/services/users/last_push_event_service.rb:70:in `project_cache_key'
    "last-push-event/#{@user.id}/#{project.id}"
  lib/gitlab/metrics/instrumentation.rb:156:in `block in project_cache_key'
    trans.method_call_for(#{label.to_sym.inspect}).measure { super }
  lib/gitlab/metrics/method_call.rb:23:in `measure'
    retval = yield
  lib/gitlab/metrics/instrumentation.rb:156:in `project_cache_key'
    trans.method_call_for(#{label.to_sym.inspect}).measure { super }
  app/services/users/last_push_event_service.rb:20:in `cache_last_push_event'
    keys << project_cache_key(event.project.forked_from_project)
...
(52 additional frame(s) were not displayed)

undefined method `id' for nil:NilClass