422 error when trying to view group CI/CD settings page

Summary

I just upgraded from GitLab CE 11.4.0 to 11.5.0.

Now, when I try to access https://gitlab.example.com/groups/GROUPNAME/-/settings/ci_cd, I get the following error:

422
The change you requested was rejected.

Steps to reproduce

Not sure yet.

Relevant logs and/or screenshots

Started GET "/groups/GROUPNAME/-/settings/ci_cd" for 192.168.1.114 at 2018-11-26 12:18:30 -0500
Processing by Groups::Settings::CiCdController#show as HTML
  Parameters: {"group_id"=>"GROUPNAME"}
Completed 500 Internal Server Error in 24ms (ActiveRecord: 3.8ms)

ActiveRecord::RecordInvalid (Validation failed: Visibility level internal is not allowed since there are sub-groups with higher visibility.):
  app/models/concerns/token_authenticatable_strategies/base.rb:36:in `reset_token!'
  app/models/concerns/token_authenticatable_strategies/base.rb:29:in `ensure_token!'
  app/models/concerns/token_authenticatable.rb:49:in `block in add_authentication_token_field'
  app/models/group.rb:400:in `runners_token'
  app/views/groups/runners/_group_runners.html.haml:13:in `_app_views_groups_runners__group_runners_html_haml___3393109943190800070_69952183432700'
  app/views/groups/runners/_index.html.haml:9:in `_app_views_groups_runners__index_html_haml___3383394826299240053_69952183581700'
  app/views/groups/settings/ci_cd/show.html.haml:27:in `_app_views_groups_settings_ci_cd_show_html_haml___3984483527661698131_69952182247280'
  app/controllers/application_controller.rb:116:in `render'
  lib/gitlab/i18n.rb:55:in `with_locale'
  lib/gitlab/i18n.rb:61:in `with_user_locale'
  app/controllers/application_controller.rb:426:in `set_locale'
  lib/gitlab/middleware/multipart.rb:101:in `call'
  lib/gitlab/request_profiler/middleware.rb:14:in `call'
  lib/gitlab/middleware/go.rb:17:in `call'
  lib/gitlab/etag_caching/middleware.rb:11:in `call'
  lib/gitlab/middleware/read_only/controller.rb:38:in `call'
  lib/gitlab/middleware/read_only.rb:16:in `call'
  lib/gitlab/middleware/basic_health_check.rb:25:in `call'
  lib/gitlab/request_context.rb:20:in `call'
  lib/gitlab/metrics/requests_rack_middleware.rb:27:in `call'
  lib/gitlab/middleware/release_env.rb:10:in `call'

I see this in the top-level group settings page:

gitlab_subgroup_vis_bug1

And this in the sub-group settings page:

gitlab_subgroup_vis_bug2

Output of checks

Results of GitLab environment info

root@gitlab:~# gitlab-rake gitlab:env:info

System information
System:		Debian 8.11
Current User:	git
Using RVM:	no
Ruby Version:	2.4.5p335
Gem Version:	2.7.6
Bundler Version:1.16.6
Rake Version:	12.3.1
Redis Version:	3.2.12
Git Version:	2.18.1
Sidekiq Version:5.2.1
Go Version:	unknown

GitLab information
Version:	11.5.0
Revision:	b7b1e8e
Directory:	/opt/gitlab/embedded/service/gitlab-rails
DB Adapter:	postgresql
URL:		https://gitlab.example.com
HTTP Clone URL:	https://gitlab.example.com/some-group/some-project.git
SSH Clone URL:	git@gitlab.example.com:some-group/some-project.git
Using LDAP:	no
Using Omniauth:	yes
Omniauth Providers: 

GitLab Shell
Version:	8.4.1
Repository storage paths:
- default: 	/var/opt/gitlab/git-data/repositories
Hooks:		/opt/gitlab/embedded/service/gitlab-shell/hooks
Git:		/opt/gitlab/embedded/bin/git

Results of GitLab application Check

root@gitlab:~# gitlab-rake gitlab:check SANITIZE=true
Checking GitLab Shell ...

GitLab Shell version >= 8.4.1 ? ... OK (8.4.1)
hooks directories in repos are links: ... 
6/1 ... repository is empty
7/2 ... ok
10/3 ... ok
2/4 ... ok
12/5 ... repository is empty
15/6 ... repository is empty
16/7 ... repository is empty
8/8 ... ok
15/10 ... ok
15/11 ... ok
Running /opt/gitlab/embedded/service/gitlab-shell/bin/check
Check GitLab API access: OK
Redis available via internal API: OK

Access to /var/opt/gitlab/.ssh/authorized_keys: OK
gitlab-shell self-check successful

Checking GitLab Shell ... Finished

Checking Gitaly ...

default ... OK

Checking Gitaly ... Finished

Checking Sidekiq ...

Running? ... yes
Number of Sidekiq processes ... 1

Checking Sidekiq ... Finished

Reply by email is disabled in config/gitlab.yml
Checking LDAP ...

LDAP is disabled in config/gitlab.yml

Checking LDAP ... Finished

Checking GitLab ...

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? ... no
  Try fixing it:
  sudo chown -R git /var/opt/gitlab/gitlab-rails/uploads
  sudo find /var/opt/gitlab/gitlab-rails/uploads -type f -exec chmod 0644 {} \;
  sudo find /var/opt/gitlab/gitlab-rails/uploads -type d -not -path /var/opt/gitlab/gitlab-rails/uploads -exec chmod 0700 {} \;
  For more information see:
  doc/install/installation.md in section "GitLab"
  Please fix the error above and rerun the checks.
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: ... 
6/1 ... yes
7/2 ... yes
10/3 ... yes
2/4 ... yes
12/5 ... yes
15/6 ... yes
16/7 ... yes
8/8 ... yes
15/10 ... yes
15/11 ... yes
Redis version >= 2.8.0? ... yes
Ruby version >= 2.3.5 ? ... yes (2.4.5)
Git version >= 2.9.5 ? ... yes (2.18.1)
Git user has default SSH configuration? ... yes
Active users: ... 13

Checking GitLab ... Finished
Edited by Jonathon Reinhart