Problem with Snappdf on 5.1.16

I am already install the snappdf by composer beganovich/snappdf and when I run the command:

vendor/bin/snappdf convert --html="<html</html>" g.pdf

it is sucessful I got g.pdf in the root folder.

But when I when to InvoiceNinja for viewing the invoices:
I got the 500 error:

500:

    <title>Server Error</title>

    <!-- Fonts -->
    <link rel="dns-prefetch" href="//fonts.gstatic.com">
    <link href="https://fonts.googleapis.com/css?family=Nunito" rel="stylesheet">

    <!-- Styles -->
    <style>
        html, body {
            background-color: #fff;
            color: #636b6f;
            font-family: 'Nunito', sans-serif;
            font-weight: 100;
            height: 100vh;
            margin: 0;
        }

        .full-height {
            height: 100vh;
        }

        .flex-center {
            align-items: center;
            display: flex;
            justify-content: center;
        }

        .position-ref {
            position: relative;
        }

        .code {
            border-right: 2px solid;
            font-size: 26px;
            padding: 0 15px 0 15px;
            text-align: center;
        }

        .message {
            font-size: 18px;
            text-align: center;
        }
    </style>
</head>
<body>
    <div class="flex-center position-ref full-height">
        <div class="code">
            500            </div>

        <div class="message" style="padding: 10px;">
            Server Error            </div>
    </div>
</body>

and got this in laravel logs:

[2021-08-06 13:31:36] production.ERROR: File not found at path: 32XPqvnWfUai0LZiEkFnJQAbGyl1DBOJUqsuO4EUFSXmqiXIUHwpTZGDLtG7dL7p/AEYIvhkynHu467w5mOw2Lbk7ZyHaU01DfipUeN48/FmzxPtMx5isWsdsaTdGW6gDlSYRhPfkPIARkmnEz/invoices/INV-0009.pdf {“exception”:"[object] (Illuminate\Contracts\Filesystem\FileNotFoundException(code: 0): File not found at path: 32XPqvnWfUai0LZiEkFnJQAbGyl1DBOJUqsuO4EUFSXmqiXIUHwpTZGDLtG7dL7p/AEYIvhkynHu467w5mOw2Lbk7ZyHaU01DfipUeN48/FmzxPtMx5isWsdsaTdGW6gDlSYRhPfkPIARkmnEz/invoices/INV-0009.pdf at /www/wwwroot/fin.abony.hk/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemAdapter.php:154)
[stacktrace]
#0 /www/wwwroot/fin.abony.hk/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemManager.php(398): Illuminate\Filesystem\FilesystemAdapter->get()
#1 /www/wwwroot/fin.abony.hk/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(261): Illuminate\Filesystem\FilesystemManager->__call()
#2 /www/wwwroot/fin.abony.hk/app/Http/Controllers/InvoiceController.php(804): Illuminate\Support\Facades\Facade::__callStatic()
#3 /www/wwwroot/fin.abony.hk/vendor/symfony/http-foundation/StreamedResponse.php(109): App\Http\Controllers\InvoiceController->App\Http\Controllers\{closure}()
#4 /www/wwwroot/fin.abony.hk/vendor/symfony/http-foundation/Response.php(394): Symfony\Component\HttpFoundation\StreamedResponse->sendContent()
#5 /www/wwwroot/fin.abony.hk/public/index.php(61): Symfony\Component\HttpFoundation\Response->send()
#6 {main}

[previous exception] [object] (League\Flysystem\FileNotFoundException(code: 0): File not found at path: 32XPqvnWfUai0LZiEkFnJQAbGyl1DBOJUqsuO4EUFSXmqiXIUHwpTZGDLtG7dL7p/AEYIvhkynHu467w5mOw2Lbk7ZyHaU01DfipUeN48/FmzxPtMx5isWsdsaTdGW6gDlSYRhPfkPIARkmnEz/invoices/INV-0009.pdf at /www/wwwroot/fin.abony.hk/vendor/league/flysystem/src/Filesystem.php:390)
[stacktrace]
#0 /www/wwwroot/fin.abony.hk/vendor/league/flysystem/src/Filesystem.php(180): League\Flysystem\Filesystem->assertPresent()
#1 /www/wwwroot/fin.abony.hk/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemAdapter.php(152): League\Flysystem\Filesystem->read()
#2 /www/wwwroot/fin.abony.hk/vendor/laravel/framework/src/Illuminate/Filesystem/FilesystemManager.php(398): Illuminate\Filesystem\FilesystemAdapter->get()
#3 /www/wwwroot/fin.abony.hk/vendor/laravel/framework/src/Illuminate/Support/Facades/Facade.php(261): Illuminate\Filesystem\FilesystemManager->__call()
#4 /www/wwwroot/fin.abony.hk/app/Http/Controllers/InvoiceController.php(804): Illuminate\Support\Facades\Facade::__callStatic()
#5 /www/wwwroot/fin.abony.hk/vendor/symfony/http-foundation/StreamedResponse.php(109): App\Http\Controllers\InvoiceController->App\Http\Controllers\{closure}()
#6 /www/wwwroot/fin.abony.hk/vendor/symfony/http-foundation/Response.php(394): Symfony\Component\HttpFoundation\StreamedResponse->sendContent()
#7 /www/wwwroot/fin.abony.hk/public/index.php(61): Symfony\Component\HttpFoundation\Response->send()
#8 {main}

Can you help me on it?
Snappdf is fast for invoiceninja

@david @ben any thoughts to debug this?

Have you configured snappdf to be the PDF engine in the .env vars, please see here for configuration values for SnapPDF

https://invoiceninja.github.io/docs/self-host-troubleshooting/#pdf-conversion-issues

@david of course I already change pdf engine in .env because when I use Phantom or hosted I have no problem when viewing.

by default 2021-08-07 at 15.16.19

Also I got this error when auto upgrade from 5.2.16 to 5.2.17, can you help me with thisby default 2021-08-07 at 15.21.28

Thank you!

you need to chown bootstrap/cache to the web user.

the entire directory needs to be owned by the web user

Anyone can help me about snappdf :slight_smile: Thank you!

Have you tried the solution that David provided?

I already did it but still no sucess!

Looks like it’s a problem with server configuration, as no one else has reported this issue. @david do you have something else to suggest?

@call2vn

Do the PDFs generate when using the HOSTED_PDF option?

https://invoiceninja.github.io/docs/self-host-troubleshooting/#hosted-invoice-ninja-pdf-generation

@david
Using hosted_PDF well with no problem.
Now I am using Hosted_pdf instead phantom because the speed is faster.