Gitlab upgrade to 14.4.1 - DB connection not working

Summary

I recently upgraded my onpremise Gitlab instance from 14.1.4 to 14.4.1 and the DB connection using gitlab-rails do not work anymore.

Steps to reproduce

Upgrade from 14.1.4 to 14.4.1 Try DB connection using gitlab-rails dbconsole

What is the current bug behavior?

Traceback (most recent call last): 11: from bin/rails:4:in <main>' 10: from bin/rails:4:in require' 9: from /opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/railties-6.1.4.1/lib/rails/commands.rb:18:in <top (required)>' 8: from /opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/railties-6.1.4.1/lib/rails/command.rb:48:in invoke' 7: from /opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/railties-6.1.4.1/lib/rails/command/base.rb:69:in perform' 6: from /opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/thor-1.1.0/lib/thor.rb:392:in dispatch' 5: from /opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/thor-1.1.0/lib/thor/invocation.rb:127:in invoke_command' 4: from /opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/thor-1.1.0/lib/thor/command.rb:27:in run' 3: from /opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/railties-6.1.4.1/lib/rails/commands/dbconsole/dbconsole_command.rb:181:in perform' 2: from /opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/railties-6.1.4.1/lib/rails/commands/dbconsole/dbconsole_command.rb:10:in start' 1: from /opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/railties-6.1.4.1/lib/rails/commands/dbconsole/dbconsole_command.rb:19:in start' /opt/gitlab/embedded/lib/ruby/gems/2.7.0/gems/railties-6.1.4.1/lib/rails/commands/dbconsole/dbconsole_command.rb:108:in db_config': 'primary' database is not configured for 'production'. Available configuration: #<ActiveRecord::DatabaseConfigurations:0x00007f9cef8d0138 @configurations=[#<ActiveRecord::DatabaseConfigurations::HashConfig:0x00007f9cef8cbea8 @env_name="production", @name="main", @configuration_hash={:adapter=>"postgresql", :encoding=>"unicode", :collation=>nil, :database=>"gitlabhq_production", :username=>"gitlab", :password=>nil, :host=>"/var/opt/gitlab/postgresql", :port=>5432, :socket=>nil, :sslmode=>nil, :sslcompression=>0, :sslrootcert=>nil, :sslca=>nil, :load_balancing=>{"hosts"=>[]}, :prepared_statements=>false, :statement_limit=>1000, :connect_timeout=>nil, :keepalives=>nil, :keepalives_idle=>nil, :keepalives_interval=>nil, :keepalives_count=>nil, :tcp_user_timeout=>nil, :application_name=>nil, :variables=>{"statement_timeout"=>nil}}>]> (ActiveRecord::AdapterNotSpecified)

What is the expected correct behavior?

PostgreSQL prompt. Command gitlab-psql -d gitlabhq_production works and it gives the DB prompt

Relevant logs