Skip to content

Add docs for troubleshooting connection problems due to two DB connections

I would suggest adding links to above in a page like https://docs.gitlab.com/ee/administration/postgresql/multiple_databases.html

Steps used to test

  1. If you don't have a project already, create a GCP project with https://about.gitlab.com/handbook/infrastructure-standards/realms/sandbox/#how-to-get-started
  2. Go to your GCP project in console.cloud.google.com. Note it may take 5-10 for your new GCP project to appear in the projects list
  3. Create a new VM instance. GitLab recommends 4GB memory and 2 CPU, so I chose Machine type: n2-standard-4. I recommend having Ubuntu 22.04 (Ubuntu 22.10 is not supported yet). I changed the storage to 20 GB. Enable HTTP/HTTPS as well.
  4. Download, and install gcloud locally. Select the SSH dropdown for the VM instance you want to connect to. Select the gcloud SSH option to get the command line to connect via SSH using the gcloud too. https://cloud.google.com/sdk/docs/install.
  5. Follow the steps here to install GitLab: https://about.gitlab.com/install/#ubuntu
  6. Change the database max connections, and enable the ci connection: sudo vim /etc/gitlab/gitlab.rb
postgresql['max_connections'] = 8

gitlab_rails['databases']['ci']['enable'] = true
gitlab_rails['databases']['ci']['db_database'] = 'gitlabhq_production'
gitlab_rails['databases']['ci']['database_tasks'] = false
sudo gitlab-ctl reconfigure
sudo gitlab-ctl restart 

changing max_connections requires restarting the database This parameter can only be set at server start

Visit the Gitlab instance on http://<PUBLIC_IP_INSTANCE>.nip.io. Refresh the page a few times and you should get the 500 error

Edited by Omar Qunsul