* @throws \RuntimeException if the output file generation failed
*/
protected function checkProcessStatus($status, $stdout, $stderr, $command)
{
if (0 !== $status and '' !== $stderr) {
throw new \RuntimeException(sprintf(
'The exit status code \'%s\' says something went wrong:' . "\n"
. 'stderr: "%s"' . "\n"
. 'stdout: "%s"' . "\n"
. 'command: %s.',
$status,
'timeout' => $this->timeout,
]);
try {
list($status, $stdout, $stderr) = $this->executeCommand($command);
$this->checkProcessStatus($status, $stdout, $stderr, $command);
$this->checkOutput($output, $command);
} catch (\Exception $e) {
$this->logger->error(sprintf('An error happened while generating "%s".', $output), [
'command' => $command,
'status' => isset($status) ? $status : null,
$this->dispatcher->dispatch(KernelEvents::CONTROLLER_ARGUMENTS, $event);
$controller = $event->getController();
$arguments = $event->getArguments();
// call controller
$response = \call_user_func_array($controller, $arguments);
// view
if (!$response instanceof Response) {
$event = new GetResponseForControllerResultEvent($this, $request, $type, $response);
$this->dispatcher->dispatch(KernelEvents::VIEW, $event);
public function handle(Request $request, $type = HttpKernelInterface::MASTER_REQUEST, $catch = true)
{
$request->headers->set('X-Php-Ob-Level', (string) ob_get_level());
try {
return $this->handleRaw($request, $type);
} catch (\Exception $e) {
if ($e instanceof RequestExceptionInterface) {
$e = new BadRequestHttpException($e->getMessage(), $e);
}
if (false === $catch) {
//$kernel = new AppCache($kernel);
// When using the HttpCache, you need to call the method in your front controller instead of relying on the configuration parameter
//Request::enableHttpMethodParameterOverride();
$request = Request::createFromGlobals();
$response = $kernel->handle($request);
$response->send();
$kernel->terminate($request, $response);
No log messages
RuntimeException |
---|
RuntimeException: The exit status code '127' says something went wrong: stderr: "/var/www/bluegrowth/public_html/vendor/bin/wkhtmltopdf-amd64: error while loading shared libraries: libXrender.so.1: cannot open shared object file: No such file or directory " stdout: "" command: /var/www/bluegrowth/public_html/vendor/bin/wkhtmltopdf-amd64 --lowquality 'http://bluegrowthvigo.eu/en/project/smart-viport-en/pdf' '/tmp/knp_snappy6606b3074c5779.44336816.pdf'. at vendor/knplabs/knp-snappy/src/Knp/Snappy/AbstractGenerator.php:381 at Knp\Snappy\AbstractGenerator->checkProcessStatus() (vendor/knplabs/knp-snappy/src/Knp/Snappy/AbstractGenerator.php:178) at Knp\Snappy\AbstractGenerator->generate() (vendor/knplabs/knp-snappy/src/Knp/Snappy/Pdf.php:63) at Knp\Snappy\Pdf->generate() (vendor/knplabs/knp-snappy/src/Knp/Snappy/AbstractGenerator.php:222) at Knp\Snappy\AbstractGenerator->getOutput() (src/AppBundle/Controller/DefaultController.php:107) at AppBundle\Controller\DefaultController->projectShowAction() (vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php:151) at Symfony\Component\HttpKernel\HttpKernel->handleRaw() (vendor/symfony/symfony/src/Symfony/Component/HttpKernel/HttpKernel.php:68) at Symfony\Component\HttpKernel\HttpKernel->handle() (vendor/symfony/symfony/src/Symfony/Component/HttpKernel/Kernel.php:200) at Symfony\Component\HttpKernel\Kernel->handle() (app.php:14) |