symfony-docker
symfony-docker copied to clipboard
Error when installing symfony doctrine
On the clean installation run
composer require symfony/orm-pack
docker compose up
the following error appears on CI workflow
"Could not connect to /var/run/php/php-fpm.sock\n"
Check: https://github.com/cosminsandu/symfony-docker/actions/runs/3060906399/jobs/4950397486
Ok I was able to reproduce the issue and fix it.
- First, change your
DATABASE_URLto match with your docker service (DATABASE_URL="postgresql://app:!ChangeMe!@database:5432/app?serverVersion=14&charset=utf8"). By default the recipes are configured to work with the SymfonyCLI binary. - And then, on my side, it was a problem with the
bin/consolefile that didn't have execution rights (chmod +x bin/console)
I hope this solves your issue
Thanks a lot,
I've updated the DATABASE_URL:
https://github.com/cosminsandu/symfony-docker/commit/5a1df42a5e98c6d2eb28ab5bafad860b83a1146b
And the CI run failed with the same error:
"Output": "Could not connect to /var/run/php/php-fpm.sock\n"
https://github.com/cosminsandu/symfony-docker/actions/runs/3081508809/jobs/4980130783
Try the second step:
And then, on my side, it was a problem with the bin/console file that didn't have execution rights (chmod +x bin/console)
Shouldn't this problem be fixed in Dockerfile? https://github.com/dunglas/symfony-docker/blob/main/Dockerfile
Actually this is done in Dockerfile line 112 https://github.com/dunglas/symfony-docker/blob/main/Dockerfile#L112
This could be the problem because in my case the right was not correct after the installation
I can't close this item since it is not resolved.
I have this problem with windows docker containers.
{ "level": "error", "ts": 1663659825.7993906, "logger": "http.log.error", "msg": "dialing backend: dial unix /var/run/php/php-fpm.sock: connect: no such file or directory", "request": { "remote_ip": "172.18.0.1", "remote_port": "43622", "proto": "HTTP/2.0", "method": "GET", "host": "localhost", "uri": "/zip", "headers": { "Sec-Fetch-Dest": [ "document" ], "Accept-Language": [ "en-US,en;q=0.9" ], "Accept": [ "text/html,application/xhtml+xml,application/xml;q=0.9,image/avif,image/webp,image/apng,/;q=0.8,application/signed-exchange;v=b3;q=0.9" ], "User-Agent": [ "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/105.0.0.0 Safari/537.36" ], "Sec-Fetch-Mode": [ "navigate" ], "Cache-Control": [ "max-age=0" ], "Sec-Ch-Ua-Mobile": [ "?0" ], "Sec-Ch-Ua-Platform": [ ""Windows"" ], "Sec-Fetch-Site": [ "none" ], "Sec-Fetch-User": [ "?1" ], "Sec-Ch-Ua": [ ""Google Chrome";v="105", "Not)A;Brand";v="8", "Chromium";v="105"" ], "Accept-Encoding": [ "gzip, deflate, br" ], "Cookie": [], "Upgrade-Insecure-Requests": [ "1" ] }, "tls": { "resumed": false, "version": 772, "cipher_suite": 4865, "proto": "h2", "server_name": "localhost" } }, "duration": 0.0081262, "status": 502, "err_id": "4f28xp1va", "err_trace": "reverseproxy.statusError (reverseproxy.go:1184)" }
I can't close this item since it is not resolved.
Because I see on your reproducer that you have only do the step one.
I had the same problem then i put the ports in my docker-compose file like this:
###> doctrine/doctrine-bundle ###
database:
image: postgres:${POSTGRES_VERSION:-14}-alpine
ports:
- "5433:5432"
environment:
POSTGRES_DB: ${POSTGRES_DB:-app}
# You should definitely change the password in production
POSTGRES_PASSWORD: ${POSTGRES_PASSWORD:-!ChangeMe!}
POSTGRES_USER: ${POSTGRES_USER:-app}
volumes:
- db-data:/var/lib/postgresql/data:rw
# You may use a bind-mounted host directory instead, so that it is harder to accidentally remove the volume and lose all your data!
# - ./docker/db/data:/var/lib/postgresql/data:rw
###< doctrine/doctrine-bundle ###
And I solved the problem