Gitlab 500错误:PG :: ConnectionBad

时间:2016-10-12 17:41:30

标签: postgresql gitlab

我正在运行Gitlab-CE v8.11.3-ce.1

我的房子失去了力量,所以突然关闭了我的Gitlab服务器。我重新打开它,它给了我一个500错误。 当我sudo gitlab-ctl reconfigure时,我会在日志中找到它:

[execute] psql: could not connect to server: Connection refused
            Is the server running locally and accepting
            connections on Unix domain socket "/var/opt/gitlab/postgresql/.s.PGSQL.5432"?

这是gitlab.rb的数据库部分:

# gitlab_rails['db_adapter'] = "postgresql"
# gitlab_rails['db_encoding'] = "unicode"
# gitlab_rails['db_collation'] = nil
# gitlab_rails['db_database'] = "gitlabhq_production"
# gitlab_rails['db_pool'] = 10
# gitlab_rails['db_username'] = "gitlab"
# gitlab_rails['db_password'] = nil
# gitlab_rails['db_host'] = nil
# gitlab_rails['db_port'] = 5432
# gitlab_rails['db_socket'] = nil
# gitlab_rails['db_sslmode'] = nil
# gitlab_rails['db_sslrootcert'] = nil

我没有改变任何主人或任何东西。帮助

1 个答案:

答案 0 :(得分:2)

感谢@ twk3解决我的问题! https://gitlab.com/gitlab-org/omnibus-gitlab/issues/1637

解决方案:

sudo gitlab-ctl stop
sudo systemctl stop gitlab-runsvdir.service
ps aux | grep postgre (check if there are any postgres processes; shouldn't be)
sudo rm /var/opt/gitlab/postgresql/data/postmaster.pid
sudo systemctl start gitlab-runsvdir.service
sudo gitlab-ctl reconfigure

它有效!