Group notification email address 500
Summary
When I try to change group notification email settings on this page https://gitlab.com/profile/notifications I get an 500 error.
Steps to reproduce
Change the notification email in the groups section from global settings to a specified email address. The group should has a dot in its name.
Example error
The parameter is the issue. A group name help.ab123
is resulting in the code trying to fetch the help
group instead (in app/controllers/profiles/groups_controller.rb).
https://nonprod-log.gitlab.net/goto/f918b5b5c5600406b411737e82b98c9e, NoMethodError
undefined method `name' for nil:NilClass`
app/controllers/profiles/groups_controller.rb:11:in `update', ee/lib/gitlab/ip_address_state.rb:10:in `with', ee/app/controllers/ee/application_controller.rb:44:in `set_current_ip_address', app/controllers/application_controller.rb:491:in `set_current_admin', lib/gitlab/session.rb:11:in `with_session', app/controllers/application_controller.rb:482:in `set_session_storage', app/controllers/application_controller.rb:476:in `set_locale', lib/gitlab/error_tracking.rb:50:in `with_context', app/controllers/application_controller.rb:541:in `sentry_context', app/controllers/application_controller.rb:469:in `block in set_current_context', lib/gitlab/application_context.rb:52:in `block in use', lib/gitlab/application_context.rb:52:in `use', lib/gitlab/application_context.rb:20:in `with_context', app/controllers/application_controller.rb:462:in `set_current_context', ee/lib/omni_auth/strategies/group_saml.rb:41:in `other_phase', ee/lib/gitlab/jira/middleware.rb:19:in `call'
params
{
"key": "utf8",
"value": "✓"
},
{
"key": "_method",
"value": "put"
},
{
"value": "[FILTERED]",
"key": "authenticity_token"
},
{
"key": "notification_setting",
"value": "{\"notification_email\"=>\"tkuah@gitlab.com\"}"
},
{
"key": "id",
"value": "help"
}
Possible fixes
(If you can, link to the line of code that might be responsible for the problem)
Add constraints: { id: Gitlab::PathRegex.full_namespace_route_regex }
to config/routes/profile.rb#L25 and then add routing specs
Edited by Thong Kuah