I have two actions, and inside one action I am calling the other one but symfony block on that call until the first one (the one I am calling from) is finished. Therefore due to this fact i am getting time out error. Does anyone know what could be the reason ?
Action is rly simple:
$url = $this->router->generate(
'invoice_show',
[
'invoiceId' => $invoiceId,
],
UrlGeneratorInterface::ABSOLUTE_URL
);
return new Response(
$this->pdfGenerator->getOutput(
$url,
[
'margin-bottom' => 3,
'margin-top' => 3,
'margin-left' => 4,
'margin-right' => 4,
'disable-javascript' => true,
'load-error-handling' => 'ignore',
'cookie' => $request->cookies->all(),
]
),
200,
[
'Content-Type' => 'application/pdf',
'Content-Disposition' => 'attachment; filename="' . $invoiceId . '.pdf"',
]
);
Exception:
Symfony\Component\Process\Exception\ProcessTimedOutException(code: 0): The process \"/usr/bin/xvfb-run /usr/bin/wkhtmltopdf --lowquality --margin-bottom '3' --margin-left '4' --margin-right '4' --margin-top '3' --disable-javascript --load-error-handling 'ignore' 'http://localhost/invoices/in_1Atlve2rN1gYNyHu4Ixmy8ZI' '/var/www/var/cache/dev/snappy/knp_snappy599cffb13836d0.68608376.pdf'\" exceeded the timeout of 60 seconds. at /var/www/vendor/symfony/symfony/src/Symfony/Component/Process/Process.php:1265

pdfGeneratorcalls another action and transforms html to pdf, but the html response never comes. As the application is blocked somehow by the first request where we are w8ing for that pdf file - vardiusvar/logsfolder in thedev.logspecifically, and see if it explains the 504 errors. That's a server error. Also have you looked at KnpSnappyBundle? It's easy to use. @Cerad 's suggestions are good too. - Alvin Bunk