Unable to modify any settings

I’m having issues modifying all settings in the admin panel, including a 422 when trying to access the runners tab. I suspect this happened after upgrading from 13 to 14.

==> /var/log/gitlab/gitlab-rails/production_json.log <==
{"method":"GET","path":"/admin/runners","format":"html","controller":"Admin::RunnersController","action":"index","status":500,"time":"2021-12-28T18:33:22.507Z","params":[],"correlation_id":"****************","meta.user":"bob","meta.caller_id":"Admin::RunnersController#index","meta.remote_ip":"10.1.110.18","meta.feature_category":"runner","meta.client_id":"user/2","remote_ip":"10.1.110.18","user_id":2,"username":"bob","ua":"Mozilla/5.0 (X11; Linux x86_64; rv:91.0) Gecko/20100101 Firefox/91.0","queue_duration_s":0.022434,"request_urgency":"default","target_duration_s":1,"redis_calls":2,"redis_duration_s":0.000998,"redis_read_bytes":245,"redis_write_bytes":1238,"redis_shared_state_calls":1,"redis_shared_state_duration_s":0.000364,"redis_shared_state_write_bytes":53,"redis_sessions_calls":1,"redis_sessions_duration_s":0.000634,"redis_sessions_read_bytes":245,"redis_sessions_write_bytes":1185,"db_count":9,"db_write_count":2,"db_cached_count":2,"db_replica_count":0,"db_primary_count":9,"db_replica_cached_count":0,"db_primary_cached_count":2,"db_replica_wal_count":0,"db_primary_wal_count":0,"db_replica_wal_cached_count":0,"db_primary_wal_cached_count":0,"db_replica_duration_s":0.0,"db_primary_duration_s":0.006,"cpu_s":0.054419,"mem_objects":20605,"mem_bytes":2471808,"mem_mallocs":6625,"mem_total_bytes":3296008,"pid":12091,"exception.class":"ActionView::Template::Error","exception.message":"Validation failed: You need to set terms to be enforced","exception.backtrace":["lib/gitlab/database/load_balancing/connection_proxy.rb:126:in `block in write_using_load_balancer'","lib/gitlab/database/load_balancing/load_balancer.rb:112:in `block in read_write'","lib/gitlab/database/load_balancing/load_balancer.rb:172:in `retry_with_backoff'","lib/gitlab/database/load_balancing/load_balancer.rb:110:in `read_write'","lib/gitlab/database/load_balancing/connection_proxy.rb:125:in `write_using_load_balancer'","lib/gitlab/database/load_balancing/connection_proxy.rb:77:in `transaction'","app/models/concerns/token_authenticatable_strategies/base.rb:44:in `reset_token!'","app/models/concerns/token_authenticatable_strategies/base.rb:37:in `ensure_token!'","app/models/concerns/token_authenticatable.rb:48:in `block in add_authentication_token_field'","app/models/application_setting_implementation.rb:402:in `runners_registration_token'","lib/gitlab/current_settings.rb:32:in `method_missing'","app/helpers/ci/runners_helper.rb:68:in `admin_runners_data_attributes'","app/views/admin/runners/index.html.haml:4","app/controllers/application_controller.rb:133:in `render'","app/controllers/application_controller.rb:490:in `set_current_admin'","lib/gitlab/session.rb:11:in `with_session'","app/controllers/application_controller.rb:481:in `set_session_storage'","lib/gitlab/i18n.rb:105:in `with_locale'","lib/gitlab/i18n.rb:111:in `with_user_locale'","app/controllers/application_controller.rb:475:in `set_locale'","app/controllers/application_controller.rb:469: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/middleware/speedscope.rb:13:in `call'","lib/gitlab/request_profiler/middleware.rb:17:in `call'","lib/gitlab/database/load_balancing/rack_middleware.rb:23:in `call'","lib/gitlab/metrics/rack_middleware.rb:16:in `block in call'","lib/gitlab/metrics/web_transaction.rb:46:in `run'","lib/gitlab/metrics/rack_middleware.rb:16:in `call'","lib/gitlab/jira/middleware.rb:19:in `call'","lib/gitlab/middleware/go.rb:20:in `call'","lib/gitlab/etag_caching/middleware.rb:21:in `call'","lib/gitlab/middleware/multipart.rb:173:in `call'","lib/gitlab/middleware/read_only/controller.rb:50:in `call'","lib/gitlab/middleware/read_only.rb:18:in `call'","lib/gitlab/middleware/same_site_cookies.rb:27:in `call'","lib/gitlab/middleware/handle_malformed_strings.rb:21: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:21:in `call'","config/initializers/fix_local_cache_middleware.rb:11:in `call'","lib/gitlab/middleware/compressed_json.rb:26:in `call'","lib/gitlab/middleware/rack_multipart_tempfile_factory.rb:19:in `call'","lib/gitlab/middleware/sidekiq_web_static.rb:20:in `call'","lib/gitlab/metrics/requests_rack_middleware.rb:75:in `call'","lib/gitlab/middleware/release_env.rb:13:in `call'"],"db_duration_s":0.00404,"view_duration_s":0.0,"duration_s":0.03444}

The main message I pull from the above is "exception.message":"Validation failed: You need to set terms to be enforced".

I get this error whenever attempting to make any changes.

Application settings update failed
#### The form contains the following error:

* You need to set terms to be enforced

I’m also getting the same error referenced in this stackoverflow post when running gitlab-rails dbconsole.

db_config': 'primary' database is not configured for 'production'

Also running any command frog gitlab-rails console

[root@gitlab ~]# gitlab-rails console
--------------------------------------------------------------------------------
 Ruby:         ruby 2.7.5p203 (2021-11-24 revision f69aeb8314) [x86_64-linux]
 GitLab:       14.6.0 (3bc07a0be9c) FOSS
 GitLab Shell: 13.22.1
 PostgreSQL:   12.7
--------------------------------------------------------------------------------
Loading production environment (Rails 6.1.4.1)
irb(main):001:0>  ApplicationSetting.current.reset_runners_registration_token!
Traceback (most recent call last):
        9: from (irb):1
        8: from app/models/concerns/token_authenticatable.rb:53:in `block in add_authentication_token_field'
        7: from app/models/concerns/token_authenticatable_strategies/base.rb:44:in `reset_token!'
        6: from lib/gitlab/database/load_balancing/connection_proxy.rb:77:in `transaction'
        5: from lib/gitlab/database/load_balancing/connection_proxy.rb:125:in `write_using_load_balancer'
        4: from lib/gitlab/database/load_balancing/load_balancer.rb:110:in `read_write'
        3: from lib/gitlab/database/load_balancing/load_balancer.rb:172:in `retry_with_backoff'
        2: from lib/gitlab/database/load_balancing/load_balancer.rb:112:in `block in read_write'
        1: from lib/gitlab/database/load_balancing/connection_proxy.rb:126:in `block in write_using_load_balancer'
ActiveRecord::RecordInvalid (Validation failed: You need to set terms to be enforced)

Here is my gitlab check:

[root@gitlab ~]# gitlab-rake gitlab:check SANITIZE=true
Checking GitLab subtasks ...

Checking GitLab Shell ...

GitLab Shell: ... GitLab Shell version >= 13.22.1 ? ... OK (13.22.1)
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 (cluster/worker) ... 1/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? ... skipped (no tmp uploads folder yet)
Systemd unit files or init script exist? ... skipped (omnibus-gitlab has neither init script nor systemd units)
Systemd unit files or init script up-to-date? ... skipped (omnibus-gitlab has neither init script nor systemd units)
Projects have namespace: ... 
2/1 ... yes
5/2 ... yes
15/5 ... yes
5/6 ... yes
3/7 ... yes
5/8 ... yes
5/10 ... yes
5/11 ... yes
3/12 ... yes
5/13 ... yes
3/14 ... yes
5/15 ... yes
4/16 ... yes
15/17 ... yes
5/18 ... yes
5/19 ... yes
Redis version >= 5.0.0? ... yes
Ruby version >= 2.7.2 ? ... yes (2.7.5)
Git version >= 2.33.0 ? ... yes (2.33.1)
Git user has default SSH configuration? ... yes
Active users: ... 13
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