undefined method `allow_mfa_for_subgroups' for nil:NilClass after upgrading to 13.5.1 (8ee0746f54c)
### Summary Undefined method error in logs after going to group settings. <!-- Summarize the bug encountered concisely. --> ### Steps to reproduce <!-- Describe how one can reproduce the issue - this is very important. Please use an ordered list. --> * Clean 13.5.0 install, upgraded to 13.5.1 (for reference, probably shows in 13.5.1 clean too) * go to a group, when I go to /remobjects (a group) and click settings I end up on: /groups/remobjects/-/edit * ```500 Whoops, something went wrong on our end.``` Logs show: ### What is the current *bug* behavior? 500 error. ### What is the expected *correct* behavior? Settings. ### Relevant logs and/or screenshots ``` ActionView::Template::Error (undefined method `allow_mfa_for_subgroups' for nil:NilClass): 18: - unless group.has_parent? 19: .form-group 20: .form-check 21: = f.check_box :allow_mfa_for_subgroups, class: 'form-check-input', checked: group.namespace_settings.allow_mfa_for_subgroups 22: = f.label :allow_mfa_for_subgroups, class: 'form-check-label' do 23: = _('Allow subgroups to set up their own two-factor authentication rules') app/views/groups/settings/_two_factor_auth.html.haml:21 app/views/groups/settings/_permissions.html.haml:41 app/views/groups/settings/_permissions.html.haml:1 app/views/groups/edit.html.haml:27 app/controllers/application_controller.rb:134:in `render' app/controllers/application_controller.rb:493:in `set_current_admin' lib/gitlab/session.rb:11:in `with_session' app/controllers/application_controller.rb:484:in `set_session_storage' lib/gitlab/i18n.rb:73:in `with_locale' lib/gitlab/i18n.rb:79:in `with_user_locale' app/controllers/application_controller.rb:478:in `set_locale' lib/gitlab/error_tracking.rb:52:in `with_context' app/controllers/application_controller.rb:543:in `sentry_context' app/controllers/application_controller.rb:471:in `block in set_current_context' lib/gitlab/application_context.rb:54:in `block in use' lib/gitlab/application_context.rb:54:in `use' lib/gitlab/application_context.rb:21:in `with_context' app/controllers/application_controller.rb:463:in `set_current_context' lib/gitlab/metrics/elasticsearch_rack_middleware.rb:16:in `call' lib/gitlab/middleware/rails_queue_duration.rb:33:in `call' lib/gitlab/metrics/rack_middleware.rb:16:in `block in call' lib/gitlab/metrics/transaction.rb:61:in `run' lib/gitlab/metrics/rack_middleware.rb:16:in `call' lib/gitlab/request_profiler/middleware.rb:17:in `call' lib/gitlab/jira/middleware.rb:19:in `call' lib/gitlab/middleware/go.rb:20:in `call' lib/gitlab/etag_caching/middleware.rb:13:in `call' lib/gitlab/middleware/multipart.rb:218:in `call' lib/gitlab/middleware/handle_null_bytes.rb:19:in `call' lib/gitlab/middleware/read_only/controller.rb:51:in `call' lib/gitlab/middleware/read_only.rb:18:in `call' lib/gitlab/middleware/same_site_cookies.rb:27:in `call' lib/gitlab/middleware/basic_health_check.rb:25:in `call' lib/gitlab/middleware/handle_ip_spoof_attack_error.rb:25:in `call' lib/gitlab/middleware/request_context.rb:23:in `call' config/initializers/fix_local_cache_middleware.rb:9:in `call' lib/gitlab/metrics/requests_rack_middleware.rb:49:in `call' lib/gitlab/middleware/release_env.rb:12:in `call' ``` ![image](/uploads/fffa41d7b44acaded9f9d3ec3a627c63/image.png) ### Output of checks Works fine on gitlab.com #### Results of GitLab environment info ``` System information System: Current User: git Using RVM: no Ruby Version: 2.6.6p146 Gem Version: 2.7.10 Bundler Version:1.17.3 Rake Version: 12.3.3 Redis Version: 5.0.9 Git Version: 2.28.0 Sidekiq Version:5.2.9 Go Version: unknown GitLab information Version: 13.5.1 Revision: 8ee0746f54c Directory: /opt/gitlab/embedded/service/gitlab-rails DB Adapter: PostgreSQL DB Version: 11.9 URL: https://git.remobjects.com HTTP Clone URL: https://git.remobjects.com/some-group/some-project.git SSH Clone URL: git@git.remobjects.com:some-group/some-project.git Using LDAP: yes Using Omniauth: yes Omniauth Providers: GitLab Shell Version: 13.11.0 Repository storage paths: - default: /var/opt/gitlab/git-data/repositories GitLab Shell path: /opt/gitlab/embedded/service/gitlab-shell Git: /opt/gitlab/embedded/bin/git ``` (Docker based install) #### Results of GitLab application Check ``` root@git:/# gitlab-rake gitlab:check SANITIZE=true Checking GitLab subtasks ... Checking GitLab Shell ... GitLab Shell: ... GitLab Shell version >= 13.11.0 ? ... OK (13.11.0) Running /opt/gitlab/embedded/service/gitlab-shell/bin/check Internal API available: OK Redis available via internal API: OK gitlab-shell self-check successful Checking GitLab Shell ... Finished Checking Gitaly ... Gitaly: ... default ... OK Checking Gitaly ... Finished Checking Sidekiq ... Sidekiq: ... Running? ... yes Number of Sidekiq processes ... 1 Checking Sidekiq ... Finished Checking Incoming Email ... Incoming Email: ... Reply by email is disabled in config/gitlab.yml Checking Incoming Email ... Finished Checking LDAP ... LDAP: ... Server: ldapmain LDAP authentication... Success LDAP users with access to your GitLab server (only showing the first 100 results) User output sanitized. Found 50 users of 100 limit. Checking LDAP ... Finished Checking GitLab App ... Git configured correctly? ... yes Database config exists? ... yes All migrations up? ... yes Database contains orphaned GroupMembers? ... no GitLab config exists? ... yes GitLab config up to date? ... yes Log directory writable? ... yes Tmp directory writable? ... yes Uploads directory exists? ... yes Uploads directory has correct permissions? ... yes Uploads directory tmp has correct permissions? ... yes Init script exists? ... skipped (omnibus-gitlab has no init script) Init script up-to-date? ... skipped (omnibus-gitlab has no init script) Projects have namespace: ... 3/1 ... yes 3/2 ... yes 3/3 ... yes 3/4 ... yes 3/5 ... yes 3/6 ... yes 3/7 ... yes Redis version >= 4.0.0? ... yes Ruby version >= 2.5.3 ? ... yes (2.6.6) Git version >= 2.24.0 ? ... yes (2.28.0) Git user has default SSH configuration? ... yes Active users: ... 14 Is authorized keys file accessible? ... yes GitLab configured to store new projects in hashed storage? ... yes All projects are in hashed storage? ... yes Checking GitLab App ... Finished Checking GitLab subtasks ... Finished root@git:/# ```
issue