# Getting HeadlessError: ECONNREFUSED when trying to generate PDF report from Kibana

**URL:** <https://discuss.elastic.co/t/getting-headlesserror-econnrefused-when-trying-to-generate-pdf-report-from-kibana/222773>\
**Category:** Kibana\
**Created:** [March 9, 2020, 5:43pm UTC](https://discuss.elastic.co/t/getting-headlesserror-econnrefused-when-trying-to-generate-pdf-report-from-kibana/222773 "2020-03-09T17:43:55Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![preetish\_P](https://avatars.discourse-cdn.com/v4/letter/p/77aa72/32.png) [@preetish\_P](https://discuss.elastic.co/u/preetish_P)\
**Post date:** [March 9, 2020, 5:43pm UTC](https://discuss.elastic.co/t/getting-headlesserror-econnrefused-when-trying-to-generate-pdf-report-from-kibana/222773/1 "2020-03-09T17:43:56Z")

</div>

Hi Team,

I am trying to generate PDF reports on Kibana and while doing so I am getting the below error:

_HeadlessError: Request() error evaluating createPage() call: Error: connect ECONNREFUSED 127.0.0.1:33395_

We are running all 3 components of ELK stack(v6.8) on the same LPAR (hence firewall issues out of question?)

I followed various remedies mentioned in forums. I have added correct values for below parameters in kibana.yml :

xpack.reporting.kibanaServer.port :  
xpack.reporting.kibanaServer.hostname :  
server.ssl.enabled: true  
server.ssl.certificate:  
server.ssl.key:  
elasticsearch.ssl.certificateAuthorities:  
xpack.reporting.encryptionKey:  
xpack.security.encryptionKey:

After triggering PDF generation, I checked for the phantomjs process which is spawned:

_/var/lib/kibana/phantomjs-2.1.1-linux-x86\_64/bin/phantomjs --load-images=true --ssl-protocol=any --ignore-ssl-errors=true /usr/share/kibana/node\_modules/@elastic/node-phantom-simple/bridge.js 127.0.0.1 33761_

I cannot understand why the phantomjs process is still picking up localhost. I looked for all settings, but could not understand what decides the host (A random port is used for every attempt I believe)

Can you please suggest, what I am missing here.

---

<div class="post-metadata">

**Author:** ![Marius\_Dragomir](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marius_dragomir/32/42087_2.png) [@Marius\_Dragomir](https://discuss.elastic.co/u/Marius_Dragomir)\
**Post date:** [March 12, 2020, 3:40pm UTC](https://discuss.elastic.co/t/getting-headlesserror-econnrefused-when-trying-to-generate-pdf-report-from-kibana/222773/2 "2020-03-12T15:40:30Z")

</div>

Can you try setting the `xpack.reporting.capture.browser.type` key in kibana.yml to Chromium? Phantom.js isn't supported any longer and it was deprecated in 6.8.

---

<div class="post-metadata">

**Author:** ![preetish\_P](https://avatars.discourse-cdn.com/v4/letter/p/77aa72/32.png) [@preetish\_P](https://discuss.elastic.co/u/preetish_P)\
**Post date:** [March 19, 2020, 12:42pm UTC](https://discuss.elastic.co/t/getting-headlesserror-econnrefused-when-trying-to-generate-pdf-report-from-kibana/222773/3 "2020-03-19T12:42:44Z")

</div>

Hi @Marius_Dragomir

I added `xpack.reporting.capture.browser.type` key in kibana.yml and now I am getting the below error:

```auto
Error: Error spawning Chromium browser: Error: Failed to launch chrome! /var/lib/kibana/headless_shell-linux/headless_shell: /lib64/libc.so.6: version `GLIBC_2.14' not found (required by /var/lib/kibana/headless_shell-linux/headless_shell) /var/lib/kibana/headless_shell-linux/headless_shell: /lib64/libc.so.6: version `GLIBC_2.15' not found (required by /var/lib/kibana/headless_shell-linux/headless_shell) /var/lib/kibana/headless_shell-linux/headless_shell: /lib64/libc.so.6: version `GLIBC_2.16' not found (required by /var/lib/kibana/headless_shell-linux/headless_shell) TROUBLESHOOTING: https://github.com/GoogleChrome/puppeteer/blob/master/docs/troubleshooting.md

```

So now I am trying to follow steps mentioned in the below page:  
[https://www.elastic.co/guide/en/kibana/master/reporting-troubleshooting.html](https://www.elastic.co/guide/en/kibana/master/reporting-troubleshooting.html)

However ports 80 and 443 are blocked on the LPAR, hence I have to manually download rpm packages and the list of dependencies keep on growing 🙄 (already downloaded 20+ rpms).

Will install all the packages and re-try.

Thanks

---

<div class="post-metadata">

**Author:** ![preetish\_P](https://avatars.discourse-cdn.com/v4/letter/p/77aa72/32.png) [@preetish\_P](https://discuss.elastic.co/u/preetish_P)\
**Post date:** [April 8, 2020, 1:00pm UTC](https://discuss.elastic.co/t/getting-headlesserror-econnrefused-when-trying-to-generate-pdf-report-from-kibana/222773/4 "2020-04-08T13:00:06Z")

</div>

Hi @Marius_Dragomir,

I installed all the dependencies listed on the troubleshooting page. Then I ran the below command to check dependencies of chromium browser.  
` ldd headless_shell |grep not`

which returned the below missing dependencies:

```auto
./headless_shell: /lib64/libc.so.6: version `GLIBC_2.14' not found (required by ./headless_shell)

./headless_shell: /lib64/libc.so.6: version `GLIBC_2.15' not found (required by ./headless_shell)

./headless_shell: /lib64/libc.so.6: version `GLIBC_2.16' not found (required by ./headless_shell)

```

However, I am using RHEL6.5 and could not find a straightforward method to update libraries (without risking the environment's integrity).  
Do you recommend to go down this path? or is this functionality only supposed to work with RHEL7+ ?

Thanks

---

<div class="post-metadata">

**Author:** ![Marius\_Dragomir](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marius_dragomir/32/42087_2.png) [@Marius\_Dragomir](https://discuss.elastic.co/u/Marius_Dragomir)\
**Post date:** [April 15, 2020, 11:23am UTC](https://discuss.elastic.co/t/getting-headlesserror-econnrefused-when-trying-to-generate-pdf-report-from-kibana/222773/5 "2020-04-15T11:23:08Z")

</div>

Sadly starting with Kibana 7.0.0 we dropped support for CentOS/RHEL 6, so you'll have to update the libraries manually. I know it might be risky, so I'd suggest just using a kibana docker container in your OS, as it would be simpler and safer.

---

<div class="post-metadata">

**Author:** ![preetish\_P](https://avatars.discourse-cdn.com/v4/letter/p/77aa72/32.png) [@preetish\_P](https://discuss.elastic.co/u/preetish_P)\
**Post date:** [April 15, 2020, 5:32pm UTC](https://discuss.elastic.co/t/getting-headlesserror-econnrefused-when-trying-to-generate-pdf-report-from-kibana/222773/6 "2020-04-15T17:32:26Z")

</div>

Hi @Marius_Dragomir,

I am using Kibana v6.8

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [May 13, 2020, 5:32pm UTC](https://discuss.elastic.co/t/getting-headlesserror-econnrefused-when-trying-to-generate-pdf-report-from-kibana/222773/7 "2020-05-13T17:32:35Z")

</div>

This topic was automatically closed 28 days after the last reply. New replies are no longer allowed.
