Error when running sudo gitlab-rake gitlab:setup
I was trying to seed postgres DB with my gitlab installation and I ran
sudo gitlab-rake gitlab:setup, it throws me following error:
PG::ObjectInUse: ERROR: database "gitlabhq_production" is being accessed by other users
DETAIL: There are 3 other sessions using the database.
: DROP DATABASE IF EXISTS "gitlabhq_production"
Couldn't drop database 'gitlabhq_production'
rake aborted!
ActiveRecord::StatementInvalid: PG::ObjectInUse: ERROR: database "gitlabhq_production" is being accessed by other users
DETAIL: There are 3 other sessions using the database.
: DROP DATABASE IF EXISTS "gitlabhq_production"
/opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/setup.rake:28:in `setup_db'
/opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/setup.rake:5:in `block (2 levels) in <top (required)>'
/opt/gitlab/embedded/bin/bundle:23:in `load'
/opt/gitlab/embedded/bin/bundle:23:in `<main>'
Caused by:
PG::ObjectInUse: ERROR: database "gitlabhq_production" is being accessed by other users
DETAIL: There are 3 other sessions using the database.
/opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/setup.rake:28:in `setup_db'
/opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/setup.rake:5:in `block (2 levels) in <top (required)>'
/opt/gitlab/embedded/bin/bundle:23:in `load'
/opt/gitlab/embedded/bin/bundle:23:in `<main>'
Tasks: TOP => db:drop:_unsafe
(See full trace by running task with --trace)
I did see the following error: https://gitlab.com/gitlab-org/gitlab-ce/issues/42484 where it says installation still works, however for me I could not get my server running.
Any suggestions on how to solve it?
Edited by Abhimanyu Narwal