[CLOSED] PG::ConnectionBad: could not connect to server: Connection refused

Hi you all,
I’m trying to rise up a brand new installation on a new vm of gitlab-ce but I continuously get stuck with those errors, essentially pointing to:

web_1 | Recipe: gitlab::database_migrations
web_1 | * ruby_block[check remote PG version] action nothing (skipped due to action :nothing)
web_1 | * rails_migration[gitlab-rails] action run[2023-08-07T14:47:06+00:00] WARN: gitlab-rails does not have a log_group or default logdir mode defined. Setting to 0700.
web_1 |
web_1 | * bash_hide_env[migrate gitlab-rails database] action run
web_1 | [execute] rake aborted!
web_1 | ActiveRecord::ConnectionNotEstablished: could not connect to server: Connection refused
web_1 | Is the server running locally and accepting
web_1 | connections on Unix domain socket "/var/opt/gitlab/postgresql/.s.PGSQL.5

the docker-compose.yml is as follow:

version: ‘3.6’
services:
web:
image: ‘gitlab/gitlab-ee:latest’
restart: always
hostname: ‘gitlab.example.com
environment:
GITLAB_OMNIBUS_CONFIG: |
external_url ‘http://gitlab.example.com:8929
ports:
- ‘8929:8929’
- ‘2224:22’
volumes:
- ‘$GITLAB_HOME/config:/etc/gitlab’
- ‘$GITLAB_HOME/logs:/var/log/gitlab’
- ‘$GITLAB_HOME/data:/var/opt/gitlab’
shm_size: ‘256m’
~
and the have no .env ( by now ).

Any help?

This value looks too low, and might explain why the PostgreSQL server does not start. Try removing the limit, or increasing to 2GB memory at least.

Thanks dnsmichi,
I set it to 2G and, after that, disabled the shm var but the problem is still there.
I tried it on another vm and it works fine but when I start it on the former it miserably crashes.
I noticed that alse redis cannot connect.

What are the specs of the container host system, i.e. how much RAM/CPU is available, and which OS and version are being used? If RHEL or a variant, security policies like SELinux might also prevent access to sockets, etc.

1 Like

Thanks for your reply.
unfortunately I didn’t understood why but I simply created another dir and executed the docker-compose right there.
It worked but it sounds really bad.