Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
urupaveko opened this issue May 10, 2024 · 3 comments

Comments

@urupaveko
Copy link

Which version and edition of Flyway are you using?

image: "flyway/flyway:9.22-alpine"
image: postgres:15.4-alpine

If this is not the latest version, can you reproduce the issue with the latest one as well? (Many bugs are fixed in newer releases and upgrading will often resolve the issue)

Same issue with flyway 10.12.0

Which client are you using? (Command-line, Java API, Maven plugin, Gradle plugin)

Github actions

Which database are you using? (Type & version)

image: postgres:15.4-alpine

Which operating system are you using?

Windows

What did you do? (Please include the content causing the issue, any relevant configuration settings, the SQL statement(s) that failed (if any), and the command you ran)

Tired to connect by servie name, container_name, localhost, container IP

What did you expect to see?

I expect to successful workflow in github actions.

What did you see instead?

Error connections with my DB
flyway_10_12_0
flyway_postgres

@Barry-RG
Copy link
Contributor

Thank you for your issue. I unfortunately cannot recreate the problem you are having. The connection attempt failed would imply that the database may not be ready when Flyway has attempted to connect.
I have recreated your docker compose file, and have been able to connect to the database and run a migration within the docker compose network. However, the command you are using is truncated on the screen shot provided so I am assuming no more configuration beyond what I can see and a migrate command.

Could you please provide the full command as well as any docker compose logs of the initialization of both Flyway and the Database?
Additionally, could you please enable debug mode for Flyway. This can be done by adding -X to your command. This should display information in regards to the connectivity, as well as the configuration to check if nothing else has been changed via environment variables within Github Actions.

@urupaveko
Copy link
Author

urupaveko commented May 10, 2024

@Barry-RG Thanks for your feedback. I will provide Postgre logs, flyway logs and also workflow file. After ConnectRetries there is migrate command only
flyway_logs
postgres_logs
workflow_file

@vadymurupa
Copy link

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 workflow

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

3 participants