Reporting Module post "Error failed to load PDF document" when downloading

I love the Reporting Module but Iā€™m having trouble using the downloading PDF option. I though the problem was only with my laptop but I have try downloading the PDF in Reporting on five different system and I am getting the same error. Has anyone else resolved this problem?
This is also causing a problem with the drop down PDF option in the normal Icingaweb2 hosts and service overview webpages. If I disable the pdfexport module the overview pages will work again.

image

Icinga 2.11.2-1
Icingaweb2 2.7.3
idoreports 0.9.1
ipl 0.4.0
pdfexport 0.9.1
reacthuncle 0.6.0
reporting 0.10
Chrome 79.0.3945.88
Red Hat Enterprise 7.7

Thanks in advance for your help.
Alex

Did you install also all the requirements?
The pdf module also needs chrome/chromium, see https://github.com/Icinga/icingaweb2-module-pdfexport/blob/master/doc/02-Installation.md

2 Likes

Hello Carseten,
Yes, I have the pdfexport module installed and all the optional requirements installed.

pdfexport 0.9.1
Icingaweb2 2.7.3
RH-PHP71-PHP-FPM 7.1.30
Chrome 79.0.3945.88
mesa-libOSMesa 18.3.4.-5
mesa-libOSMesa-devel 18.3.4.-5
gnu-free-sans-fonts 20120503-8
ipa-gothic-fonts 003.03-5
ipa-pgothic-fonts 003.03-5

See PHP status message below

servicectl status rh-php71-php-fpm

ā— rh-php71-php-fpm.service - The PHP FastCGI Process Manager
   Loaded: loaded (/usr/lib/systemd/system/rh-php71-php-fpm.service; enabled; vendor preset: disabled)
   Active: active (running) since Tue 2020-01-28 13:12:13 EST; 16min ago
  Process: 5190 ExecReload=/bin/kill -USR2 $MAINPID (code=exited, status=0/SUCCESS)
 Main PID: 26915 (php-fpm)
   Status: "Processes active: 0, idle: 6, Requests: 29, slow: 0, Traffic: 0req/sec"
   CGroup: /system.slice/rh-php71-php-fpm.service
           ā”œā”€26915 php-fpm: master process (/etc/opt/rh/rh-php71/php-fpm.conf
           ā”œā”€26916 php-fpm: pool www                                   
           ā”œā”€26917 php-fpm: pool www                                   
           ā”œā”€26918 php-fpm: pool www                                   
           ā”œā”€26919 php-fpm: pool www                                   
           ā”œā”€26920 php-fpm: pool www                                   
           ā”œā”€27446 php-fpm: pool www                                   
           ā”œā”€27560 /usr/bin/google-chrome-stable --headless --disable-gpu --no-sandbox --remote-debugging-port=0
           ā”œā”€27564 cat
           ā”œā”€27565 cat
           ā”œā”€27567 /opt/google/chrome/chrome --type=zygote --no-sandbox --headless --headless --enable-crash-reporter
           ā”œā”€27580 /opt/google/chrome/chrome --type=gpu-process --field-trial-handle=4059520132588618078,763673117136711017,131072 --no-sandbox --headless --headless --enable-crash-reporter --gpu-preferences=KAAAAAAAAAAgAAAgAAAAAAAAYAAAAAAAEAAAAAAAAAAAAAAAAAAAAAgAAAAAAAAA --use-gl=swiftshader-webgl --override-use-software-gl-for-tests --service-request-channel-token=1463149631323911949
           ā”œā”€27581 /opt/google/chrome/chrome --type=utility --field-trial-handle=4059520132588618078,763673117136711017,131072 --lang=en-US --service-sandbox-type=network --no-sandbox --use-gl=swiftshader-webgl --headless --enable-crash-reporter --service-request-channel-token=11208388452277422793 --shared-files=v8_context_snapshot_data:100,v8_natives_data:10
           ā”œā”€27586 /opt/google/chrome/chrome --type=renderer --no-sandbox --allow-pre-commit-input --remote-debugging-port=0 --use-gl=swiftshader-webgl --field-trial-handle=4059520132588618078,763673117136711017,131072 --disable-databases --disable-gpu-compositing --lang=en-US --headless --enable-crash-reporter --num-raster-threads=1 --service-request-channel-token=5492735694971916027 --renderer-client-id=3 --shared-files=v8_context_snapshot_data:100,v8_natives_data:10
           ā””ā”€27591 /opt/google/chrome/chrome --type=renderer --no-sandbox --allow-pre-commit-input --remote-debugging-port=0 --use-gl=swiftshader-webgl --field-trial-handle=4059520132588618078,763673117136711017,131072 --disable-databases --disable-gpu-compositing --lang=en-US --headless --enable-crash-reporter --num-raster-threads=1 --service-request-channel-token=4719066026970916391 --renderer-client-id=5 --shared-files=v8_context_snapshot_data:100,v8_natives_data:10

Jan 28 13:12:13 myserver systemd[1]: Starting The PHP FastCGI Process Manager...
Jan 28 13:12:13 myserver systemd[1]: Started The PHP FastCGI Process Manager.
Jan 28 13:19:41 myserver icingaweb2[27446]: WebSocket\ConnectionException in /usr/share/icingaweb2/modules/pdfexport/vendor/textalk/websocket/lib/Base.php:202 with message: Empty read; connection dead?  Stream state: {"timed_out":false,"blocked":true,"eof":true,"stream_type":"tcp_socket\/ssl","mode":"r+","unread_bytes":0,"seekable":false}    #0 /usr/share/icingaweb2/modules/pdfexport/vendor/textalk/websocket/lib/Base.php(92): WebSocket\Base->read(Integer)    #1 /usr/share/icingaweb2/modules/pdfexport/vendor/textalk/websocket/lib/Base.php(173): WebSocket\Base->receive()    #2 /usr/share/icingaweb2/modules/pdfexport/library/Pdfexport/HeadlessChrome.php(276): WebSocket\Base->close()    #3 /usr/share/icingaweb2/modules/pdfexport/library/Pdfexport/HeadlessChrome.php(215): Icinga\Module\Pdfexport\HeadlessChrome->printToPDF(String, String, Array)    #4 /usr/share/icingaweb2/modules/reactbundle/vendor/evenement/evenement/src/Evenement/EventEmitterTrait.php(34): Icinga\Module\Pdfexport\HeadlessChrome->Icinga\Module\Pdfexport\{closure}(String)    #5 /usr/share/icingaweb2/modules/reactbundle/vendor/evenement/evenement/src/Evenement/EventEmitterTrait.php(70): Evenement\EventEmitter->Evenement\{closure}(String)    #6 /usr/share/icingaweb2/modules/reactbundle/vendor/react/stream/src/ReadableResourceStream.php(146): Evenement\EventEmitter->emit(String, Array)    #7 /usr/share/icingaweb2/modules/reactbundle/vendor/react/event-loop/src/StreamSelectLoop.php(244): React\Stream\ReadableResourceStream->handleData(Resource)    #8 /usr/share/icingaweb2/modules/reactbundle/vendor/react/event-loop/src/StreamSelectLoop.php(211): React\EventLoop\StreamSelectLoop->waitForStreamActivity(NULL)    #9 /usr/share/icingaweb2/modules/pdfexport/library/Pdfexport/HeadlessChrome.php(225): React\EventLoop\StreamSelectLoop->run()    #10 /usr/share/icingaweb2/modules/pdfexport/library/Pdfexport/ProvidedHook/Pdfexport.php(82): Icinga\Module\Pdfexport\HeadlessChrome->toPdf()    #11 /usr/share/icingaweb2/modules/reporting/application/controllers/ReportController.php(118): Icinga\Module\Pdfexport\ProvidedHook\Pdfexport->streamPdfFromHtml(Object(Icinga\Module\Pdfexport\PrintableHtmlDocument), String)    #12 /usr/share/icingaweb2/library/vendor/Zend/Controller/Action.php(507): Icinga\Module\Reporting\Controllers\ReportController->downloadAction()    #13 /usr/share/php/Icinga/Web/Controller/Dispatcher.php(76): Zend_Controller_Action->dispatch(String)    #14 /usr/share/icingaweb2/library/vendor/Zend/Controller/Front.php(937): Icinga\Web\Controller\Dispatcher->dispatch(Object(Icinga\Web\Request), Object(Icinga\Web\Response))    #15 /usr/share/php/Icinga/Application/Web.php(300): Zend_Controller_Front->dispatch(Object(Icinga\Web\Request), Object(Icinga\Web\Response))    #16 /usr/share/php/Icinga/Application/webrouter.php(99): Icinga\Application\Web->dispatch()    #17 /usr/share/icingaweb2/public/index.php(4): require_once(String)    #18 {main}

I just found an open issue with this problem on GitHub. I will follow this and wait for a solution.