GitLab Documentation

Database Debugging and Troubleshooting

This section is to help give some copy-pasta you can use as a reference when you run into some head-banging database problems.

An easy first step is to search for your error in Slack or google "GitLab ".


Available RAILS_ENV

Nuke everything and start over

If you just want to delete everything and start over with an empty DB (~1 minute):

If you just want to delete everything and start over with dummy data (~40 minutes). This also does db:reset and runs DB-specific migrations:

If your test DB is giving you problems, it is safe to nuke it because it doesn't contain important data:

Migration wrangling

Manually access the database

Access the database via one of these commands (they all get you to the same place)

gdk psql -d gitlabhq_development
bundle exec rails dbconsole RAILS_ENV=development
bundle exec rails db RAILS_ENV=development