Error Unable to obtain connection from database for user postgres SQL State : 08001
Vadym11
Posts: 2 New member
in PostgreSQL
I'm testing PostgreSQL with Flyway ( from docker-compose.yml ) and faced issue with connections on github actions, workflow fails
ERROR: Unable to obtain connection from database (jdbc:postgresql://db/a_site_to_order_stuff?sslmode=require) for user 'postgres': The connection attempt failed.
db - is the name of postgres service.
I also tried to connect my containers IP
docker inspect -f '{{range .NetworkSettings.Networks}}{{.IPAddress}}{{end}}' container_name
Did not help me, same issue
Answers
I added to my workflow file:
FLYWAY_URL=jdbc:postgresql://db:5432/test -e FLYWAY_USER=postgres -e FLYWAY_PASSWORD=postgres flyway migrate
Successfully run my workflow