"Still waiting for db to be ready... Or maybe the db is not reachable."
See original GitHub issueAPI Platform version(s) affected: 2.5.7
Description
On a fresh install of API Platform package (.tar.gz), after running docker-compose up, the PHP container is trying to run the command bin/console doctrine:query:sql "SELECT 1" to see if the DB container is up and running.
The problem is that bin/console file doesn’t have the executable flag in the container, so PHP container can’t see it’s connected to DB and exited with an error.
How to reproduce
- Download the last version in .tar.gz
- Uncompress the directory to a location
- Configure the DB password in docker-compose.yaml (or not, but I did it)
- Start docker-compose (pull > up)
- Look at the logs to see the message
Still waiting for db to be ready... Or maybe the db is not reachable. x attempts left
Possible Solution
Applying +x flag to bin/console
Issue Analytics
- State:
- Created 3 years ago
- Comments:16 (5 by maintainers)
Top Results From Across the Web
Still waiting for db to be ready... Or maybe the db is not ...
No service depends_on the database, so I don't see why it would fail with that error message. But anyways, in the envvar DATABASE_URL...
Read more >Docker Compose Wait for MySQL Container to be Ready
This article provides an example for making docker-compose wait for MySQL container to be ready before starting a dependent docker application container.
Read more >Wait until Your Dockerized Database Is Ready before ...
In this video, we'll go over using a script to make sure your database is ready before running automated tests. Perfect for CI....
Read more >make:docker:database - SymfonyCasts
Hello make:docker:database. Ok, ready? To manage our Docker containers, we need to create a docker-compose.yaml file ...
Read more >Troubleshooting for Amazon RDS - AWS Documentation
Inbound rules – The access rules enforced by your local firewall and the IP addresses authorized to access your DB instance might not...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
For me this was cause by removing
apk add pdo_pgsql \in my api/DockerfileI copy some of another Dockerfile, and replace this by
pdo_mysql \I search a lot on the web and found nothing, hope it can helps someone
I started to but…
I mixed up two bugs reports for the same kind of problem. The other one was not related to api-platform but involved bin/console too.
So, here the problem is for the “Still waiting” because bin/console is not executable in some situations. It’s not because of a composer doing a cache:clear… I mixed up.
Back to this problem:
I tried different ways to install and run api-platform.
I did chmod +x on bin/console under WSL2, ran docker-compose up again and the problem was solved.
So, it can’t be fixed in the Dockerfile. It’s a Windows and/or WSL2 problem only.
The problem is because of Windows. Even with the .tar.gz file 😕