当前位置: 代码迷 >> 综合 >> GitLab 报错 ConnectionBad: could not connect to server: No such...
  详细解决方案

GitLab 报错 ConnectionBad: could not connect to server: No such...

热度:38   发布时间:2023-11-19 23:38:47.0

昨天安装GitLab之后,汉化
执行 gitlab-ctl reconfigure 报错
PG::ConnectionBad: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket “/var/opt/gitlab/postgresql/.s.PGSQL.5432”?
反复出现

报错信息如下

PG::ConnectionBad: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/var/opt/gitlab/postgresql/.s.PGSQL.5432"?
/opt/gitlab/embedded/service/gitlab-rails/lib/tasks/gitlab/db.rake:49:in `block (3 levels) in <top (required)>'
/opt/gitlab/embedded/bin/bundle:23:in `load'
/opt/gitlab/embedded/bin/bundle:23:in `<main>'
Tasks: TOP => gitlab:db:configure
(See full trace by running task with --trace)

解决方法:

1、按住CTRL+C强制结束
2、先停止 gitlab ,命令: sudo gitlab-ctl stop
3、执行命令: sudo chmod 755 /var/opt/gitlab/postgresql
4、执行命令:sudo systemctl restart gitlab-runsvdir
5、再次配置:sudo gitlab-ctl reconfigure
6、启动即可:sudo gitlab-ctl restart


  相关解决方案