Skip to content

500 when confirming secondary email in unlogged in session: NoMethodError: undefined method `provisioned_by_group'

Everyone can contribute. Help move this issue forward while earning points, leveling up and collecting rewards.

Sentry Issue: GITLABCOM-XJM

NoMethodError: undefined method `provisioned_by_group' for #<Email id: 11631457, user_id: 2454149, email: "redacted@example.com", created_at: "2022-08-08 19:07:40.569933000 +0000", updated_at: "2023-08-14 15:39:47.167845514 +0000">
  app/controllers/confirmations_controller.rb:38:in `after_confirmation_path_for'
    sign_in_path(resource)
  app/controllers/application_controller.rb:500:in `set_current_admin'
    return yield unless Gitlab::CurrentSettings.admin_mode
  lib/gitlab/session.rb:11:in `with_session'
    yield
  app/controllers/application_controller.rb:491:in `set_session_storage'
    Gitlab::Session.with_session(session, &block)
  lib/gitlab/i18n.rb:107:in `with_locale'
    yield
...
(164 additional frame(s) were not displayed)

Summary

When confirming a secondary email in a new browser session (or private window), you get a 500. However, the email is verified.

Steps to reproduce

  1. Add a secondary email in https://gitlab.com/-/profile/emails
  2. Open the confirmation email link in a new browser session or private window.
  3. Get a 500.
  4. Visit https://gitlab.com/-/profile/emails and notice the secondary email is verified.

What is the current bug behavior?

Get a 500.

What is the expected correct behavior?

Get a "confirmed" message, and the sign in page.

Output of checks

GitLab.com, GitLab Enterprise Edition 16.3.0-pre fb965b87

Edited by 🤖 GitLab Bot 🤖