Error 500 and PlatformException to load view PDF

I have been with this problem for a long time and I do not see a definitive solution. PDFs won’t load, I tried a phantom key and I’m still the same. Also change from PDF_GENERATOR = phantom to PDF_GENERATOR = snappdf and follow the problem.

Captura de pantalla 2021-10-24 114812

Hi,

Are there any details about the 500 in storage/logs?

Yes, laravel.log in to storage/logs:

[2021-10-24 15:47:27] production.ERROR: Downloaded Chromium binary is not executable. Make sure to set correct permissions (0755) {“userId”:1,“exception”:"[object] (Beganovich\Snappdf\Exception\BinaryNotExecutable(code: 0): Downloaded Chromium binary is not executable. Make sure to set correct permissions (0755) at …/vendor/beganovich/snappdf/src/Snappdf.php:82)
[stacktrace]
#0 …/vendor/beganovich/snappdf/src/Snappdf.php(201): Beganovich\Snappdf\Snappdf->getChromiumPath()
#1 …/app/Utils/Traits/Pdf/PdfMaker.php(44): Beganovich\Snappdf\Snappdf->generate()
#2 …/app/Jobs/Util/PreviewPdf.php(49): App\Jobs\Util\PreviewPdf->makePdf()
#3 …/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(36): App\Jobs\Util\PreviewPdf->handle()
#4 …/vendor/laravel/framework/src/Illuminate/Container/Util.php(40): Illuminate\Container\BoundMethod::Illuminate\Container\{closure}()
#5 …/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(93): Illuminate\Container\Util::unwrapIfClosure()
#6 …/vendor/laravel/framework/src/Illuminate/Container/BoundMethod.php(37): Illuminate\Container\BoundMethod::callBoundMethod()
#7 …/vendor/laravel/framework/src/Illuminate/Container/Container.php(653): Illuminate\Container\BoundMethod::call()
#8 …/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php(128): Illuminate\Container\Container->call()
#9 …/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(128): Illuminate\Bus\Dispatcher->Illuminate\Bus\{closure}()
#10 …/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#11 …/vendor/laravel/framework/src/Illuminate/Bus/Dispatcher.php(132): Illuminate\Pipeline\Pipeline->then()
#12 …/vendor/laravel/framework/src/Illuminate/Foundation/Bus/Dispatchable.php(69): Illuminate\Bus\Dispatcher->dispatchNow()
#13 …/app/Http/Controllers/PreviewController.php(293): App\Jobs\Util\PreviewPdf::dispatchNow()
#14 …/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(54): App\Http\Controllers\PreviewController->live()
#15 …/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(45): Illuminate\Routing\Controller->callAction()
#16 …/vendor/laravel/framework/src/Illuminate/Routing/Route.php(262): Illuminate\Routing\ControllerDispatcher->dispatch()
#17 …/vendor/laravel/framework/src/Illuminate/Routing/Route.php(205): Illuminate\Routing\Route->runController()
#18 …/vendor/laravel/framework/src/Illuminate/Routing/Router.php(695): Illuminate\Routing\Route->run()
#19 …/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(128): Illuminate\Routing\Router->Illuminate\Routing\{closure}()
#20 …/app/Http/Middleware/QueryLogging.php(40): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#21 …/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): App\Http\Middleware\QueryLogging->handle()
#22 …/vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php(50): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#23 …/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Routing\Middleware\SubstituteBindings->handle()
#24 …/app/Http/Middleware/Locale.php(34): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#25 …/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): App\Http\Middleware\Locale->handle()
#26 …/app/Http/Middleware/TokenAuth.php(80): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#27 …/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): App\Http\Middleware\TokenAuth->handle()
#28 …/app/Http/Middleware/SetDb.php(41): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#29 …/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): App\Http\Middleware\SetDb->handle()
#30 …/vendor/laravel/framework/src/Illuminate/Routing/Middleware/ThrottleRequests.php(127): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#31 …/vendor/laravel/framework/src/Illuminate/Routing/Middleware/ThrottleRequests.php(63): Illuminate\Routing\Middleware\ThrottleRequests->handleRequest()
#32 …/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Routing\Middleware\ThrottleRequests->handle()
#33 …/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#34 …/vendor/laravel/framework/src/Illuminate/Routing/Router.php(697): Illuminate\Pipeline\Pipeline->then()
#35 …/vendor/laravel/framework/src/Illuminate/Routing/Router.php(672): Illuminate\Routing\Router->runRouteWithinStack()
#36 …/vendor/laravel/framework/src/Illuminate/Routing/Router.php(636): Illuminate\Routing\Router->runRoute()
#37 …/vendor/laravel/framework/src/Illuminate/Routing/Router.php(625): Illuminate\Routing\Router->dispatchToRoute()
#38 …/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(166): Illuminate\Routing\Router->dispatch()
#39 …/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(128): Illuminate\Foundation\Http\Kernel->Illuminate\Foundation\Http\{closure}()
#40 …/vendor/sentry/sentry-laravel/src/Sentry/Laravel/Http/SetRequestIpMiddleware.php(45): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#41 …/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Sentry\Laravel\Http\SetRequestIpMiddleware->handle()
#42 …/vendor/sentry/sentry-laravel/src/Sentry/Laravel/Http/SetRequestMiddleware.php(42): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#43 …/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Sentry\Laravel\Http\SetRequestMiddleware->handle()
#44 …/vendor/livewire/livewire/src/DisableBrowserCache.php(19): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#45 …/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Livewire\DisableBrowserCache->handle()
#46 …/app/Http/Middleware/Cors.php(25): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#47 …/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): App\Http\Middleware\Cors->handle()
#48 …/vendor/fideloper/proxy/src/TrustProxies.php(57): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#49 …/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Fideloper\Proxy\TrustProxies->handle()
#50 …/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#51 …/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ConvertEmptyStringsToNull.php(31): Illuminate\Foundation\Http\Middleware\TransformsRequest->handle()
#52 …/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull->handle()
#53 …/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#54 …/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TrimStrings.php(40): Illuminate\Foundation\Http\Middleware\TransformsRequest->handle()
#55 …/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Foundation\Http\Middleware\TrimStrings->handle()
#56 …/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php(27): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#57 …/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Foundation\Http\Middleware\ValidatePostSize->handle()
#58 …/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/PreventRequestsDuringMaintenance.php(86): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#59 …/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(167): Illuminate\Foundation\Http\Middleware\PreventRequestsDuringMaintenance->handle()
#60 …/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(103): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}()
#61 …/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(141): Illuminate\Pipeline\Pipeline->then()
#62 …/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(110): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter()
#63 …/public/index.php(57): Illuminate\Foundation\Http\Kernel->handle()
#64 {main}
“}
[2021-10-24 15:48:10] production.ERROR: File not found at path: RzqrNkfLMMquI0wqBkO18XcO6gOLTPJa06ecNcqKSdtREVr2ecQBHiM3EntN4O7s/le1Lcc1xRZWyvc6tiHJsfmOOCONRN7ARsFY5A8G2/NTG5dYchhCYxPTor9ByjCFtKbhE8tZklTIZsle4U/invoices/OD-0003.pdf {“exception”:”[object] (Illuminate\Contracts\Filesystem\FileNotFoundException(code: 0): File not found at path: RzqrNkfLMMquI0wqBkO18XcO6gOLTPJa06ecNcqKSdtREVr2ecQBHiM3EntN4O7s/le1Lcc1xRZWyvc6tiHJsfmOOCONRN7ARsFY5A8G2/NTG5dYchhCYxPTor9ByjCFtKbhE8tZklTIZsle4U/invoices/OD-0003.pdf at …/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemAdapter.php:159)
[stacktrace]
#0 …/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemManager.php(398): Illuminate\Filesystem\FilesystemAdapter->get()
#1 …/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(261): Illuminate\Filesystem\FilesystemManager->__call()
#2 …/app/Http/Controllers/InvoiceController.php(817): Illuminate\Support\Facades\Facade::__callStatic()
#3 …/vendor/symfony/http-foundation/StreamedResponse.php(109): App\Http\Controllers\InvoiceController->App\Http\Controllers\{closure}()
#4 …/vendor/symfony/http-foundation/Response.php(394): Symfony\Component\HttpFoundation\StreamedResponse->sendContent()
#5 …/public/index.php(61): Symfony\Component\HttpFoundation\Response->send()
#6 {main}

[previous exception] [object] (League\Flysystem\FileNotFoundException(code: 0): File not found at path: RzqrNkfLMMquI0wqBkO18XcO6gOLTPJa06ecNcqKSdtREVr2ecQBHiM3EntN4O7s/le1Lcc1xRZWyvc6tiHJsfmOOCONRN7ARsFY5A8G2/NTG5dYchhCYxPTor9ByjCFtKbhE8tZklTIZsle4U/invoices/OD-0003.pdf at …/vendor/league/flysystem/src/Filesystem.php:390)
[stacktrace]
#0 …/vendor/league/flysystem/src/Filesystem.php(180): League\Flysystem\Filesystem->assertPresent()
#1 …/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemAdapter.php(157): League\Flysystem\Filesystem->read()
#2 …/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemManager.php(398): Illuminate\Filesystem\FilesystemAdapter->get()
#3 …/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(261): Illuminate\Filesystem\FilesystemManager->__call()
#4 …/app/Http/Controllers/InvoiceController.php(817): Illuminate\Support\Facades\Facade::__callStatic()
#5 …/vendor/symfony/http-foundation/StreamedResponse.php(109): App\Http\Controllers\InvoiceController->App\Http\Controllers\{closure}()
#6 …/vendor/symfony/http-foundation/Response.php(394): Symfony\Component\HttpFoundation\StreamedResponse->sendContent()
#7 …/public/index.php(61): Symfony\Component\HttpFoundation\Response->send()
#8 {main}
“}
[2021-10-24 16:07:45] production.ERROR: File not found at path: RzqrNkfLMMquI0wqBkO18XcO6gOLTPJa06ecNcqKSdtREVr2ecQBHiM3EntN4O7s/16cFhPOgZPAYPnL8Knd5sm84nfZvhOjAHaj8eNRm/zz0JGaEJit7FRX9HbTS2XZBOj2e67Q9oPL5D7vMh/invoices/OD-0001.pdf {“exception”:”[object] (Illuminate\Contracts\Filesystem\FileNotFoundException(code: 0): File not found at path: RzqrNkfLMMquI0wqBkO18XcO6gOLTPJa06ecNcqKSdtREVr2ecQBHiM3EntN4O7s/16cFhPOgZPAYPnL8Knd5sm84nfZvhOjAHaj8eNRm/zz0JGaEJit7FRX9HbTS2XZBOj2e67Q9oPL5D7vMh/invoices/OD-0001.pdf at …/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemAdapter.php:159)
[stacktrace]
#0 …/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemManager.php(398): Illuminate\Filesystem\FilesystemAdapter->get()
#1 …/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(261): Illuminate\Filesystem\FilesystemManager->__call()
#2 …/app/Http/Controllers/InvoiceController.php(817): Illuminate\Support\Facades\Facade::__callStatic()
#3 …/vendor/symfony/http-foundation/StreamedResponse.php(109): App\Http\Controllers\InvoiceController->App\Http\Controllers\{closure}()
#4 …/vendor/symfony/http-foundation/Response.php(394): Symfony\Component\HttpFoundation\StreamedResponse->sendContent()
#5 …/public/index.php(61): Symfony\Component\HttpFoundation\Response->send()
#6 {main}

[previous exception] [object] (League\Flysystem\FileNotFoundException(code: 0): File not found at path: RzqrNkfLMMquI0wqBkO18XcO6gOLTPJa06ecNcqKSdtREVr2ecQBHiM3EntN4O7s/16cFhPOgZPAYPnL8Knd5sm84nfZvhOjAHaj8eNRm/zz0JGaEJit7FRX9HbTS2XZBOj2e67Q9oPL5D7vMh/invoices/OD-0001.pdf at …/vendor/league/flysystem/src/Filesystem.php:390)
[stacktrace]
#0 …/vendor/league/flysystem/src/Filesystem.php(180): League\Flysystem\Filesystem->assertPresent()
#1 …/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemAdapter.php(157): League\Flysystem\Filesystem->read()
#2 …/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemManager.php(398): Illuminate\Filesystem\FilesystemAdapter->get()
#3 …/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(261): Illuminate\Filesystem\FilesystemManager->__call()
#4 …/app/Http/Controllers/InvoiceController.php(817): Illuminate\Support\Facades\Facade::__callStatic()
#5 …/vendor/symfony/http-foundation/StreamedResponse.php(109): App\Http\Controllers\InvoiceController->App\Http\Controllers\{closure}()
#6 …/vendor/symfony/http-foundation/Response.php(394): Symfony\Component\HttpFoundation\StreamedResponse->sendContent()
#7 …/public/index.php(61): Symfony\Component\HttpFoundation\Response->send()
#8 {main}
"}

Does changing the permissions help?

I change them for 777 and I keep presenting the error.

@ben do you have any suggestions?

you may need to also run chmod +x to the chrome binary itself.

Sounds like you might want to run something like

find /path/to/invoiceninja/ ( ! -user www-data -o ! -perm -644 ) -ls

to find all files that need their ownership or permissions fixed. (www-data should be changed to the username of your http daemon.)