You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I created a new symfony (7.0.7) webapp, created an entity and wanted to run symfony console doctrine:database:create. Output: An exception occurred in the driver: SQLSTATE[08006] [7] connection to server at "127.0.0.1", port 5432 failed: Connection refused Is the server running on that host and accepting TCP/IP connections?
Apparently the port number is wrong here. As i understood the symfony command, it should detect the real port number of the postgres container and then call the doctrine:database:create command. But it seems this is not happening. Running 'symfony run printenv' does not print anything related to the database.
The database is running inside docker (status=unhealthy, but running 'pg_isready -U ${POSTGRES_USER:-app}' inside the container is running ok and no error messages in logs).
Docker 26.1.1 is installed in rootless mode on a debian 12 system.
Symfony cli version is 5.8.16.
The text was updated successfully, but these errors were encountered:
Kinda the same problem here, but with a MySQL Server.
I'm debugging this for a few days now, but coming to the conclusion, that the CLI is not detecting the Docker containers.
My System:
Symfony CLI version 5.8.15
Docker Desktop 4.29.0
Docker Compose version v2.26.1-desktop.1 (comes pre-packed with Docker Desktop)
Linux
Zorin OS 17.1 (Ubuntu-based)
I can connect to the database, but have to bind the port statically. Ideally you could just set "ports: [ 3306 ]" and the CLI would automatically pick up the port set by Docker, right?
Also the web profiler indicates, that Docker is not running:
Note, that in the latest version of Docker, the docker-compose command is deprecated and removed, only leaving docker compose (at least on my system). Could it be, that the Docker Compose API changed and the CLI is not able to detect the containers correctly?
Also: Docker Desktop sets the unix socket on unix:///home/user/.docker/desktop/docker.sock. Could this be a problem? Is there a way to manually configure the path to the socket? I couldn't find any documentation about that.
I created a new symfony (7.0.7) webapp, created an entity and wanted to run symfony console doctrine:database:create. Output:
An exception occurred in the driver: SQLSTATE[08006] [7] connection to server at "127.0.0.1", port 5432 failed: Connection refused Is the server running on that host and accepting TCP/IP connections?
Apparently the port number is wrong here. As i understood the symfony command, it should detect the real port number of the postgres container and then call the doctrine:database:create command. But it seems this is not happening. Running 'symfony run printenv' does not print anything related to the database.
The database is running inside docker (status=unhealthy, but running 'pg_isready -U ${POSTGRES_USER:-app}' inside the container is running ok and no error messages in logs).
Docker 26.1.1 is installed in rootless mode on a debian 12 system.
Symfony cli version is 5.8.16.
The text was updated successfully, but these errors were encountered: