I have a Symfony project in which all the routes work well except the only dynamic route service/{path}. I get the error "# unable to fetch the response from the backend: read tcp 127.0.0.1:52258->127.0.0.1:51903: wsarecv: An existing connection was forcibly closed by the remote host." every time I try to access the route
below is my controller code
#[Route('/service/{path}', name: 'service')]
public function viewService(ServiceListRepository $serviceList, string $path): Response
{
$service = $serviceList->getService($path);
return $this->render('services/service.html.twig', [
'service' => $service,
'path' => $path
]);
}
What is the cause and how do I solve it?
This is my docker-compose.yml file
version: '3'
services:
###> symfony/mailer ###
mailer:
image: schickling/mailcatcher
ports: ["1025", "1080"]
###< symfony/mailer ###
###> doctrine/doctrine-bundle ###
postgres:
image: postgres:${POSTGRES_VERSION:-15}-alpine
environment:
POSTGRES_DB: databasename
# You should definitely change the password in production
POSTGRES_PASSWORD: mypassword
POSTGRES_USER: databaseuser
volumes:
- database_data:/var/lib/postgresql/data:pgdata
# 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 ###
ports:
- 5432:5432
###> adminer setup begins ###
adminer:
image: adminer:latest
ports:
- 8080:8080
depends_on:
- 'postgres'
###> adminer setup end ###
volumes:
###> doctrine/doctrine-bundle ###
database_data:
###< doctrine/doctrine-bundle ###