3liz/lizmap-docker-compose

PostgreSQL not connecting on default settings

Toylerrr opened this issue · 6 comments

I am getting this error:

lizmap-docker-compose-lizmap-1   | Updating configuration
lizmap-docker-compose-lizmap-1   | Checking for lizmap configuration files in /srv/etc/lizmap                                                              config.d
lizmap-docker-compose-lizmap-1   | * Loading lizmap configuration: /srv/etc/lizmapconfig.d/li                                                              zmap-url.ini.php
lizmap-docker-compose-lizmap-1   | Checking for lizmap configuration files in /srv/etc/localc                                                              onfig.d
lizmap-docker-compose-lizmap-1   | * Loading lizmap configuration: /srv/etc/localconfig.d/tes                                                              t.ini.php
lizmap-docker-compose-lizmap-1   | Checking for lizmap configuration files in /srv/etc/profil                                                              es.d
lizmap-docker-compose-lizmap-1   | * Loading lizmap configuration: /srv/etc/profiles.d/lizmap                                                              _local.ini.php
lizmap-docker-compose-lizmap-1   | * Loading lizmap configuration: /srv/etc/profiles.d/test.i                                                              ni.php
lizmap-docker-compose-lizmap-1   | trying to connect to the Postgresql database lizmap at db.                                                              lizmap with the profile default...
lizmap-docker-compose-lizmap-1   |   Cannot connect yet, wait a bit before retrying...
lizmap-docker-compose-lizmap-1   | PHP Warning:  pg_connect(): Unable to connect to PostgreSQ                                                              L server: timeout expired in /bin/update-config.php on line 87
lizmap-docker-compose-lizmap-1   |   Retry...
lizmap-docker-compose-lizmap-1   |   Cannot connect yet, wait a bit before retrying...

I haven't changed any env variables I have only run the linux commands under the README md.

Does not looks like an error: it's just telling you that it's waiting for the database to be ready....

It goes on for quite a while, I left the rest out for brevity. When I tried it on WSL it worked almost instantly but on a ubuntu VM it cant connect to postgresql.

Logs
lizmap-docker-compose-lizmap-1   |   Cannot connect yet, wait a bit before retry                                                                                                             ing...
lizmap-docker-compose-lizmap-1   | PHP Warning:  pg_connect(): Unable to connect                                                                                                              to PostgreSQL server: timeout expired in /bin/update-config.php on line 87
lizmap-docker-compose-lizmap-1   |   Retry...
lizmap-docker-compose-lizmap-1   | PHP Warning:  pg_connect(): Unable to connect                                                                                                              to PostgreSQL server: timeout expired in /bin/update-config.php on line 87
lizmap-docker-compose-lizmap-1   |   Cannot connect yet, wait a bit before retry                                                                                                             ing...
lizmap-docker-compose-lizmap-1   |   Retry...
lizmap-docker-compose-lizmap-1   | PHP Warning:  pg_connect(): Unable to connect                                                                                                              to PostgreSQL server: timeout expired in /bin/update-config.php on line 87
lizmap-docker-compose-lizmap-1   |   Cannot connect yet, wait a bit before retry                                                                                                             ing...
lizmap-docker-compose-lizmap-1   |   Retry...
lizmap-docker-compose-lizmap-1   | PHP Warning:  pg_connect(): Unable to connect to PostgreSQL server: timeout expired in /bin/update-con                                                    fig.php on line 87
lizmap-docker-compose-lizmap-1   |   Cannot connect yet, wait a bit before retrying...
lizmap-docker-compose-lizmap-1   |   Retry...
lizmap-docker-compose-lizmap-1   |   Cannot connect yet, wait a bit before retrying...
lizmap-docker-compose-lizmap-1   | PHP Warning:  pg_connect(): Unable to connect to PostgreSQL server: timeout expired in /bin/update-config.php on line 87
lizmap-docker-compose-lizmap-1   |   Retry...
lizmap-docker-compose-lizmap-1   | PHP Warning:  pg_connect(): Unable to connect to PostgreSQL server: timeout expired in /bin/update-config.php on line 87
lizmap-docker-compose-lizmap-1   |   Cannot connect yet, wait a bit before retrying...
lizmap-docker-compose-lizmap-1   |   Retry...
lizmap-docker-compose-lizmap-1   |   Cannot connect yet, wait a bit before retrying...
lizmap-docker-compose-lizmap-1   | PHP Warning:  pg_connect(): Unable to connect to PostgreSQL server: timeout expired in /bin/update-config.php on line 87
lizmap-docker-compose-lizmap-1   |   Retry...
lizmap-docker-compose-lizmap-1   | PHP Warning:  pg_connect(): Unable to connect to PostgreSQL server: timeout expired in /bin/update-config.php on line 87
lizmap-docker-compose-lizmap-1   |   Cannot connect yet, wait a bit before retrying...
lizmap-docker-compose-lizmap-1   |   Retry...
lizmap-docker-compose-lizmap-1   | PHP Warning:  pg_connect(): Unable to connect to PostgreSQL server: timeout expired in /bin/update-config.php on line 87
lizmap-docker-compose-lizmap-1   |   Cannot connect yet, wait a bit before retrying...
lizmap-docker-compose-lizmap-1   |   Retry...
lizmap-docker-compose-lizmap-1   |   Cannot connect yet, wait a bit before retrying...
lizmap-docker-compose-lizmap-1   | PHP Warning:  pg_connect(): Unable to connect to PostgreSQL server: timeout expired in /bin/update-config.php on line 87
lizmap-docker-compose-lizmap-1   |   Retry...
lizmap-docker-compose-lizmap-1   | Error: cannot connect to the Postgresql database.
lizmap-docker-compose-lizmap-1   | Lizmap cannot starts.
lizmap-docker-compose-lizmap-1 exited with code 1
lizmap-docker-compose-lizmap-1   | PHP Warning:  pg_connect(): Unable to connect to PostgreSQL server: timeout expired in /bin/update-config.php on line 87
lizmap-docker-compose-lizmap-1   |   Cannot connect yet, wait a bit before retrying...
lizmap-docker-compose-lizmap-1   |   Retry...
lizmap-docker-compose-lizmap-1   | PHP Warning:  pg_connect(): Unable to connect to PostgreSQL server: timeout expired in /bin/update-config.php on line 87
lizmap-docker-compose-lizmap-1   |   Cannot connect yet, wait a bit before retrying...
lizmap-docker-compose-lizmap-1   |   Retry...
lizmap-docker-compose-lizmap-1   |   Cannot connect yet, wait a bit before retrying...
lizmap-docker-compose-lizmap-1   | PHP Warning:  pg_connect(): Unable to connect to PostgreSQL server: timeout expired in /bin/update-config.php on line 87
lizmap-docker-compose-lizmap-1   |   Retry...
lizmap-docker-compose-lizmap-1   |   Cannot connect yet, wait a bit before retrying...
lizmap-docker-compose-lizmap-1   | PHP Warning:  pg_connect(): Unable to connect to PostgreSQL server: timeout expired in /bin/update-config.php on line 87
lizmap-docker-compose-lizmap-1   |   Retry...
lizmap-docker-compose-lizmap-1   |   Cannot connect yet, wait a bit before retrying...
lizmap-docker-compose-lizmap-1   | PHP Warning:  pg_connect(): Unable to connect to PostgreSQL server: timeout expired in /bin/update-config.php on line 87
lizmap-docker-compose-lizmap-1   |   Retry...
lizmap-docker-compose-lizmap-1   | PHP Warning:  pg_connect(): Unable to connect to PostgreSQL server: timeout expired in /bin/update-config.php on line 87
lizmap-docker-compose-lizmap-1   |   Cannot connect yet, wait a bit before retrying...
lizmap-docker-compose-lizmap-1   |   Retry...
lizmap-docker-compose-lizmap-1   |   Cannot connect yet, wait a bit before retrying...
lizmap-docker-compose-lizmap-1   | PHP Warning:  pg_connect(): Unable to connect to PostgreSQL server: timeout expired in /bin/update-config.php on line 87
lizmap-docker-compose-lizmap-1   |   Retry...
lizmap-docker-compose-lizmap-1   | PHP Warning:  pg_connect(): Unable to connect to PostgreSQL server: timeout expired in /bin/update-config.php on line 87
lizmap-docker-compose-lizmap-1   |   Cannot connect yet, wait a bit before retrying...
lizmap-docker-compose-lizmap-1   |   Retry...
lizmap-docker-compose-lizmap-1   | PHP Warning:  pg_connect(): Unable to connect to PostgreSQL server: timeout expired in /bin/update-config.php on line 87
lizmap-docker-compose-lizmap-1   |   Cannot connect yet, wait a bit before retrying...
lizmap-docker-compose-lizmap-1   |   Retry...
lizmap-docker-compose-lizmap-1   | PHP Warning:  pg_connect(): Unable to connect to PostgreSQL server: timeout expired in /bin/update-config.php on line 87
lizmap-docker-compose-lizmap-1   |   Cannot connect yet, wait a bit before retrying...
lizmap-docker-compose-lizmap-1   |   Retry...
lizmap-docker-compose-lizmap-1   | Error: cannot connect to the Postgresql database.
lizmap-docker-compose-lizmap-1   | Lizmap cannot starts.
lizmap-docker-compose-lizmap-1 exited with code 1
lizmap-docker-compose-lizmap-1   |   Cannot connect yet, wait a bit before retrying...
lizmap-docker-compose-lizmap-1   | PHP Warning:  pg_connect(): Unable to connect to PostgreSQL server: timeout expired in /bin/update-config.php on line 87
lizmap-docker-compose-lizmap-1   |   Retry...
lizmap-docker-compose-lizmap-1   | PHP Warning:  pg_connect(): Unable to connect to PostgreSQL server: timeout expired in /bin/update-config.php on line 87
lizmap-docker-compose-lizmap-1   |   Cannot connect yet, wait a bit before retrying...
lizmap-docker-compose-lizmap-1   |   Retry...
lizmap-docker-compose-lizmap-1   | PHP Warning:  pg_connect(): Unable to connect to PostgreSQL server: timeout expired in /bin/update-config.php on line 87
lizmap-docker-compose-lizmap-1   |   Cannot connect yet, wait a bit before retrying...
lizmap-docker-compose-lizmap-1   |   Retry...
lizmap-docker-compose-lizmap-1   | PHP Warning:  pg_connect(): Unable to connect to PostgreSQL server: timeout expired in /bin/update-config.php on line 87
lizmap-docker-compose-lizmap-1   |   Cannot connect yet, wait a bit before retrying...
lizmap-docker-compose-lizmap-1   |   Retry...
lizmap-docker-compose-lizmap-1   |   Cannot connect yet, wait a bit before retrying...
lizmap-docker-compose-lizmap-1   | PHP Warning:  pg_connect(): Unable to connect to PostgreSQL server: timeout expired in /bin/update-config.php on line 87
lizmap-docker-compose-lizmap-1   |   Retry...
lizmap-docker-compose-lizmap-1   | PHP Warning:  pg_connect(): Unable to connect to PostgreSQL server: timeout expired in /bin/update-config.php on line 87
lizmap-docker-compose-lizmap-1   |   Cannot connect yet, wait a bit before retrying...
lizmap-docker-compose-lizmap-1   |   Retry...
lizmap-docker-compose-lizmap-1   | PHP Warning:  pg_connect(): Unable to connect to PostgreSQL server: timeout expired in /bin/update-config.php on line 87
lizmap-docker-compose-lizmap-1   |   Cannot connect yet, wait a bit before retrying...
lizmap-docker-compose-lizmap-1   |   Retry...
lizmap-docker-compose-lizmap-1   | PHP Warning:  pg_connect(): Unable to connect to PostgreSQL server: timeout expired in /bin/update-config.php on line 87
lizmap-docker-compose-lizmap-1   |   Cannot connect yet, wait a bit before retrying...
lizmap-docker-compose-lizmap-1   |   Retry...
lizmap-docker-compose-lizmap-1   | PHP Warning:  pg_connect(): Unable to connect to PostgreSQL server: timeout expired in /bin/update-config.php on line 87
lizmap-docker-compose-lizmap-1   |   Cannot connect yet, wait a bit before retrying...
lizmap-docker-compose-lizmap-1   |   Retry...
lizmap-docker-compose-lizmap-1   | PHP Warning:  pg_connect(): Unable to connect to PostgreSQL server: timeout expired in /bin/update-config.php on line 87
lizmap-docker-compose-lizmap-1   |   Cannot connect yet, wait a bit before retrying...
lizmap-docker-compose-lizmap-1   |   Retry...
lizmap-docker-compose-lizmap-1   | Error: cannot connect to the Postgresql database.
lizmap-docker-compose-lizmap-1   | Lizmap cannot starts.
lizmap-docker-compose-lizmap-1 exited with code 1
lizmap-docker-compose-lizmap-1   |   Cannot connect yet, wait a bit before retrying...
lizmap-docker-compose-lizmap-1   | PHP Warning:  pg_connect(): Unable to connect to PostgreSQL server: timeout expired in /bin/update-config.php on line 87
lizmap-docker-compose-lizmap-1   |   Retry...
lizmap-docker-compose-lizmap-1   | PHP Warning:  pg_connect(): Unable to connect to PostgreSQL server: timeout expired in /bin/update-config.php on line 87
lizmap-docker-compose-lizmap-1   |   Cannot connect yet, wait a bit before retrying...
lizmap-docker-compose-lizmap-1   |   Retry...
lizmap-docker-compose-lizmap-1   |   Cannot connect yet, wait a bit before retrying...
lizmap-docker-compose-lizmap-1   | PHP Warning:  pg_connect(): Unable to connect to PostgreSQL server: timeout expired in /bin/update-config.php on line 87
lizmap-docker-compose-lizmap-1   |   Retry...
lizmap-docker-compose-lizmap-1   | PHP Warning:  pg_connect(): Unable to connect to PostgreSQL server: timeout expired in /bin/update-config.php on line 87
lizmap-docker-compose-lizmap-1   |   Cannot connect yet, wait a bit before retrying...
lizmap-docker-compose-lizmap-1   |   Retry...
lizmap-docker-compose-lizmap-1   | PHP Warning:  pg_connect(): Unable to connect to PostgreSQL server: timeout expired in /bin/update-config.php on line 87
lizmap-docker-compose-lizmap-1   |   Cannot connect yet, wait a bit before retrying...
lizmap-docker-compose-lizmap-1   |   Retry...
lizmap-docker-compose-lizmap-1   | PHP Warning:  pg_connect(): Unable to connect to PostgreSQL server: timeout expired in /bin/update-config.php on line 87
lizmap-docker-compose-lizmap-1   |   Cannot connect yet, wait a bit before retrying...
lizmap-docker-compose-lizmap-1   |   Retry...
lizmap-docker-compose-lizmap-1   |   Cannot connect yet, wait a bit before retrying...
lizmap-docker-compose-lizmap-1   | PHP Warning:  pg_connect(): Unable to connect to PostgreSQL server: timeout expired in /bin/update-config.php on line 87
lizmap-docker-compose-lizmap-1   |   Retry...

When I tried it on WSL it worked almost instantly but on a ubuntu VM it cant connect to postgresql.

This seems to be a Docker related problem running on your VM - Docker is known to run well on WSL (which run itlself on a VM) - but badly on Mac.

Try to log the posgresql container to get its status.
You may try also a minimal compose stack to check network behavior between containers (Note that Docker require iptables and networking may not work if it is not installed on your VM).

Try also docker ps -a to see you if you don't have another PG container.

Try also docker ps -a to see you if you don't have another PG container.

That should be a problem only if the lizmap postgres container try to open the same public port.

Switched to Debian and it works now. must be a problem with Docker/Ubuntu networks