Splunk Search

PDF Server Timed out while waiting for a response

mrenfr0
Explorer

I'm getting the error "Timed out while waiting for a response" when attempting to generate the test preview on the PDF Server App on Splunk 4.3. I'm baffled as to why this is the case, because, according to python.log, the pdf generation is successful.

2012-02-24 11:26:51,316 DEBUG cli_common:226 - Preloading from '/opt/splunk/var/run/splunk/merged/server.conf'.
2012-02-24 11:26:51,316 DEBUG Preloading from '/opt/splunk/var/run/splunk/merged/server.conf'.
2012-02-24 11:26:51,316 DEBUG cli_common:226 - Preloading from '/opt/splunk/var/run/splunk/merged/web.conf'.
2012-02-24 11:26:51,316 DEBUG Preloading from '/opt/splunk/var/run/splunk/merged/web.conf'.
2012-02-24 11:26:51,429 DEBUG cli_common:229 - Running btool for 'pdf_server.conf'.
2012-02-24 11:26:51,429 DEBUG Running btool for 'pdf_server.conf'.
2012-02-24 11:26:51,628 INFO pdfhandler:646 - Starting PDF App Renderer Version 1.3
2012-02-24 11:26:51,628 INFO Starting PDF App Renderer Version 1.3
2012-02-24 11:26:51,653 WARNING pdfhandler:458 - body=Splunk;4.3;4.3
2012-02-24 11:26:51,653 WARNING body=Splunk;4.3;4.3
2012-02-24 11:26:51,653 WARNING pdfhandler:459 - entries=['Splunk', '4.3', '4.3']
2012-02-24 11:26:51,653 WARNING entries=['Splunk', '4.3', '4.3']
2012-02-24 11:26:51,659 INFO xvfb:45 - Started new X server. Now 1 active
2012-02-24 11:26:51,659 INFO Started new X server. Now 1 active
2012-02-24 11:26:51,659 WARNING pdfhandler:551 - Restricting Firefox to following hosts only: *:53 127.0.0.1
2012-02-24 11:26:51,659 WARNING Restricting Firefox to following hosts only: *:53 127.0.0.1
2012-02-24 11:26:51,659 INFO pdfhandler:558 - Executing /opt/shared/etc/apps/pdfserver/bin/firefox-x86_64/firefox -print http://127.0.0.1:8000/debug/pdf_echo -printmode pdf -printfile /tmp/tmpIcXXwU -title http://127.0.0.1:8000/debug/pdf_echo -orientation portrait -paperwidth 216 -paperheight 279 -mode default -timeout 800 -windowsize 782x768 -cookie session_id_8000=8563e316a641141c2c0e630d599a0777b7e31e41
2012-02-24 11:26:51,659 INFO Executing /opt/shared/etc/apps/pdfserver/bin/firefox-x86_64/firefox -print http://127.0.0.1:8000/debug/pdf_echo -printmode pdf -printfile /tmp/tmpIcXXwU -title http://127.0.0.1:8000/debug/pdf_echo -orientation portrait -paperwidth 216 -paperheight 279 -mode default -timeout 800 -windowsize 782x768 -cookie session_id_8000=8563e316a641141c2c0e630d599a0777b7e31e41
2012-02-24 11:26:51,665 INFO xvfb:205 - Assigned DISPLAY :5
2012-02-24 11:26:51,665 INFO Assigned DISPLAY :5
2012-02-24 11:26:51,666 INFO xvfb:115 - Starting X Server: ['/usr/bin/Xvfb', ':5', '-screen', '0', '3000x768x24', '-nolisten', 'tcp']
2012-02-24 11:26:51,666 INFO Starting X Server: ['/usr/bin/Xvfb', ':5', '-screen', '0', '3000x768x24', '-nolisten', 'tcp']
2012-02-24 11:26:51,666 INFO xvfb:116 - Starting X Server env: {'XAUTHORITY': '/opt/splunk/var/run/splunk/xvfb/xauth-5/Xauthority'}
2012-02-24 11:26:51,666 INFO Starting X Server env: {'XAUTHORITY': '/opt/splunk/var/run/splunk/xvfb/xauth-5/Xauthority'}
2012-02-24 11:26:53,669 INFO xvfb:122 - X Started
2012-02-24 11:26:53,669 INFO X Started
2012-02-24 11:27:12,751 INFO pdfhandler:628 - Generated pdf file. bytes=8802 time=19.08
2012-02-24 11:27:12,751 INFO Generated pdf file. bytes=8802 time=19.08
2012-02-24 11:27:12,761 DEBUG pdfhandler:746 - statuslog: ['startup', 'delayedshow', 'settings', 'print', 'success']
2012-02-24 11:27:12,761 DEBUG statuslog: ['startup', 'delayedshow', 'settings', 'print', 'success']
2012-02-24 11:27:12,761 WARNING xvfb:132 - Stopping X Server 5
2012-02-24 11:27:12,761 WARNING Stopping X Server 5

The only thing unusual about my setup is that the search heads are pooled. I've attempted to change the firefox_timeout variable in pdf_server.conf but that doesn't seem to have changed anything. I've also tried adding the suggested settings:

[settings]
screenshot_enabled = True
restrict_to_splunkweb = False

But I'm still getting the same result.

1 Solution

mrenfr0
Explorer

Yes, actually. I opened a case with splunk support and Rebecca had me change another timeout variable.

Edit this file:

$SPLUNK_HOME/lib/python2.7/site-packages/splunk/rest/__init__.py

And change :

SPLUNKD_CONNECTION_TIMEOUT from 30 to 300.

I still get the same timeout error during the PDF Server test page, but generating PDF reports like normal from a dashboard works just fine, which is all I need.

View solution in original post

stevenwr
Engager

Just to add we got the PDF server status page working by completing the above and then updating the timeout in:

$SPLUNK_HOME/lib/python2.7/site-packages/splunk/appserver/mrsparkle/controllers/debug.py

line 436: timeout = 20

You can check in the splunkd_access.log how long the "POST /services/pdfserver/renderpdf HTTP/1.1" requests take and pick a more suitable timeout for your environment.

melting
Splunk Employee
Splunk Employee

We are aware of some issues successfully rendering a PDF with PDF Server. File a case with customer support and we should be able to help you through then.

0 Karma

mrenfr0
Explorer

Yes, actually. I opened a case with splunk support and Rebecca had me change another timeout variable.

Edit this file:

$SPLUNK_HOME/lib/python2.7/site-packages/splunk/rest/__init__.py

And change :

SPLUNKD_CONNECTION_TIMEOUT from 30 to 300.

I still get the same timeout error during the PDF Server test page, but generating PDF reports like normal from a dashboard works just fine, which is all I need.

Vladimir
Path Finder

And another weird thing is everything works good for old search heads 4.2.x

0 Karma

Vladimir
Path Finder

It can weird but it's not working for me 🙂
I upgrade search heads to 4.3.1, remote pdf server is also on 4.3.1 but...

0 Karma

Vladimir
Path Finder

Thanks much, will try it.

0 Karma

Vladimir
Path Finder

I have the same issue, were you able to resolve it?

0 Karma
Get Updates on the Splunk Community!

New in Observability - Improvements to Custom Metrics SLOs, Log Observer Connect & ...

The latest enhancements to the Splunk observability portfolio deliver improved SLO management accuracy, better ...

Improve Data Pipelines Using Splunk Data Management

  Register Now   This Tech Talk will explore the pipeline management offerings Edge Processor and Ingest ...

3-2-1 Go! How Fast Can You Debug Microservices with Observability Cloud?

Register Join this Tech Talk to learn how unique features like Service Centric Views, Tag Spotlight, and ...