ikatson / docker-reviewboard

Dockerized reviewboard
MIT License
112 stars 84 forks source link

psql: could not connect to server: Connection refused #50

Closed frakman1 closed 4 years ago

frakman1 commented 4 years ago

I had to add

- POSTGRES_HOST_AUTH_METHOD=trust

to the postgres environment block of docker-compose.yml because it would fail for a different reason (password not set error). Now I get this error and have no idea how to proceed.

root@Tower:/mnt/user/appdata/docker-reviewboard# docker-compose up
Creating network "docker-reviewboard_default" with the default driver
Creating docker-reviewboard_memcached_1 ... done
Creating docker-reviewboard_postgres_1  ... done
Creating docker-reviewboard_reviewboard_1 ... done
Attaching to docker-reviewboard_memcached_1, docker-reviewboard_postgres_1, docker-reviewboard_reviewboard_1
reviewboard_1  | Waiting for Postgres readiness...
postgres_1     | ********************************************************************************
postgres_1     | WARNING: POSTGRES_HOST_AUTH_METHOD has been set to "trust". This will allow
postgres_1     |          anyone with access to the Postgres port to access your database without
postgres_1     |          a password, even if POSTGRES_PASSWORD is set. See PostgreSQL
postgres_1     |          documentation about "trust":
postgres_1     |          https://www.postgresql.org/docs/current/auth-trust.html
postgres_1     |          In Docker's default configuration, this is effectively any other
postgres_1     |          container on the same system.
postgres_1     | 
postgres_1     |          It is not recommended to use POSTGRES_HOST_AUTH_METHOD=trust. Replace
postgres_1     |          it with "-e POSTGRES_PASSWORD=password" instead to set a password in
postgres_1     |          "docker run".
postgres_1     | ********************************************************************************
postgres_1     | The files belonging to this database system will be owned by user "postgres".
postgres_1     | This user must also own the server process.
postgres_1     | 
postgres_1     | The database cluster will be initialized with locale "en_US.utf8".
postgres_1     | The default database encoding has accordingly been set to "UTF8".
postgres_1     | The default text search configuration will be set to "english".
postgres_1     | 
postgres_1     | Data page checksums are disabled.
postgres_1     | 
postgres_1     | fixing permissions on existing directory /var/lib/postgresql/data ... ok
postgres_1     | creating subdirectories ... ok
postgres_1     | selecting dynamic shared memory implementation ... posix
postgres_1     | selecting default max_connections ... 100
postgres_1     | selecting default shared_buffers ... 128MB
postgres_1     | selecting default time zone ... UTC
postgres_1     | creating configuration files ... ok
postgres_1     | running bootstrap script ... ok
postgres_1     | performing post-bootstrap initialization ... sh: locale: not found
postgres_1     | 2020-05-04 04:14:22.672 UTC [30] WARNING:  no usable system locales were found
reviewboard_1  | psql: could not connect to server: Connection refused
reviewboard_1  |        Is the server running on host "postgres" (172.21.0.3) and accepting
reviewboard_1  |        TCP/IP connections on port 5432?
reviewboard_1  | Postgres is unavailable - sleeping
postgres_1     | ok

Environment:

root@Tower:/mnt/user/appdata/docker-reviewboard# uname -a
Linux Tower 4.19.107-Unraid #1 SMP Thu Mar 5 13:55:57 PST 2020 x86_64 Intel(R) Xeon(R) CPU E5-2630 v2 @ 2.60GHz GenuineIntel GNU/Linux

root@Tower:/mnt/user/appdata/docker-reviewboard# cat /etc/os-release 
NAME=Slackware
VERSION="14.2"
ID=slackware
VERSION_ID=14.2
PRETTY_NAME="Slackware 14.2 x86_64 (post 14.2 -current)"
ANSI_COLOR="0;34"
CPE_NAME="cpe:/o:slackware:slackware_linux:14.2"
HOME_URL="http://slackware.com/"
SUPPORT_URL="http://www.linuxquestions.org/questions/slackware-14/"
BUG_REPORT_URL="http://www.linuxquestions.org/questions/slackware-14/"
VERSION_CODENAME=current

root@Tower:/mnt/user/appdata/docker-reviewboard# docker-compose --version
docker-compose version 1.26.0-rc4, build d279b7a8
ikatson commented 4 years ago

Should be fixed with https://github.com/ikatson/docker-reviewboard/commit/216770a8beffcf05b2b71a79f63f01d8a0482481

frakman1 commented 4 years ago

That worked. Thank you!