Pdf export not working

Hello Team,

In my icinga web pdf export is not working.

see below error opening new window in

Uncaught Error: Call to undefined method Icinga\Module\Pdfexport\ProvidedHook\Pdfexport::first() in /usr/share/icingaweb2/modules/reporting/application/controllers/ReportController.php:118
Stack trace:

I believe i have installed all the necessary dependencies

System information:
Platform: CentOS Linux
Platform version: 7 (Core)
Kernel: Linux
Kernel version: 3.10.0-1062.12.1.el7.x86_64
Architecture: x86_64

Module: Reporting
Version: 0.10.0
Module: PDF Export
Version: 0.9.1
Module: IDO Reports
Version: 0.9.1
rpm -qa | grep chrome
google-chrome-stable-90.0.4430.93-1.x86_64

Is there anything missing or should i need to edit some .php files to get the result

Any help is appreciated
Best Regards

Hi,

you have installed the master of the reporting module. In that case you have to also use the master of the pdfexport module.

1 Like

Thanks @nilmerg for the reply

Thats working in reports But in graphite graphs are not coming in pdf file only empty boxes are coming.

Regards

Ah, that’s a known issue but we don’t know the reason for it yet. If you now have the latest master of the pdfexport module, you should probably see some errors in the debug log related to that. Please share these with us here, if there are any.

HI @nilmerg

Unfortunately i am not getting any errors in the debug logs

Regards

:frowning:

Then please tell me on which OS you’ve installed which chrome/chromium version. (also, from which package source) Please be exact as possible, I didn’t have the chance to reproduce this myself yet.

edit: Ooops, didn’t take a look at the OP again :roll_eyes:

Mhm, Centos 7 doesn’t seem to provide a package for chrome. How did you install chrome exactly?

Hi @nilmerg

I’ve installed google-chrome-stable using EPEL following steps mentioned in the installation doc

Best Regards

Damn. Hoped you’re using an exotic installation guide or such :sweat_smile:

Well, I setup a docker centos:7 container this morning and installed chrome using our installation instructions.

This installs, according to rpm -qa | grep chrome, the following: google-chrome-stable-90.0.4430.212-1.x86_64

That’s almost the same version you’ve got, though I’m not quite familiar with how google chrome versions work. You’ve got 90.0.4430.93, not 90.0.4430.212.

The thing is, for me graphite graphs show up fine in pdf exports. Could you maybe try updating your google chrome and see if it works then?

No luck! :neutral_face:

Just now i updated to same version of yours.Still same

Well, would have been too easy anyway :roll_eyes:

I assume you didn’t configure the pdfexport module to use a remote instance of google chrome. I’d like you to try this as well, in order to check if it makes a difference.

To set this up, go to ConfigurationModulespdfexportChrome (Tab). There define 127.0.0.1 as remote host and leave the default port.

Then launch google chrome manually using the following commandline: google-chrome --remote-debugging-address=127.0.0.1 --remote-debugging-port=9222 --headless --keep-alive-for-test --disable-gpu --disable-dev-shm-usage --no-sandbox --bwsi --no-first-run --user-data-dir=/tmp --homedir=/tmp

The browser should then keep running and give output similar to this: DevTools listening on ws://127.0.0.1:9222/devtools/browser/726847aa-14cf-4189-8d30-3d70c588d565

Then start the export again and check the result.

Oh and please include the debug log that’s the result of this in any case. I’d like to see something like the following:

NOTICE: PHP message: icingaweb2: DEBUG - Transmitting CDP call: Target.createTarget(url)
NOTICE: PHP message: icingaweb2: DEBUG - Received CDP result: targetId
NOTICE: PHP message: icingaweb2: DEBUG - Transmitting CDP call: Log.enable()
NOTICE: PHP message: icingaweb2: DEBUG - Received CDP result: none
NOTICE: PHP message: icingaweb2: DEBUG - Transmitting CDP call: Network.enable()
NOTICE: PHP message: icingaweb2: DEBUG - Received CDP result: none
NOTICE: PHP message: icingaweb2: DEBUG - Transmitting CDP call: Page.enable()
NOTICE: PHP message: icingaweb2: DEBUG - Received CDP result: none
NOTICE: PHP message: icingaweb2: DEBUG - Transmitting CDP call: Console.enable()
NOTICE: PHP message: icingaweb2: DEBUG - Received CDP result: none
NOTICE: PHP message: icingaweb2: DEBUG - Transmitting CDP call: Page.setDocumentContent(frameId,html)
NOTICE: PHP message: icingaweb2: DEBUG - Received CDP event: Page.documentOpened(frame={"id":"3663F5C8A7F8BB9B9B191C045439F07D","loaderId":"9357875934821045222C944AB98E1742","url":"about:blank","domainAndRegistry":"","securityOrigin":":\/\/","mimeType":"text\/html","adFrameType":"none","secureContextType":"InsecureScheme","crossOriginIsolatedContextType":"NotIsolated","gatedAPIFeatures":["SharedArrayBuffers","SharedArrayBuffersTransferAllowed"]})
NOTICE: PHP message: icingaweb2: DEBUG - Received CDP event: Network.requestWillBeSent(requestId="644.1",loaderId="9357875934821045222C944AB98E1742",documentURL="about:blank",request={"url":"http:\/\/localhost\/icingaweb2\/public\/img\/icinga-logo-big-dark.png","method":"GET","headers":{"sec-ch-ua":"","Referer":"","sec-ch-ua-mobile":"?0","User-Agent":"Mozilla\/5.0 (X11; Linux x86_64) AppleWebKit\/537.36 (KHTML, like Gecko) HeadlessChrome\/90.0.4430.212 Safari\/537.36"},"mixedContentType":"none","initialPriority":"Low","referrerPolicy":"strict-origin-when-cross-origin"},timestamp=2556.020359,wallTime=1620713836.916623,initiator={"type":"parser","url":"about:blank","lineNumber":46365,"columnNumber":15},type="Image",frameId="3663F5C8A7F8BB9B9B191C045439F07D",hasUserGesture=false)
NOTICE: PHP message: icingaweb2: DEBUG - Received CDP event: Network.requestWillBeSent(requestId="644.2",loaderId="9357875934821045222C944AB98E1742",documentURL="about:blank",request={"url":"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAV4AAADICAIAAAAvAR6nAAAABmJLR0QA\/wD\/AP+gvaeTAAAX1UlE%0AQVR4nO3de1xUZf4H8O+ZO3MDHEAZFUFuGlgphCDkJdcspbCLppW\/1nZJV91XN90NTNYiy03NxMuu%0AGGW31yttX2tReQv7ZW4ZKikqoiaIkCgXheEyMHNm5vz+ODo7P2ZkkBlBD5\/3X8fvPM\/MM\/OKb+c8...","method":"GET","headers":{"Referer":"","User-Agent":"Mozilla\/5.0 (X11; Linux x86_64) AppleWebKit\/537.36 (KHTML, like Gecko) HeadlessChrome\/90.0.4430.212 Safari\/537.36"},"mixedContentType":"none","initialPriority":"Low","referrerPolicy":"strict-origin-when-cross-origin"},timestamp=2556.020788,wallTime=1620713836.917052,initiator={"type":"parser","url":"about:blank","lineNumber":46365,"columnNumber":15},type="Image",frameId="3663F5C8A7F8BB9B9B191C045439F07D",hasUserGesture=false)
NOTICE: PHP message: icingaweb2: DEBUG - Received CDP event: Network.requestServedFromCache(requestId="644.2")
NOTICE: PHP message: icingaweb2: DEBUG - Received CDP event: Network.responseReceived(requestId="644.2",loaderId="9357875934821045222C944AB98E1742",timestamp=2556.020903,type="Image",response={"url":"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAV4AAADICAIAAAAvAR6nAAAABmJLR0QA\/wD\/AP+gvaeTAAAX1UlE%0AQVR4nO3de1xUZf4H8O+ZO3MDHEAZFUFuGlgphCDkJdcspbCLppW\/1nZJV91XN90NTNYiy03NxMuu%0AGGW31yttX2tReQv7ZW4ZKikqoiaIkCgXheEyMHNm5vz+ODo7P2ZkkBlBD5\/3X8fvPM\/MM\/OKb+c8...","status":200,"statusText":"OK","headers":{"Content-Type":"image\/png"},"mimeType":"image\/png","connectionReused":false,"connectionId":0,"fromDiskCache":false,"fromServiceWorker":false,"fromPrefetchCache":false,"encodedDataLength":0,"protocol":"data","securityState":"unknown"},frameId="3663F5C8A7F8BB9B9B191C045439F07D")
NOTICE: PHP message: icingaweb2: DEBUG - Received CDP event: Network.dataReceived(requestId="644.2",timestamp=2556.020917,dataLength=6176,encodedDataLength=0)
NOTICE: PHP message: icingaweb2: DEBUG - Received CDP event: Network.loadingFinished(requestId="644.2",timestamp=2556.020918,encodedDataLength=0,shouldReportCorbBlocking=false)
NOTICE: PHP message: icingaweb2: DEBUG - Received CDP event: Network.requestWillBeSent(requestId="644.3",loaderId="9357875934821045222C944AB98E1742",documentURL="about:blank",request={"url":"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAV4AAADICAIAAAAvAR6nAAAABmJLR0QA\/wD\/AP+gvaeTAAAO1ElE%0AQVR4nO3deUxUV\/\/H8TMz7AzDDCgCNYKs1qJUQUEJbgUxaupg3RpsEBO0KcRScQOrVikuRUEJgmjU%0AVNOkS6qtSeuGTatpK20JQUVrq1StC6sIKogww++P+3smPCwz9hGhA+\/XX+d+7+dc70zk5M7MvecI...","method":"GET","headers":{"Referer":"","User-Agent":"Mozilla\/5.0 (X11; Linux x86_64) AppleWebKit\/537.36 (KHTML, like Gecko) HeadlessChrome\/90.0.4430.212 Safari\/537.36"},"mixedContentType":"none","initialPriority":"Low","referrerPolicy":"strict-origin-when-cross-origin"},timestamp=2556.0211,wallTime=1620713836.917364,initiator={"type":"parser","url":"about:blank","lineNumber":46365,"columnNumber":15},type="Image",frameId="3663F5C8A7F8BB9B9B191C045439F07D",hasUserGesture=false)
NOTICE: PHP message: icingaweb2: DEBUG - Received CDP event: Network.requestServedFromCache(requestId="644.3")
NOTICE: PHP message: icingaweb2: DEBUG - Received CDP event: Network.responseReceived(requestId="644.3",loaderId="9357875934821045222C944AB98E1742",timestamp=2556.021161,type="Image",response={"url":"data:image\/png;base64,iVBORw0KGgoAAAANSUhEUgAAAV4AAADICAIAAAAvAR6nAAAABmJLR0QA\/wD\/AP+gvaeTAAAO1ElE%0AQVR4nO3deUxUV\/\/H8TMz7AzDDCgCNYKs1qJUQUEJbgUxaupg3RpsEBO0KcRScQOrVikuRUEJgmjU%0AVNOkS6qtSeuGTatpK20JQUVrq1StC6sIKogww++P+3smPCwz9hGhA+\/XX+d+7+dc70zk5M7MvecI...","status":200,"statusText":"OK","headers":{"Content-Type":"image\/png"},"mimeType":"image\/png","connectionReused":false,"connectionId":0,"fromDiskCache":false,"fromServiceWorker":false,"fromPrefetchCache":false,"encodedDataLength":0,"protocol":"data","securityState":"unknown"},frameId="3663F5C8A7F8BB9B9B191C045439F07D")
NOTICE: PHP message: icingaweb2: DEBUG - Received CDP event: Network.dataReceived(requestId="644.3",timestamp=2556.021173,dataLength=3871,encodedDataLength=0)
NOTICE: PHP message: icingaweb2: DEBUG - Received CDP event: Network.loadingFinished(requestId="644.3",timestamp=2556.021175,encodedDataLength=0,shouldReportCorbBlocking=false)
NOTICE: PHP message: icingaweb2: DEBUG - Received CDP event: Network.requestWillBeSent(requestId="644.44",loaderId="9357875934821045222C944AB98E1742",documentURL="about:blank",request={"url":"http:\/\/localhost\/img\/icinga-loader.gif","method":"GET","headers":{"sec-ch-ua":"","Referer":"","sec-ch-ua-mobile":"?0","User-Agent":"Mozilla\/5.0 (X11; Linux x86_64) AppleWebKit\/537.36 (KHTML, like Gecko) HeadlessChrome\/90.0.4430.212 Safari\/537.36"},"mixedContentType":"none","initialPriority":"Low","referrerPolicy":"strict-origin-when-cross-origin"},timestamp=2556.032279,wallTime=1620713836.928543,initiator={"type":"parser","url":"about:blank","lineNumber":46365,"columnNumber":15},type="Image",frameId="3663F5C8A7F8BB9B9B191C045439F07D",hasUserGesture=false)
NOTICE: PHP message: icingaweb2: DEBUG - Received CDP event: Page.domContentEventFired(timestamp=2556.033097)
NOTICE: PHP message: icingaweb2: DEBUG - Received CDP result: none
NOTICE: PHP message: icingaweb2: DEBUG - Received CDP event: Network.resourceChangedPriority(requestId="644.44",newPriority="High",timestamp=2556.040863)
NOTICE: PHP message: icingaweb2: DEBUG - Received CDP event: Network.resourceChangedPriority(requestId="644.1",newPriority="High",timestamp=2556.040874)
NOTICE: PHP message: icingaweb2: DEBUG - Received CDP event: Network.loadingFailed(requestId="644.1",timestamp=2556.079289,type="Image",errorText="net::ERR_CONNECTION_REFUSED",canceled=false)
NOTICE: PHP message: icingaweb2: ERROR - Headless Chrome was unable to complete a request to "http://localhost/icingaweb2/public/img/icinga-logo-big-dark.png". Error: net::ERR_CONNECTION_REFUSED
NOTICE: PHP message: icingaweb2: DEBUG - Received CDP event: Log.entryAdded(entry={"source":"network","level":"error","text":"Failed to load resource: net::ERR_CONNECTION_REFUSED","timestamp":1620713836975.5608,"url":"http:\/\/localhost\/icingaweb2\/public\/img\/icinga-logo-big-dark.png","networkRequestId":"644.1"})
NOTICE: PHP message: icingaweb2: DEBUG - Received CDP event: Network.loadingFailed(requestId="644.44",timestamp=2556.079452,type="Image",errorText="net::ERR_CONNECTION_REFUSED",canceled=false)
NOTICE: PHP message: icingaweb2: ERROR - Headless Chrome was unable to complete a request to "http://localhost/img/icinga-loader.gif". Error: net::ERR_CONNECTION_REFUSED
NOTICE: PHP message: icingaweb2: DEBUG - Transmitting CDP call: Page.printToPDF(headerTemplate,footerTemplate,transferMode,printBackground)
NOTICE: PHP message: icingaweb2: DEBUG - Received CDP event: Log.entryAdded(entry={"source":"network","level":"error","text":"Failed to load resource: net::ERR_CONNECTION_REFUSED","timestamp":1620713836975.719,"url":"http:\/\/localhost\/img\/icinga-loader.gif","networkRequestId":"644.44"})
NOTICE: PHP message: icingaweb2: DEBUG - Received CDP event: Page.loadEventFired(timestamp=2556.07958)
NOTICE: PHP message: icingaweb2: DEBUG - Received CDP event: Page.frameResized()
NOTICE: PHP message: icingaweb2: DEBUG - Received CDP event: Page.frameResized()
NOTICE: PHP message: icingaweb2: DEBUG - Received CDP result: data
NOTICE: PHP message: icingaweb2: DEBUG - Transmitting CDP call: Target.closeTarget(targetId)
NOTICE: PHP message: icingaweb2: DEBUG - Received CDP result: success
NOTICE: PHP message: icingaweb2: DEBUG - Failed to close browser connection: 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}

Hi

[0511/100604.206450:ERROR:gpu_init.cc(426)] Passthrough is not supported, GL is egl
this is the error i am getting
can you please tell me how to enable debug log for icingaweb2

Regards

That error is not a problem. I get that as well.

To enable debug log, just head over to ConfigurationApplication and set the log level there to debug.

Hi @nilmerg

enabled it .But nothing generated in debug logs

Are you using syslog? You probably need to enable debug logs for syslog then as well.

Yes syslogs also enabled

Not sure why it is not generating any logs

Anyway it is ok for now at least i am getting graphs for the reports.

Okay. Though I had hoped to get an insight what’s going wrong here. But thanks anyway for trying!

I will check on this and update you if I found any workaround

Thanks for your great help :slightly_smiling_face:

Thanks and regards