Errors in PDF generation

Version ie <v5.11.11

Environment <Self-Hosted/Git>

Describe the bug

PDF generation with snappdf is failing with upgrade from v5.11.8 to v5.11.11

Steps To Reproduce

In .env file, the PDF generator is set to
PDF_GENERATOR=snappdf

Snappdf exists and permissions are correct in appropriate directory. But I just

Expected Behavior

PDF should be rendered in client page, or any other page which needs PDF invoice.
But instead it shows an error ‘Unable to generate the raw PDF’

Additional context

Saw a few commits between recent versions which tweaked PDF generation routine (app/Jobs/Entity/CreateRawPdf.php@handle())
(Possibly - Additional handling for compressed PDFs · invoiceninja/invoiceninja@87bd5c7 · GitHub
)

Switching to PDF_GENERATOR=phantom fixes the issue!

Logs

[2025-01-08 05:34:19] production.ERROR: Unable to generate the raw PDF {“userId”:XXXX,“exception”:"[object] (App\Exceptions\FilePermissionsFailure(code: 0): Unable to generate the raw PDF at /home/XXX/public_html/app/Jobs/Entity/CreateRawPdf.php:115)
[stacktrace]
#0 /home/XXX/public_html/app/Http/Controllers/ClientPortal/InvoiceController.php(127): App\Jobs\Entity\CreateRawPdf->handle()#1 /home/XXX/public_html/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(54): App\Http\Controllers\ClientPortal\InvoiceController->showBlob()
#2 /home/XXX/public_html/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(44): Illuminate\Routing\Controller->callAction()

Hi,

Are you using a custom design/do the standard designs work?

No custom design (apart from a logo and maybe a custom field or two for contacts).

I believe this issue is being tracked here:

1 Like

Yes, it looks similar to my issue. My stack dump is from viewing invoice from Client portal, the issue shows a different path. Although the underlining issue looks the same.

Watching. :pray: