Problem when opening pdf files

Hi,

strange bug/error appeared today. There’s a page in grav which has a few pdf files as media. You can view them trough the admin plugin, everything works fine. But when trying to access them through the frontent they don’t work.

At first there was an error, that php memory was not enough (increased to 4GB now).
Now there’s a system timeout error (nginx).

Fatal error : Allowed memory size of 4294967296 bytes exhausted (tried to allocate 262144 bytes) in /var/www/grav/system/src/Grav/Common/Utils.php on line 95

Fatal error : Allowed memory size of 4294967296 bytes exhausted (tried to allocate 262144 bytes) in Unknown on line 0

grav.CRITICAL: Maximum execution time of 30 seconds exceeded - Trace: #0 /var/www/grav/vendor/filp/whoops/src/Whoops/Run.php(382): Whoops\Run->handleError(1, ‘Maximum executi…’, ‘/var/www/grav/s…’, 465) #1 /var/www/grav/system/src/Grav/Common/Errors/SystemFacade.php(36): Whoops\Run->handleShutdown() #2 [internal function]: Grav\Common\Errors\SystemFacade->handleShutdown() #3 {main}

grav.CRITICAL: An exception has been thrown during the rendering of a template (“Unable to create the cache directory (/var/www/grav/cache/twig/cb).”). - Trace: #0 /var/www/grav/vendor/twig/twig/lib/Twig/Template.php(403): Twig_Template->displayWithErrorHandling(Array, Array) #1 /var/www/grav/cache[2018-08-10 07:35:06] grav.CRITICAL: Maximum execution time of 60 seconds exceeded - Trace: #0 /var/www/grav/vendor/filp/whoops/src/Whoops/Run.php(382): Whoops\Run->handleError(1, ‘Maximum executi…’, ‘/var/www/grav/s…’, 479) #1 /var/www/grav/system/src/Grav/Common/Errors/SystemFacade.php(36): Whoops\Run->handleShutdown() #2 [internal function]: Grav\Common\Errors\SystemFacade->handleShutdown() #3 {main}

So in short: increased the max memory to 4GB from 2GB in php.ini, increased the max_timeout in php to 60. And currently I’m out of ideas.

The strange thing is that other pages that have pdf files in them do work, some don’t.

Comments welcome, thanks :slight_smile:

Found out the issue. There was a custom route in the config, and it conflicted with the page attachments.

Problem solved.