Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Kibana reporting error : spawn EACCES #15459

Closed
jsdumont opened this issue Dec 6, 2017 · 10 comments
Closed

Kibana reporting error : spawn EACCES #15459

jsdumont opened this issue Dec 6, 2017 · 10 comments
Assignees
Labels
Team:Operations Team label for Operations Team

Comments

@jsdumont
Copy link

jsdumont commented Dec 6, 2017

Kibana version: 5.6.2

Elasticsearch version: 5.6.2

Server OS version: Centos7

Browser version: Chrome Version 62.0.3202.94 (Official Build) (64-bit)

Browser OS version: 2012 R2

Original install method (e.g. download page, yum, from source, etc.): RPM

Description of the problem including expected versus actual behavior: Unable to display report in Kibana

Steps to reproduce:

  1. Select a dashboard
  2. Click on reporting
  3. Generate PDF
  4. Management -> Reporting : failed - Error: spawn EACCES

Errors in browser console (if relevant):There was an error generating your report for the "blah blah blah" dashboard: Error: spawn EACCES

Provide logs and/or server output (if relevant):
Dec 6 10:22:44 kibana: Unhandled rejection Error: spawn EACCES
Dec 6 10:22:44 kibana: at exports._errnoException (util.js:1018:11)
Dec 6 10:22:44 kibana: at ChildProcess.spawn (internal/child_process.js:319:11)
Dec 6 10:22:44 kibana: at exports.spawn (child_process.js:378:9)
Dec 6 10:22:44 kibana: at spawnPhantom (/usr/share/kibana/plugins/x-pack/node_modules/@elastic/node-phantom-simple/node-phantom-simple.js:143:19)
Dec 6 10:22:44 kibana: at Object.exports.create (/usr/share/kibana/plugins/x-pack/node_modules/@elastic/node-phantom-simple/node-phantom-simple.js:283:3)
Dec 6 10:22:44 kibana: at Phantom.cb (/usr/share/kibana/plugins/x-pack/plugins/reporting/server/lib/phantom/index.js:67:43)
Dec 6 10:22:44 kibana: at tryCatcher (/usr/share/kibana/plugins/x-pack/node_modules/bluebird/js/release/util.js:11:23)
Dec 6 10:22:44 kibana: at Promise.fromNode.Promise.fromCallback (/usr/share/kibana/plugins/x-pack/node_modules/bluebird/js/release/promise.js:173:30)
Dec 6 10:22:44 kibana: at new Phantom (/usr/share/kibana/plugins/x-pack/plugins/reporting/server/lib/phantom/index.js:67:17)
Dec 6 10:22:44 kibana: at Object.create (/usr/share/kibana/plugins/x-pack/plugins/reporting/server/lib/phantom/index.js:59:12)
Dec 6 10:22:44 kibana: at Promise.resolve.then.port (/usr/share/kibana/plugins/x-pack/plugins/reporting/export_types/printable_pdf/server/lib/screenshot.js:60:20)
Dec 6 10:22:44 kibana: at process._tickDomainCallback (internal/process/next_tick.js:135:7)

NOTE: I had to run this because the owner was root:root.
chown -R kibana:kibana /usr/share/kibana/plugins/
chown -R kibana:kibana /usr/share/kibana/optimize/bundles

Describe the feature:

@jbudz
Copy link
Member

jbudz commented Dec 6, 2017

Thanks for filling, we're tracking this #8818 so I'm going to close this out to avoid discussions diverging.

Currently we recommend running plugin installs as the kibana user, sudo -u kibana bin/kibana-plugin install x-pack. In the recovery case above you'll likely also have to make sure the phantom bin is owned by kibana, chown -R kibana:kibana /var/lib/kibana

@jbudz jbudz closed this as completed Dec 6, 2017
@jsdumont
Copy link
Author

jsdumont commented Dec 6, 2017

Hi Jonathan, the phantom bin is already own by the kibana user

@jsdumont
Copy link
Author

jsdumont commented Dec 6, 2017

but still not working

@jbudz
Copy link
Member

jbudz commented Dec 6, 2017

Ah I see. Can you enable verbose logging in kibana.yml with logging.verbose: true and see if anything relating to reporting stands out?

@jbudz jbudz reopened this Dec 6, 2017
@jbudz jbudz added feedback_needed Team:Operations Team label for Operations Team labels Dec 6, 2017
@jsdumont
Copy link
Author

jsdumont commented Dec 7, 2017

  • {"type":"log","@timestamp":"2017-12-07T12:40:15Z","tags":["reporting","debug"],"pid":65004,"message":"fetching screenshot of https://serverIP:443/app/kibana#/dashboard/AWASikmHEijrab1tWLFw?_g=()&_a=(description:'',filters:!(),options:(darkTheme:!t),panels:!((col:1,id:AWAP5vj7Eijrab1tWLDY,panelIndex:1,row:1,size_x:6,size_y:3,type:visualization),(col:7,id:AWAP4XcfEijrab1tWLDX,panelIndex:2,row:1,size_x:6,size_y:3,type:visualization)),query:(match_all:()),timeRestore:!f,title:'Firewall%20-%20attacks',uiState:(),viewMode:view)"}
  • {"type":"log","@timestamp":"2017-12-07T12:40:15Z","tags":["reporting","debug"],"pid":65004,"level":"error","message":"spawn EACCES","error":{"message":"spawn EACCES","name":"Error","stack":"Error: spawn EACCES\n at exports._errnoException (util.js:1018:11)\n at ChildProcess.spawn (internal/child_process.js:319:11)\n at exports.spawn (child_process.js:378:9)\n at spawnPhantom (/usr/share/kibana/plugins/x-pack/node_modules/@elastic/node-phantom-simple/node-phantom-simple.js:143:19)\n at Object.exports.create (/usr/share/kibana/plugins/x-pack/node_modules/@elastic/node-phantom-simple/node-phantom-simple.js:283:3)\n at Phantom.cb (/usr/share/kibana/plugins/x-pack/plugins/reporting/server/lib/phantom/index.js:67:43)\n at tryCatcher (/usr/share/kibana/plugins/x-pack/node_modules/bluebird/js/release/util.js:11:23)\n at Promise.fromNode.Promise.fromCallback (/usr/share/kibana/plugins/x-pack/node_modules/bluebird/js/release/promise.js:173:30)\n at new Phantom (/usr/share/kibana/plugins/x-pack/plugins/reporting/server/lib/phantom/index.js:67:17)\n at Object.create (/usr/share/kibana/plugins/x-pack/plugins/reporting/server/lib/phantom/index.js:59:12)\n at Promise.resolve.then.port (/usr/share/kibana/plugins/x-pack/plugins/reporting/export_types/printable_pdf/server/lib/screenshot.js:60:20)\n at process._tickDomainCallback (internal/process/next_tick.js:135:7)","code":"EACCES"}}

@jsdumont
Copy link
Author

jsdumont commented Dec 7, 2017

  • Dec 7 07:34:47 serverName systemd: Starting Kibana...
  • Dec 7 07:40:15 serverName kibana: Unhandled rejection Error: spawn EACCES
  • Dec 7 07:40:15 serverName kibana: at exports._errnoException (util.js:1018:11)
  • Dec 7 07:40:15 serverName kibana: at ChildProcess.spawn (internal/child_process.js:319:11)
  • Dec 7 07:40:15 serverName kibana: at exports.spawn (child_process.js:378:9)
  • Dec 7 07:40:15 serverName kibana: at spawnPhantom (/usr/share/kibana/plugins/x-pack/node_modules/@elastic/node-phantom-simple/node-phantom-simple.js:143:19)
  • Dec 7 07:40:15 serverName kibana: at Object.exports.create (/usr/share/kibana/plugins/x-pack/node_modules/@elastic/node-phantom-simple/node-phantom-simple.js:283:3)
  • Dec 7 07:40:15 serverName kibana: at Phantom.cb (/usr/share/kibana/plugins/x-pack/plugins/reporting/server/lib/phantom/index.js:67:43)
  • Dec 7 07:40:15 serverName kibana: at tryCatcher (/usr/share/kibana/plugins/x-pack/node_modules/bluebird/js/release/util.js:11:23)
  • Dec 7 07:40:15 serverName kibana: at Promise.fromNode.Promise.fromCallback (/usr/share/kibana/plugins/x-pack/node_modules/bluebird/js/release/promise.js:173:30)
  • Dec 7 07:40:15 serverName kibana: at new Phantom (/usr/share/kibana/plugins/x-pack/plugins/reporting/server/lib/phantom/index.js:67:17)
  • Dec 7 07:40:15 serverName kibana: at Object.create (/usr/share/kibana/plugins/x-pack/plugins/reporting/server/lib/phantom/index.js:59:12)
  • Dec 7 07:40:15 serverName kibana: at Promise.resolve.then.port (/usr/share/kibana/plugins/x-pack/plugins/reporting/export_types/printable_pdf/server/lib/screenshot.js:60:20)
  • Dec 7 07:40:15 serverName kibana: at process._tickDomainCallback (internal/process/next_tick.js:135:7)

@tsullivan
Copy link
Member

Hi, do we have any updates on this? I'd like to get it closed if it is no longer applicable.

@tsullivan tsullivan self-assigned this Dec 13, 2018
@jbudz
Copy link
Member

jbudz commented Dec 13, 2018

recap:
kibana needs the execute bit set for phantomjs to run reports. for packages, these files are run as user kibana. everything should be simplified now that reporting is included in the default kibana distribution, the post install script will chown the data folder and the server will run extraction the first time it starts

if there's issues, usually double checking permissions is a good start. that includes other restrictions like apparmor, selinux, and noexec.

deb and rpm packages install phantom to /var/lib/kibana. tar and zips install to the data folder inside kibana.

I think we're good closing for now and we can reopen if there's more comments (sorry about the late reply jsdumont, hope things are working now)

@tsullivan
Copy link
Member

Thanks @jbudz! I like the suggestion about checking file permission on the binary

@tsullivan
Copy link
Member

Closing for a meta-issue on having Reporting do better in self-diagnosing problems: https://github.com/elastic/dev/issues/1087

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Team:Operations Team label for Operations Team
Projects
None yet
Development

No branches or pull requests

3 participants