# Fail to start kibana, the kibana.pid file not accessable

**URL:** <https://discuss.elastic.co/t/fail-to-start-kibana-the-kibana-pid-file-not-accessable/92983>\
**Category:** Kibana\
**Created:** [July 13, 2017, 10:13am UTC](https://discuss.elastic.co/t/fail-to-start-kibana-the-kibana-pid-file-not-accessable/92983 "2017-07-13T10:13:22Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![jjuu](https://avatars.discourse-cdn.com/v4/letter/j/ecc23a/32.png) [@jjuu](https://discuss.elastic.co/u/jjuu)\
**Post date:** [July 13, 2017, 10:13am UTC](https://discuss.elastic.co/t/fail-to-start-kibana-the-kibana-pid-file-not-accessable/92983/1 "2017-07-13T10:13:22Z")

</div>

I installed kibana in AWS EC2 instance. It has problem to start.

The kibana.pid is in /var/run/. I have changed the mode of the directory to 777.

# ll -d /var/run

lrwxrwxrwx 1 root root 4 Jun 19 23:49 /var/run -\> /run/

# ll -d /run

drwxrwxrwx 31 root root 1160 Jul 13 10:03 /run/

But when I start it gave the log below, just could not access the pid file.

> {"type":"log","@timestamp":"2017-07-13T09:14:23Z","tags":["fatal"],"pid":24354,"level":"fatal","message":"EACCES: permission denied, open '/var/run/kibana.pid'","error":{"message":"EACCES: permission denied, open '/var/run/kibana.pid'","name":"Error","stack":"Error: EACCES: permission denied, open '/var/run/kibana.pid'\n at Error (native)","code":"EACCES"}}

I even tried to change the pid file location, but it performed as the same.

If change the owner of the kibana.pid, it failed to start either.

> {"type":"log","@timestamp":"2017-07-13T09:53:37Z","tags":["fatal"],"pid":31969,"level":"fatal","message":"listen EADDRNOTAVAIL 52.89.77.102:5601","error":{"message":"listen EADDRNOTAVAIL 52.89.77.102:5601","name":"Error","stack":"Error: listen EADDRNOTAVAIL 52.89.77.102:5601\n at Object.exports.\_errnoException (util.js:1018:11)\n at exports.\_exceptionWithHostPort (util.js:1041:20)\n at Server.\_listen2 (net.js:1249:19)\n at listen (net.js:1298:10)\n at net.js:1408:9\n at GetAddrInfoReqWrap.asyncCallback [as callback] (dns.js:62:16)\n at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:81:10)","code":"EADDRNOTAVAIL"}}  
> FATAL CLI ERROR Error: ENOENT: no such file or directory, unlink '/var/run/kibana.pid'  
> at Error (native)  
> at fs.unlinkSync (fs.js:1103:18)  
> at process. (/usr/share/kibana/src/server/pid/index.js:52:26)  
> at process. (/usr/share/kibana/node\_modules/lodash/index.js:7363:25)  
> at process.g (events.js:291:16)  
> at emitOne (events.js:101:20)  
> at process.emit (events.js:188:7)  
> at process.exit (internal/process.js:164:15)  
> at Command. (/usr/share/kibana/src/cli/serve/serve.js:138:17)  
> at throw (native)  
> at step (/usr/share/kibana/src/cli/serve/serve.js:25:191)  
> at /usr/share/kibana/src/cli/serve/serve.js:25:402

Can someone help please.

---

<div class="post-metadata">

**Author:** ![Bargs](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bargs/32/5429_2.png) [@Bargs](https://discuss.elastic.co/u/Bargs)\
**Post date:** [July 13, 2017, 4:09pm UTC](https://discuss.elastic.co/t/fail-to-start-kibana-the-kibana-pid-file-not-accessable/92983/2 "2017-07-13T16:09:58Z")

</div>

How did you originally install Kibana? What command are you using to start Kibana? Are you running Kibana as the kibana user?

---

<div class="post-metadata">

**Author:** ![jjuu](https://avatars.discourse-cdn.com/v4/letter/j/ecc23a/32.png) [@jjuu](https://discuss.elastic.co/u/jjuu)\
**Post date:** [July 14, 2017, 2:39am UTC](https://discuss.elastic.co/t/fail-to-start-kibana-the-kibana-pid-file-not-accessable/92983/3 "2017-07-14T02:39:35Z")

</div>

I used "/etc/init.d/kibana start" as root to start it.

> -rw-r--r-- 1 root root 6 Jul 14 02:35 /var/run/kibana.pid

The elasticsearch was started by elasticsearch user.

> -rw-r--r-- 1 elasticsearch elasticsearch 5 Jul 13 09:58 elasticsearch.pid

> kibana:x:114:119::/home/kibana:/bin/false  
> elasticsearch:x:115:120::/home/elasticsearch:/bin/false

I followed the step by step to start kibana, there should be a reason it failed.

---

<div class="post-metadata">

**Author:** ![Bargs](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bargs/32/5429_2.png) [@Bargs](https://discuss.elastic.co/u/Bargs)\
**Post date:** [July 14, 2017, 2:28pm UTC](https://discuss.elastic.co/t/fail-to-start-kibana-the-kibana-pid-file-not-accessable/92983/4 "2017-07-14T14:28:46Z")

</div>

It shouldn't be necessary to run kibana as root, you should be able to run it as the kibana user. What happens if you do so? Did you install via deb, RPM, or tar?

Also which version are you running?

---

<div class="post-metadata">

**Author:** ![gungazoo](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/gungazoo/32/19972_2.png) [@gungazoo](https://discuss.elastic.co/u/gungazoo)\
**Post date:** [July 14, 2017, 4:57pm UTC](https://discuss.elastic.co/t/fail-to-start-kibana-the-kibana-pid-file-not-accessable/92983/5 "2017-07-14T16:57:13Z")

</div>

I had an issue when I upgraded Kibana. It wanted to write the pid in /var/run/kibana/kibana.pid but the kibana directory under /var/run didn't exist. I created the directory and chown kibana:kibana and then it started fine.

Also, even if you start kibana as root inside the init script it might change who the service is running as.

You might try deleting by hand the existing pid file.

---

<div class="post-metadata">

**Author:** ![jjuu](https://avatars.discourse-cdn.com/v4/letter/j/ecc23a/32.png) [@jjuu](https://discuss.elastic.co/u/jjuu)\
**Post date:** [July 17, 2017, 1:58am UTC](https://discuss.elastic.co/t/fail-to-start-kibana-the-kibana-pid-file-not-accessable/92983/6 "2017-07-17T01:58:43Z")

</div>

I installed it via tar.  
The kibana user that is "/bin/false" cannot "su" it.

It continuly restart.

systemctl status kibana.service  
● kibana.service - Kibana  
Loaded: loaded (/etc/systemd/system/kibana.service; enabled; vendor preset: enabled)  
Active: activating (auto-restart) (Result: exit-code) since Mon 2017-07-17 02:16:08 UTC; 84ms ago  
Process: 25475 ExecStart=/usr/share/kibana/bin/kibana -c /etc/kibana/kibana.yml (code=exited, status=1/FAILURE)  
Main PID: 25475 (code=exited, status=1/FAILURE)

Jul 17 02:16:08 ip-172-31-6-106 systemd[1]: kibana.service: Main process exited, code=exited, status=1/FAILURE  
Jul 17 02:16:08 ip-172-31-6-106 systemd[1]: kibana.service: Unit entered failed state.  
Jul 17 02:16:08 ip-172-31-6-106 systemd[1]: kibana.service: Failed with result 'exit-code'.

---

<div class="post-metadata">

**Author:** ![jjuu](https://avatars.discourse-cdn.com/v4/letter/j/ecc23a/32.png) [@jjuu](https://discuss.elastic.co/u/jjuu)\
**Post date:** [July 17, 2017, 2:01am UTC](https://discuss.elastic.co/t/fail-to-start-kibana-the-kibana-pid-file-not-accessable/92983/7 "2017-07-17T02:01:47Z")

</div>

I chown it kibana:kibana, at the beginning it runs well, but after a while it stopped.

---

<div class="post-metadata">

**Author:** ![jjuu](https://avatars.discourse-cdn.com/v4/letter/j/ecc23a/32.png) [@jjuu](https://discuss.elastic.co/u/jjuu)\
**Post date:** [July 17, 2017, 3:13am UTC](https://discuss.elastic.co/t/fail-to-start-kibana-the-kibana-pid-file-not-accessable/92983/8 "2017-07-17T03:13:13Z")

</div>

I changed the mode of kibana.pid file to 777, and the owner of it to kibana:kibana.  
But still not work.

{"type":"log","@timestamp":"2017-07-13T09:53:37Z","tags":["fatal"],"pid":31969,"level":"fatal","message":"listen EADDRNOTAVAIL 52.89.77.102:5601","error":{"message":"listen EADDRNOTAVAIL 52.89.77.102:5601","name":"Error","stack":"Error: listen EADDRNOTAVAIL 52.89.77.102:5601\n at Object.exports.\_errnoException (util.js:1018:11)\n at exports.\_exceptionWithHostPort (util.js:1041:20)\n at Server.\_listen2 (net.js:1249:19)\n at listen (net.js:1298:10)\n at net.js:1408:9\n at GetAddrInfoReqWrap.asyncCallback [as callback] (dns.js:62:16)\n at GetAddrInfoReqWrap.onlookup [as oncomplete] (dns.js:81:10)","code":"EADDRNOTAVAIL"}}  
FATAL CLI ERROR Error: ENOENT: no such file or directory, unlink '/var/run/kibana.pid'  
at Error (native)  
at fs.unlinkSync (fs.js:1103:18)  
at process. (/usr/share/kibana/src/server/pid/index.js:52:26)  
at process. (/usr/share/kibana/node\_modules/lodash/index.js:7363:25)  
at process.g (events.js:291:16)  
at emitOne (events.js:101:20)  
at process.emit (events.js:188:7)  
at process.exit (internal/process.js:164:15)  
at Command. (/usr/share/kibana/src/cli/serve/serve.js:138:17)  
at throw (native)  
at step (/usr/share/kibana/src/cli/serve/serve.js:25:191)  
at /usr/share/kibana/src/cli/serve/serve.js:25:402  
{"type":"log","@timestamp":"2017-07-14T02:35:51Z","tags":["pid","warning"],"pid":"29971","path":"/var/run/kibana.pid","message":"pid file already exists at /var/run/kibana.pid"}  
{"type":"log","@timestamp":"2017-07-14T02:35:51Z","tags":["fatal"],"pid":29971,"level":"fatal","message":"EACCES: permission denied, open '/var/run/kibana.pid'","error":{"message":"EACCES: permission denied, open '/var/run/kibana.pid'","name":"Error","stack":"Error: EACCES: permission denied, open '/var/run/kibana.pid'\n at Error (native)","code":"EACCES"}}  
{"type":"log","@timestamp":"2017-07-17T02:00:39Z","tags":["pid","warning"],"pid":"21276","path":"/var/run/kibana.pid","message":"pid file already exists at /var/run/kibana.pid"}  
{"type":"log","@timestamp":"2017-07-17T02:00:39Z","tags":["fatal"],"pid":21276,"level":"fatal","message":"EACCES: permission denied, open '/var/run/kibana.pid'","error":{"message":"EACCES: permission denied, open '/var/run/kibana.pid'","name":"Error","stack":"Error: EACCES: permission denied, open '/var/run/kibana.pid'\n at Error (native)","code":"EACCES"}}  
{"type":"log","@timestamp":"2017-07-17T03:07:48Z","tags":["pid","warning"],"pid":"6863","path":"/var/run/kibana.pid","message":"pid file already exists at /var/run/kibana.pid"}  
{"type":"log","@timestamp":"2017-07-17T03:07:48Z","tags":["fatal"],"pid":6863,"level":"fatal","message":"EACCES: permission denied, open '/var/run/kibana.pid'","error":{"message":"EACCES: permission denied, open '/var/run/kibana.pid'","name":"Error","stack":"Error: EACCES: permission denied, open '/var/run/kibana.pid'\n at Error (native)","code":"EACCES"}}

---

<div class="post-metadata">

**Author:** ![Bargs](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/bargs/32/5429_2.png) [@Bargs](https://discuss.elastic.co/u/Bargs)\
**Post date:** [July 17, 2017, 1:58pm UTC](https://discuss.elastic.co/t/fail-to-start-kibana-the-kibana-pid-file-not-accessable/92983/9 "2017-07-17T13:58:37Z")

</div>

Based on the most recent error you posted, it looks like there's already a process listening to the port you're trying to bind to. Perhaps there's still a Kibana process running.

Try `lsof -i :5601` to see what's listening on that port and kill the process if necessary.

---

<div class="post-metadata">

**Author:** ![jjuu](https://avatars.discourse-cdn.com/v4/letter/j/ecc23a/32.png) [@jjuu](https://discuss.elastic.co/u/jjuu)\
**Post date:** [July 31, 2017, 7:01am UTC](https://discuss.elastic.co/t/fail-to-start-kibana-the-kibana-pid-file-not-accessable/92983/11 "2017-07-31T07:01:46Z")

</div>

lsof -i :5601 returns nothing.  
It just retured "permission denied, open '/var/run/kibana.pid'" every time when I run command "/etc/init.d/kibana start".

---

<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:** [August 28, 2017, 7:02am UTC](https://discuss.elastic.co/t/fail-to-start-kibana-the-kibana-pid-file-not-accessable/92983/12 "2017-08-28T07:02:07Z")

</div>

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