Penpot-backend unable to connect to postgres

Fresh Ubuntu 22.04 install
Fresh Docker
Fresh config.env and docker-compose.yaml unmodified

ubuntu@penpot:~/penpot$ docker-compose ps
          Name                        Command               State                   Ports                
---------------------------------------------------------------------------------------------------------
penpot_penpot-backend_1    /bin/bash run.sh                 Exit 1                                       
penpot_penpot-exporter_1   /usr/local/nodejs/bin/node ...   Up                                           
penpot_penpot-frontend_1   /bin/bash /entrypoint.sh n ...   Up       0.0.0.0:9001->80/tcp,:::9001->80/tcp
penpot_penpot-postgres_1   docker-entrypoint.sh postgres    Up       5432/tcp                            
penpot_penpot-redis_1      docker-entrypoint.sh redis ...   Up       6379/tcp                            
ubuntu@penpot:~/penpot$ docker-compose up penpot-backend
penpot_penpot-postgres_1 is up-to-date
penpot_penpot-redis_1 is up-to-date
Starting penpot_penpot-backend_1 ... done
Attaching to penpot_penpot-backend_1
penpot-backend_1   | + exec /usr/lib/jvm/openjdk/bin/java -jar penpot.jar -m app.main
penpot-backend_1   | [2022-10-24 19:09:34.262] I app.metrics - action="initialize metrics"
penpot-backend_1   | [2022-10-24 19:09:34.299] I app.db - hint="initialize connection pool", name="main", uri="postgresql://penpot-postgres/penpot", read-only=false, with-credentials=true, min-size=0, max-size=60
penpot-backend_1   | Execution error (SQLTransientConnectionException) at com.zaxxer.hikari.pool.HikariPool/createTimeoutException (HikariPool.java:696).
penpot-backend_1   | main - Connection is not available, request timed out after 10002ms.
penpot-backend_1   | 
penpot-backend_1   | Full report at:
penpot-backend_1   | /tmp/clojure-120441958685947261.edn
penpot_penpot-backend_1 exited with code 1

It seems that you are using an older docker version, previous than v2. It should work, but we are not actively testing it.

Please change in your config.env this line

PENPOT_DATABASE_URI=postgresql://penpot-postgres/penpot

to this

PENPOT_DATABASE_URI=postgresql://penpot_postgres/penpot

and check if it works. If not, could you try to update to the latest docker version?

So sorry, but a reboot was all that was needed to make it work, there was something broken with the docker networking, I realized that a few minutes after my poste was hidden.

It’s working great now , thank you.

1 Like

Good, then! Glad it works now.