gitlab-rails dbconsole command returns 'primary' database not configured for 'production'

Viewed 1130

Our Gitlab is version 14.x and is running in a docker container.

I believe I have found the solution to a problem we are experiencing with Gitlab Community Edition. Solution is here >>> https://docs.gitlab.com/ee/raketasks/backup_restore.html#reset-runner-registration-tokens

However, I'm stuck at the first hurdle. Running gitlab-rails dbconsole causes a log stream output. And checking the detail it appears as though this line is outlining the culprit.

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

I have checked the correct database.yml file and can see the ONLY db environment is in fact the production one.

I have tried running gitlab-rails dbconsole -e production too. Same problem output.

Any guidance would be very much appreciated. Thanks.

2 Answers

Solution to this problem for me at lease was to run this command, as root.

gitlab-psql -d gitlabhq_production

Related