gpt4 book ai didi

postgresql - Gitlab 500 错误:PG::ConnectionBad

转载 作者:行者123 更新时间:2023-11-29 12:36:16 28 4
gpt4 key购买 nike

我正在运行 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

我没有更改任何主机或任何东西。帮助。

最佳答案

感谢@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

而且有效!

关于postgresql - Gitlab 500 错误:PG::ConnectionBad,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/40005023/

28 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com