Skip to content

ActionView::Template::Error: undefined method `can?' for nil:NilClass

https://sentry.gitlab.net/gitlab/gitlabcom/issues/1587940/?referrer=gitlab_plugin

NoMethodError: undefined method `can?' for nil:NilClass
  ci/minutes/context.rb:22:in `can_see_status?'
    user.can?(:create_pipeline, project)
  ci/minutes/notification.rb:34:in `eligible_for_notifications?'
    context.shared_runners_minutes_limit_enabled? && context.can_see_status?
  ci/minutes/notification.rb:14:in `initialize'
    @level = calculate_level if eligible_for_notifications?
  /opt/gitlab/embedded/service/gitlab-rails/ee/app/views/shared/_shared_runners_minutes_limit.html.haml:1:in `new'
    - notification = ::Ci::Minutes::Notification.new(current_user, local_assigns.dig(:project), local_assigns.dig(:namespace))
  /opt/gitlab/embedded/service/gitlab-rails/ee/app/views/shared/_shared_runners_minutes_limit.html.haml:1:in `_ee_app_views_shared__shared_runners_minutes_limit_html_haml___568340367119744449_69980623788420'
    - notification = ::Ci::Minutes::Notification.new(current_user, local_assigns.dig(:project), local_assigns.dig(:namespace))
...
(217 additional frame(s) were not displayed)

ActionView::Template::Error: undefined method `can?' for nil:NilClass

ActionView::Template::Error: undefined method `can?' for nil:NilClass