V5.5.48 | Blank generated PDFs when trying to use SnapPDF

Hi,

I’m currently setting a new VPS and I can’t get SnapPDF to work :frowning:

My .env is setup properly, as far as I know, and Invoice Ninja is reporting that it’s usting SnapPDF:

image

I followed the instructions on Github to install dependencies and libraries. It turns out the CentOS listed depedencies were not complete for my distro (Almalinux 8), so I combed through laravel.log and installed each missing package one by one when it told me it was missing.

Now that’s done, I don’t get any more “missing package” errors, but instead I get an error with Signal 5:

[2022-12-12 19:36:04] production.ERROR: The process has been signaled with signal “5”. {“userId”:1,“exception”:"[object] (Symfony\Component\Process\Exception\ProcessSignaledException(code: 0): The process has been signaled with signal "5". at /home/charleso/public_html/admin/vendor/symfony/process/Process.php:434)
[stacktrace]
#0 /home/charleso/public_html/admin/vendor/symfony/process/Process.php(249): Symfony\Component\Process\Process->wait()
#1 /home/charleso/public_html/admin/vendor/beganovich/snappdf/src/Snappdf.php(257): Symfony\Component\Process\Process->run()
#2 /home/charleso/public_html/admin/app/Utils/Traits/Pdf/PdfMaker.php(44): Beganovich\Snappdf\Snappdf->generate()
#3 /home/charleso/public_html/admin/app/Jobs/Util/PreviewPdf.php(50): App\Jobs\Util\PreviewPdf->makePdf(NULL, NULL, ‘…’)
#4 /home/charleso/public_html/admin/app/Http/Controllers/PreviewController.php(304): App\Jobs\Util\PreviewPdf->handle()
#5 /home/charleso/public_html/admin/vendor/laravel/framework/src/Illuminate/Routing/Controller.php(54): App\Http\Controllers\PreviewController->live(Object(App\Http\Requests\Preview\PreviewInvoiceRequest))
#6 /home/charleso/public_html/admin/vendor/laravel/framework/src/Illuminate/Routing/ControllerDispatcher.php(43): Illuminate\Routing\Controller->callAction(‘live’, Array)
#7 /home/charleso/public_html/admin/vendor/sentry/sentry-laravel/src/Sentry/Laravel/Tracing/Routing/TracingControllerDispatcherTracing.php(21): Illuminate\Routing\ControllerDispatcher->dispatch(Object(Illuminate\Routing\Route), Object(App\Http\Controllers\PreviewController), ‘live’)
#8 /home/charleso/public_html/admin/vendor/sentry/sentry-laravel/src/Sentry/Laravel/Tracing/Routing/TracingRoutingDispatcher.php(19): Sentry\Laravel\Tracing\Routing\TracingControllerDispatcherTracing->Sentry\Laravel\Tracing\Routing\{closure}()
#9 /home/charleso/public_html/admin/vendor/sentry/sentry-laravel/src/Sentry/Laravel/Tracing/Routing/TracingControllerDispatcherTracing.php(20): Sentry\Laravel\Tracing\Routing\TracingRoutingDispatcher->wrapRouteDispatch(Object(Closure), Object(Illuminate\Routing\Route))
#10 /home/charleso/public_html/admin/vendor/laravel/framework/src/Illuminate/Routing/Route.php(260): Sentry\Laravel\Tracing\Routing\TracingControllerDispatcherTracing->dispatch(Object(Illuminate\Routing\Route), Object(App\Http\Controllers\PreviewController), ‘live’)
#11 /home/charleso/public_html/admin/vendor/laravel/framework/src/Illuminate/Routing/Route.php(205): Illuminate\Routing\Route->runController()
#12 /home/charleso/public_html/admin/vendor/laravel/framework/src/Illuminate/Routing/Router.php(798): Illuminate\Routing\Route->run()
#13 /home/charleso/public_html/admin/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(141): Illuminate\Routing\Router->Illuminate\Routing\{closure}(Object(Illuminate\Http\Request))
#14 /home/charleso/public_html/admin/vendor/laravel/framework/src/Illuminate/Routing/Middleware/ThrottleRequests.php(126): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#15 /home/charleso/public_html/admin/vendor/laravel/framework/src/Illuminate/Routing/Middleware/ThrottleRequests.php(62): Illuminate\Routing\Middleware\ThrottleRequests->handleRequest(Object(Illuminate\Http\Request), Object(Closure), Array)
#16 /home/charleso/public_html/admin/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\Routing\Middleware\ThrottleRequests->handle(Object(Illuminate\Http\Request), Object(Closure), ‘300’, ‘1’)
#17 /home/charleso/public_html/admin/app/Http/Middleware/QueryLogging.php(39): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#18 /home/charleso/public_html/admin/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): App\Http\Middleware\QueryLogging->handle(Object(Illuminate\Http\Request), Object(Closure))
#19 /home/charleso/public_html/admin/vendor/laravel/framework/src/Illuminate/Routing/Middleware/SubstituteBindings.php(50): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#20 /home/charleso/public_html/admin/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\Routing\Middleware\SubstituteBindings->handle(Object(Illuminate\Http\Request), Object(Closure))
#21 /home/charleso/public_html/admin/app/Http/Middleware/Locale.php(46): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#22 /home/charleso/public_html/admin/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): App\Http\Middleware\Locale->handle(Object(Illuminate\Http\Request), Object(Closure))
#23 /home/charleso/public_html/admin/app/Http/Middleware/TokenAuth.php(96): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#24 /home/charleso/public_html/admin/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): App\Http\Middleware\TokenAuth->handle(Object(Illuminate\Http\Request), Object(Closure))
#25 /home/charleso/public_html/admin/app/Http/Middleware/SetDb.php(40): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#26 /home/charleso/public_html/admin/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): App\Http\Middleware\SetDb->handle(Object(Illuminate\Http\Request), Object(Closure))
#27 /home/charleso/public_html/admin/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(116): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#28 /home/charleso/public_html/admin/vendor/laravel/framework/src/Illuminate/Routing/Router.php(799): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#29 /home/charleso/public_html/admin/vendor/laravel/framework/src/Illuminate/Routing/Router.php(776): Illuminate\Routing\Router->runRouteWithinStack(Object(Illuminate\Routing\Route), Object(Illuminate\Http\Request))
#30 /home/charleso/public_html/admin/vendor/laravel/framework/src/Illuminate/Routing/Router.php(740): Illuminate\Routing\Router->runRoute(Object(Illuminate\Http\Request), Object(Illuminate\Routing\Route))
#31 /home/charleso/public_html/admin/vendor/laravel/framework/src/Illuminate/Routing/Router.php(729): Illuminate\Routing\Router->dispatchToRoute(Object(Illuminate\Http\Request))
#32 /home/charleso/public_html/admin/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(190): Illuminate\Routing\Router->dispatch(Object(Illuminate\Http\Request))
#33 /home/charleso/public_html/admin/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(141): Illuminate\Foundation\Http\Kernel->Illuminate\Foundation\Http\{closure}(Object(Illuminate\Http\Request))
#34 /home/charleso/public_html/admin/vendor/sentry/sentry-laravel/src/Sentry/Laravel/Http/SetRequestIpMiddleware.php(45): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#35 /home/charleso/public_html/admin/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Sentry\Laravel\Http\SetRequestIpMiddleware->handle(Object(Illuminate\Http\Request), Object(Closure))
#36 /home/charleso/public_html/admin/vendor/sentry/sentry-laravel/src/Sentry/Laravel/Http/SetRequestMiddleware.php(30): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#37 /home/charleso/public_html/admin/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Sentry\Laravel\Http\SetRequestMiddleware->handle(Object(Illuminate\Http\Request), Object(Closure))
#38 /home/charleso/public_html/admin/vendor/livewire/livewire/src/DisableBrowserCache.php(19): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#39 /home/charleso/public_html/admin/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Livewire\DisableBrowserCache->handle(Object(Illuminate\Http\Request), Object(Closure))
#40 /home/charleso/public_html/admin/vendor/beyondcode/laravel-query-detector/src/QueryDetectorMiddleware.php(27): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#41 /home/charleso/public_html/admin/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): BeyondCode\QueryDetector\QueryDetectorMiddleware->handle(Object(Illuminate\Http\Request), Object(Closure))
#42 /home/charleso/public_html/admin/vendor/barryvdh/laravel-debugbar/src/Middleware/InjectDebugbar.php(59): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#43 /home/charleso/public_html/admin/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Barryvdh\Debugbar\Middleware\InjectDebugbar->handle(Object(Illuminate\Http\Request), Object(Closure))
#44 /home/charleso/public_html/admin/app/Http/Middleware/Cors.php(25): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#45 /home/charleso/public_html/admin/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): App\Http\Middleware\Cors->handle(Object(Illuminate\Http\Request), Object(Closure))
#46 /home/charleso/public_html/admin/vendor/laravel/framework/src/Illuminate/Http/Middleware/TrustProxies.php(39): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#47 /home/charleso/public_html/admin/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\Http\Middleware\TrustProxies->handle(Object(Illuminate\Http\Request), Object(Closure))
#48 /home/charleso/public_html/admin/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#49 /home/charleso/public_html/admin/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ConvertEmptyStringsToNull.php(31): Illuminate\Foundation\Http\Middleware\TransformsRequest->handle(Object(Illuminate\Http\Request), Object(Closure))
#50 /home/charleso/public_html/admin/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\Foundation\Http\Middleware\ConvertEmptyStringsToNull->handle(Object(Illuminate\Http\Request), Object(Closure))
#51 /home/charleso/public_html/admin/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TransformsRequest.php(21): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#52 /home/charleso/public_html/admin/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/TrimStrings.php(40): Illuminate\Foundation\Http\Middleware\TransformsRequest->handle(Object(Illuminate\Http\Request), Object(Closure))
#53 /home/charleso/public_html/admin/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\Foundation\Http\Middleware\TrimStrings->handle(Object(Illuminate\Http\Request), Object(Closure))
#54 /home/charleso/public_html/admin/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/ValidatePostSize.php(27): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#55 /home/charleso/public_html/admin/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\Foundation\Http\Middleware\ValidatePostSize->handle(Object(Illuminate\Http\Request), Object(Closure))
#56 /home/charleso/public_html/admin/vendor/laravel/framework/src/Illuminate/Foundation/Http/Middleware/PreventRequestsDuringMaintenance.php(86): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#57 /home/charleso/public_html/admin/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Illuminate\Foundation\Http\Middleware\PreventRequestsDuringMaintenance->handle(Object(Illuminate\Http\Request), Object(Closure))
#58 /home/charleso/public_html/admin/vendor/sentry/sentry-laravel/src/Sentry/Laravel/Tracing/Middleware.php(52): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#59 /home/charleso/public_html/admin/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(180): Sentry\Laravel\Tracing\Middleware->handle(Object(Illuminate\Http\Request), Object(Closure))
#60 /home/charleso/public_html/admin/vendor/laravel/framework/src/Illuminate/Pipeline/Pipeline.php(116): Illuminate\Pipeline\Pipeline->Illuminate\Pipeline\{closure}(Object(Illuminate\Http\Request))
#61 /home/charleso/public_html/admin/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(165): Illuminate\Pipeline\Pipeline->then(Object(Closure))
#62 /home/charleso/public_html/admin/vendor/laravel/framework/src/Illuminate/Foundation/Http/Kernel.php(134): Illuminate\Foundation\Http\Kernel->sendRequestThroughRouter(Object(Illuminate\Http\Request))
#63 /home/charleso/public_html/admin/public/index.php(57): Illuminate\Foundation\Http\Kernel->handle(Object(Illuminate\Http\Request))
#64 {main}
"}

In my browser, I get a POST 500 Error for the live preview API, here is the console print (it’s a long list that I had to truncate so the post could get created, but thanks in advance for looking into that):

main.foss.dart.js?v=5.5.48:92970

   POST https://admin.domain.com/api/v1/live_preview?entity=invoice 500

iG @ main.foss.dart.js?v=5.5.48:92970
eDI @ main.foss.dart.js?v=5.5.48:75263
(anonymes) @ main.foss.dart.js?v=5.5.48:162894
(anonymes) @ main.foss.dart.js?v=5.5.48:5890
$2 @ main.foss.dart.js?v=5.5.48:88357
$1 @ main.foss.dart.js?v=5.5.48:88351
dP_ @ main.foss.dart.js?v=5.5.48:6170
(anonymes) @ main.foss.dart.js?v=5.5.48:284294
Ci @ main.foss.dart.js?v=5.5.48:89490
$0 @ main.foss.dart.js?v=5.5.48:88776
af7 @ main.foss.dart.js?v=5.5.48:6034
xZ @ main.foss.dart.js?v=5.5.48:88696
$0 @ main.foss.dart.js?v=5.5.48:88740
dOY @ main.foss.dart.js?v=5.5.48:6167
(anonymes) @ main.foss.dart.js?v=5.5.48:284293
Ch @ main.foss.dart.js?v=5.5.48:89488
zy @ main.foss.dart.js?v=5.5.48:89464
$0 @ main.foss.dart.js?v=5.5.48:89536
fqe @ main.foss.dart.js?v=5.5.48:6066
fvK @ main.foss.dart.js?v=5.5.48:6068
$1 @ main.foss.dart.js?v=5.5.48:88297
fGD @ main.foss.dart.js?v=5.5.48:4775
(anonymes) @ main.foss.dart.js?v=5.5.48:4783
childList (asynchrone)
$1 @ main.foss.dart.js?v=5.5.48:88304
eND @ main.foss.dart.js?v=5.5.48:6073
dP0 @ main.foss.dart.js?v=5.5.48:6190
xI @ main.foss.dart.js?v=5.5.48:89506
ad7 @ main.foss.dart.js?v=5.5.48:88703
oI @ main.foss.dart.js?v=5.5.48:88701
ae @ main.foss.dart.js?v=5.5.48:88338
N @ main.foss.dart.js?v=5.5.48:5880
(anonymes) @ main.foss.dart.js?v=5.5.48:273338
(anonymes) @ main.foss.dart.js?v=5.5.48:5890
$2 @ main.foss.dart.js?v=5.5.48:88357
O @ main.foss.dart.js?v=5.5.48:5876
Nv @ main.foss.dart.js?v=5.5.48:273339
(anonymes) @ main.foss.dart.js?v=5.5.48:273260
(anonymes) @ main.foss.dart.js?v=5.5.48:5890
$2 @ main.foss.dart.js?v=5.5.48:88357
O @ main.foss.dart.js?v=5.5.48:5876
bbI @ main.foss.dart.js?v=5.5.48:273262
mE @ main.foss.dart.js?v=5.5.48:273254
(anonymes) @ main.foss.dart.js?v=5.5.48:272417
(anonymes) @ main.foss.dart.js?v=5.5.48:5890
$2 @ main.foss.dart.js?v=5.5.48:88357
O @ main.foss.dart.js?v=5.5.48:5876
bbE @ main.foss.dart.js?v=5.5.48:272419
mE @ main.foss.dart.js?v=5.5.48:272406
(anonymes) @ main.foss.dart.js?v=5.5.48:71025
(anonymes) @ main.foss.dart.js?v=5.5.48:5890
$2 @ main.foss.dart.js?v=5.5.48:88357
O @ main.foss.dart.js?v=5.5.48:5876
cl7 @ main.foss.dart.js?v=5.5.48:71030
(anonymes) @ main.foss.dart.js?v=5.5.48:272481
(anonymes) @ main.foss.dart.js?v=5.5.48:5890
$2 @ main.foss.dart.js?v=5.5.48:88357
O @ main.foss.dart.js?v=5.5.48:5876
bbF @ main.foss.dart.js?v=5.5.48:272486
mE @ main.foss.dart.js?v=5.5.48:272476
kz @ main.foss.dart.js?v=5.5.48:272477
$4 @ main.foss.dart.js?v=5.5.48:272295
awT @ main.foss.dart.js?v=5.5.48:89512
fqs @ main.foss.dart.js?v=5.5.48:6194
an @ main.foss.dart.js?v=5.5.48:7736
(anonymes) @ main.foss.dart.js?v=5.5.48:188435
(anonymes) @ main.foss.dart.js?v=5.5.48:5890
$2 @ main.foss.dart.js?v=5.5.48:88357
O @ main.foss.dart.js?v=5.5.48:5876
bpT @ main.foss.dart.js?v=5.5.48:188457
pU @ main.foss.dart.js?v=5.5.48:188421
zm @ main.foss.dart.js?v=5.5.48:188424
(anonymes) @ main.foss.dart.js?v=5.5.48:241764
(anonymes) @ main.foss.dart.js?v=5.5.48:5890
$2 @ main.foss.dart.js?v=5.5.48:88357
O @ main.foss.dart.js?v=5.5.48:5876
HQ @ main.foss.dart.js?v=5.5.48:241766
(anonymes) @ main.foss.dart.js?v=5.5.48:241740
(anonymes) @ main.foss.dart.js?v=5.5.48:5890
$2 @ main.foss.dart.js?v=5.5.48:88357
O @ main.foss.dart.js?v=5.5.48:5876
pP @ main.foss.dart.js?v=5.5.48:241743
b3 @ main.foss.dart.js?v=5.5.48:241735
YD @ main.foss.dart.js?v=5.5.48:140835
om @ main.foss.dart.js?v=5.5.48:140800
Ka @ main.foss.dart.js?v=5.5.48:140688
mw @ main.foss.dart.js?v=5.5.48:140637
om @ main.foss.dart.js?v=5.5.48:141028
Ka @ main.foss.dart.js?v=5.5.48:140688
om @ main.foss.dart.js?v=5.5.48:141068
Ka @ main.foss.dart.js?v=5.5.48:140688
mw @ main.foss.dart.js?v=5.5.48:140637
qI @ main.foss.dart.js?v=5.5.48:140807
iC @ main.foss.dart.js?v=5.5.48:140772
YD @ main.foss.dart.js?v=5.5.48:140801
om @ main.foss.dart.js?v=5.5.48:140800
Ka @ main.foss.dart.js?v=5.5.48:140688
om @ main.foss.dart.js?v=5.5.48:141068
Ka @ main.foss.dart.js?v=5.5.48:140688
mw @ main.foss.dart.js?v=5.5.48:140637
om @ main.foss.dart.js?v=5.5.48:141028
Ka @ main.foss.dart.js?v=5.5.48:140688
mw @ main.foss.dart.js?v=5.5.48:140637
om @ main.foss.dart.js?v=5.5.48:141028
Ka @ main.foss.dart.js?v=5.5.48:140688
mw @ main.foss.dart.js?v=5.5.48:140637
om @ main.foss.dart.js?v=5.5.48:141028
Ka @ main.foss.dart.js?v=5.5.48:140688
mw @ main.foss.dart.js?v=5.5.48:140637
om @ main.foss.dart.js?v=5.5.48:141028
Ka @ main.foss.dart.js?v=5.5.48:140688
mw @ main.foss.dart.js?v=5.5.48:140637
om @ main.foss.dart.js?v=5.5.48:141028
Ka @ main.foss.dart.js?v=5.5.48:140688
mw @ main.foss.dart.js?v=5.5.48:140637
qI @ main.foss.dart.js?v=5.5.48:140807
qI @ main.foss.dart.js?v=5.5.48:140839
iC @ main.foss.dart.js?v=5.5.48:140772
YD @ main.foss.dart.js?v=5.5.48:140801
YD @ main.foss.dart.js?v=5.5.48:140836
om @ main.foss.dart.js?v=5.5.48:140800
Ka @ main.foss.dart.js?v=5.5.48:140688
mw @ main.foss.dart.js?v=5.5.48:140637
om @ main.foss.dart.js?v=5.5.48:141028
Ka @ main.foss.dart.js?v=5.5.48:140688
mw @ main.foss.dart.js?v=5.5.48:140637
qI @ main.foss.dart.js?v=5.5.48:140807
iC @ main.foss.dart.js?v=5.5.48:140772
YD @ main.foss.dart.js?v=5.5.48:140801
om @ main.foss.dart.js?v=5.5.48:140800
Ka @ main.foss.dart.js?v=5.5.48:140688
mw @ main.foss.dart.js?v=5.5.48:140637
om @ main.foss.dart.js?v=5.5.48:141028
Ka @ main.foss.dart.js?v=5.5.48:140688
mw @ main.foss.dart.js?v=5.5.48:140637
qI @ main.foss.dart.js?v=5.5.48:140807
iC @ main.foss.dart.js?v=5.5.48:140772
YD @ main.foss.dart.js?v=5.5.48:140801
om @ main.foss.dart.js?v=5.5.48:140800
Ka @ main.foss.dart.js?v=5.5.48:140688
mw @ main.foss.dart.js?v=5.5.48:140637
om @ main.foss.dart.js?v=5.5.48:141028
Ka @ main.foss.dart.js?v=5.5.48:140688
mw @ main.foss.dart.js?v=5.5.48:140637
om @ main.foss.dart.js?v=5.5.48:141028
Ka @ main.foss.dart.js?v=5.5.48:140688

Hi,

@david do you have any ideas?

from the commandline can you try and generate a PDF,

please use the following command, this will let us know if snappdf is configured correctly.

./vendor/bin/snappdf convert --html "<h1>Hello world!</h1>" test.pdf

Hi @david,

Thanks for your anser. So, I typed your command line in my IN folder and I got this:

bash: !: event not found

:face_with_raised_eyebrow:

Update: I am in the process of migrating to Ubuntu from AlmaLinux. That might fix a lot of issues, since packages seem a lot easier to get for IN dependencies ans such, and most guides seem designed for it instead of RHEL distros. I’ll report back if I still have issues then. Thanks! :crossed_fingers:

@charles

Yeh, I would recommend Ubuntu, it is just easier to get stuff done. The above issue is a system related issue.

Is there something missing then? Since a few versions, I have the same “event not found” error on Ubuntu 22.04.1 when running snappdf convert
I’m also unable to view PDF files in the application.

404: Not Found
Route does not exist

this sounds like two separate issues.

event not found relates to some change in your system in the bash prompt

the 404 indicates the route isn’t found by the system which could indicate a . htaccess issue with rewrites, hard to say without more information.

Thanks. The event not found error is because of the exclamation mark in the example. The snappdf executable seems to be working. I’ll not further hijack this thread for the other issue.

Hello @david,

I have moved my IN installation on a new Ubuntu 20.04 server and I made sure to install all the missing debian dependencies listed on GitHub (including the ones specifically listed for Ubuntu 20.04):

apt install ca-certificates fonts-liberation libappindicator3-1 libasound2 libatk-bridge2.0-0 libatk1.0-0 libc6 libcairo2 libcups2 libdbus-1-3 libexpat1 libfontconfig1 libgbm1 libgcc1 libglib2.0-0 libgtk-3-0 libnspr4 libnss3 libpango-1.0-0 libpangocairo-1.0-0 libstdc++6 libx11-6 libx11-xcb1 libxcb1 libxcomposite1 libxcursor1 libxdamage1 libxext6 libxfixes3 libxi6 libxrandr2 libxrender1 libxss1 libxtst6 lsb-release wget xdg-utils libgbm-dev libxshmfence-dev

I also made sure that required PHP 8.1 extensions are installed:

[PHP Modules]
bcmath
bz2
calendar
Core
ctype
curl
date
dom
enchant
exif
fileinfo
filter
ftp
gd
gettext
gmp
hash
iconv
imap
intl
json
ldap
libxml
mbstring
memcached
mysqli
mysqlnd
odbc
openssl
pcntl
pcre
PDO
pdo_mysql
PDO_ODBC
pdo_sqlite
Phar
posix
readline
Reflection
session
shmop
SimpleXML
snmp
soap
sockets
sodium
SourceGuardian
SPL
sqlite3
standard
sysvmsg
sysvsem
sysvshm
tidy
timezonedb
tokenizer
xml
xmlreader
xmlwriter
xsl
Zend OPcache
zip
zlib

I then made sure that all snappdf required files were present by running
composer require beganovich/snappdf

and then
./vendor/bin/snappdf download --force

Still, if I run
./vendor/bin/snappdf convert --html "<h1>Hello world!</h1>" test.pdf

I get
bash: !: event not found

And generated PDFs are still showing a grey page after displaying a spinning wheel for half a second.

I really don’t understand. What could I be missing? I reverted back to hosted_pdf for now, but I’d really like to get snappdf working :pensive:

Thanks in advance

Edit: It seems like chrome won’t run at all:

/public_html/admin/vendor/beganovich/snappdf/versions/1089252-Linux_x64/chrome-linux$ chrome
bash: chrome: command not found

@charles

So i think the issue here is you ran ./snappdf download as a user other than www-data this would lead to a permissions issue executing the command

You could try running the download command again as the webuser and try again.

Thanks for your reply @david.

FYI, the download command works fine as a user (everything is installed inside the logic of a cPanel account, if that changes anything). Here is what I get when executing the dl command with my user:

./vendor/bin/snappdf download --force
Starting download. Revision: 1089757
Download completed. Extracting the zip archive.
Archive extracted.
Completed! 1089757-Linux_x64 currently in use.

If I try to run the same command as www-data (assuming the syntax is correct), I get an error:

sudo -u www-data ./vendor/bin/snappdf download --force
Could not determine path to lookup PHP setting for based on arguments

I also tried to recursively transfer the whole IN installation to www-data:www-data ownership, add my user to the www-data group and change the files permissions to 0664, but then I would get a 403 error trying to access IN in the frontend. Reverting the ownership to my username and keeping the www-data groupchanged nothing either for snappdf, except now IN runs fine again.

As for the Chrome headless not running, I gorgot to add the dot in the syntax before the executable, so here is what I get with it (with the up-to-date version of Chrome):

./vendor/beganovich/snappdf/versions/1089757-Linux_x64/chrome-linux$ . chrome
bash: .: chrome: cannot execute binary file

So yeah, I’d still need more help please :sweat_smile:

@charles

You’ll need to reference the PHP binary by the looks of it… something like

sudo -u www-data /usr/bin/php8.1 ./vendor/bin/snappdf download --force

Thanks, but I’m not sure if that’s the issue, because chrome did download fine during the previous steps (without referencing php explicitly): here is a screenshot from .vendor/beganovich/snappdf/versions/1089252-Linux_x64/chrome-linux

It’s the actual using/running of SnapPDF/Chrome that doesn’t work and is causing me headaches!

Can you try

chmod +x /path/to/chrome/binary/chrome

This will make the binary executable.

Thanks, I tried that and I even set it to 0777 for testing purposes, yet I still get that:

. chrome
bash: .: chrome: cannot execute binary file

SnapPDF itself runs fine (I can make it download chrome, I can display the help, etc.). It seems like the issue is with the bash commands and the executing of chrome and I really don’t know enough about Linux to troubleshoot this one, but it seems like I did a by-the-book setup and configuration without any luck.

I read that setting + H to turn off bash history expansion or something like that could help. Any idea about this one?

I did try to set permissions for Chrome under www-data (which did not help), but I could not find the right php folder to just force www-data do run SnapPDF itself to download the Chrome binary. I keep getting errors, either permission errors, or 404, or “command not found”… The cPanel file structure is, hmm, a bit confusing.

@charles

which path to PHP does your cron reference?

My cron jobs are setup with just the “php” command without referencing its path and they work fine that way when ran as the cPanel user (I double-checked by running them manually outside of cron), so that didn’t help in itself, but… the “built-in” cPanel documentation in the cron jobs page says this:

Now that’s much more straightforward than the convolulted schema I posted above.

Since my IN subdomain is running php 8.2, I used the following path: usr/local/bin/ea-php82. I also made sure to st the www-data user to the charleo group (the default cPanel group with the same name as my user). Here’s what I got:

Line 120 in bin/snappdf is this:

include __DIR__ . '/..'.'/beganovich/snappdf/snappdf';

:face_with_monocle:

Those with signal 5 on cpanel, check “ulimit -u”, “ulimits -n” on shell.

If shell bomb is activated on WHM… it will limit shell executions.

Raising ulimit -u to 250 made PDF generation work for me.

If you are buying cpanel hosting then you probably have to contact your provider for this.

Hi @Peter32786,

Thanks for pointing to this. Can you elaborate on what’s happening? I am not familiar with Fork Bomb Protection on WHM, but I have full access to it (I rent a VPS) so I can do what needs to be done. I had kind of abandoned the hope of getting Snappdf working on my server (I just resort to Hosted PDF instead), but if you managed to make it work, could you share some additional details about the whole thing please?