Installed Kibana 5. Can only run as root

If I run as root everything works fine. If I do not run as root I get the following error:

/usr/share/kibana/bin/../node/bin/node /usr/share/kibana/bin/../src/cli -c /etc/kibana/kibana.yml
const cares = process.binding('cares_wrap');
Error: EFILE
at Error (native)
at net.js:10:23
at NativeModule.compile (bootstrap_node.js:497:7)
at NativeModule.require (bootstrap_node.js:438:18)
at tty.js:4:13
at NativeModule.compile (bootstrap_node.js:497:7)
at Function.NativeModule.require (bootstrap_node.js:438:18)
at Function.Module._load (module.js:426:25)
at Module.require (module.js:497:17)
at require (internal/module.js:20:19)

What method did you use to install kibana? apt, yum, binary? Did you install fresh, or was it an upgrade? Lastly, what command are you executing to run kibana?

We also met this issue, and we install kibana from fresh with yum.
The command to run kibana is
systemctl start kibana

kibana-5.2.1-x86_64.rpm fresh install using yum via our own repository

The command I use is in the original post. It's the same command that runs when you start it via a service interface. Ultimately that's what I want it to do (run as a service):

/usr/share/kibana/bin/../node/bin/node /usr/share/kibana/bin/../src/cli -c /etc/kibana/kibana.yml

The service won't start because of the same underlying issue. That's how I got here.

As a side note this is RHEL6 so systemd is not the service initialization engine (so your command to start the service won't work). It's still using sys-v.

As a side note to the side note, Logstash uses upstart on RHEL6 for no good reason. You'd think all three would start the same way. (different topic for a different thread perhaps)

Are you running that command as the kibana user?

Also, sysV should be available:

The sysv path is /etc/init.d/kibana

Sysv is available yes. I was replying to the post that said to use systemd.

EDIT: The kibana user exists. I am not trying to run the service with anything special in the config so ostensibly it's trying to run as kibana.


Here is the EXACT command I use to attempt to run kibana from the command line. It gives me the same error as when I try to run kibana as a service.

sudo -H -u kibana bash -c '/usr/share/kibana/bin/../node/bin/node /usr/share/kibana/bin/../src/cli -c /etc/kibana/kibana.yml'

Hmmm, I'm pretty much tapped for ideas. Honestly we haven't seen this particular error before. The error seems to be thrown by Node itself. Most references to the error I'm able to find involve Windows and dns issues. Is your machine's network locked down and perhaps blocking something node needs access to? Or maybe there's an odd DNS configuration?

You could also try updating to the latest version Kibana, we've bumped node versions since 5.2.1 so maybe it'll be fixed in the latest.

We're locked down tighter than a kettle drum here. I'd be happy to ease restrictions but first I need to know what is breaking. The stacktrace isn't exactly helpful, as you can see.

More info: I just verified that 4.x installs and works without issue, so this has something to do with the 5.x line needing something that 4.x doesn't.

Do you have the ability to list what Node is looking for? Just a general list is fine. I'll go item-by-item to chmod 777 and see what happens.

Since the error seems to originate from the net module you could try enabling debug logging on it by setting the NODE_DEBUG environment variable. Prepend your command with NODE_DEBUG=net. You can list the names of other internal modules there as well in a comma delimited list, if you want to cast a larger net.

If that doesn't help you could also try enabling node's remote debugger, set a breakpoint on the offending line and see if the error object contains any additional info beyond what's being printed in the console.

I had a similar thought.

I just ran a strace on /usr/share/kibana/bin/kibana with 0 arguments. Turns out node needs to be able to read /etc/resolv.conf (which was denied). Once I gave the kibana account read access everything worked!

Thank you for your patience and help.

Awesome, glad you got it figured out! Using strace is a good idea, I'll have to keep that in my back pocket.

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