What are the challenges you face when working across database platforms? Take the survey
Options

Error Unable to obtain connection from database for user postgres SQL State : 08001

Vadym11Vadym11 Posts: 2 New member
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
Tagged:

Answers

  • Options
    Vadym11Vadym11 Posts: 2 New member

    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


  • Options
    jack1111jack1111 Posts: 4 New member
    The error message "Unable to obtain connection from database for user postgres SQL State : 08001" typically indicates a problem with establishing a connection to the PostgreSQL database. It could be due to incorrect credentials, network issues, or the database server being unavailable. Troubleshooting should involve verifying connection parameters, network settings, and ensuring the PostgreSQL service is running and accessible.

  • Options
    jack1111jack1111 Posts: 4 New member
    thank you so much.
  • Options
    jack1111jack1111 Posts: 4 New member
    The error message "Unable to obtain connection from database for user postgres SQL State: 08001" indicates a connection issue with the database. SQL State 08001 typically points to a network-related problem or incorrect connection parameters (e.g., hostname, port, username, or password). Verify the database server's availability and ensure that the connection details are correct.

  • Options
    Shari23Shari23 Posts: 1 New member
    It`s interesting!

Leave a Comment

BoldItalicStrikethroughOrdered listUnordered list
Emoji
Image
Align leftAlign centerAlign rightToggle HTML viewToggle full pageToggle lights
Drop image/file