# Kibana service fails to start after upgrading from 4.5.1 to 5.0.0-alpha4

**URL:** <https://discuss.elastic.co/t/kibana-service-fails-to-start-after-upgrading-from-4-5-1-to-5-0-0-alpha4/55022>\
**Category:** Kibana\
**Created:** [July 8, 2016, 6:40am UTC](https://discuss.elastic.co/t/kibana-service-fails-to-start-after-upgrading-from-4-5-1-to-5-0-0-alpha4/55022 "2016-07-08T06:40:15Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![YuWatanabe](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yuwatanabe/32/13259_2.png) [@YuWatanabe](https://discuss.elastic.co/u/YuWatanabe)\
**Post date:** [July 8, 2016, 6:40am UTC](https://discuss.elastic.co/t/kibana-service-fails-to-start-after-upgrading-from-4-5-1-to-5-0-0-alpha4/55022/1 "2016-07-08T06:40:15Z")

</div>

Hi !

I would like to confirm what I am trying to do is right thing or not.  
It looks like similar issue to [https://github.com/elastic/kibana/issues/7475](https://github.com/elastic/kibana/issues/7475)  
but since its upgrade issue , I have created a new thread.

**Problem**  
After upgrading kibana from 4.5.1 to 5.0.0-alpha by _yum update_ , kibana fails to start as below.

```
Jul 08 15:17:55 ip-172-30-1-196.ec2.internal systemd[1]: kibana.service holdoff time over, scheduling restart.
Jul 08 15:17:55 ip-172-30-1-196.ec2.internal systemd[1]: Started Kibana.
Jul 08 15:17:55 ip-172-30-1-196.ec2.internal systemd[1]: Starting Kibana...
Jul 08 15:17:55 ip-172-30-1-196.ec2.internal systemd[12491]: Failed at step USER spawning /usr/share/kibana/bin/kibana: No such process
Jul 08 15:17:55 ip-172-30-1-196.ec2.internal systemd[1]: kibana.service: main process exited, code=exited, status=217/USER
Jul 08 15:17:55 ip-172-30-1-196.ec2.internal systemd[1]: Unit kibana.service entered failed state.
Jul 08 15:17:55 ip-172-30-1-196.ec2.internal systemd[1]: kibana.service failed.
Jul 08 15:17:55 ip-172-30-1-196.ec2.internal systemd[1]: kibana.service holdoff time over, scheduling restart.
Jul 08 15:17:55 ip-172-30-1-196.ec2.internal systemd[1]: start request repeated too quickly for kibana.service
Jul 08 15:17:55 ip-172-30-1-196.ec2.internal systemd[1]: Failed to start Kibana.
Jul 08 15:17:55 ip-172-30-1-196.ec2.internal systemd[1]: Unit kibana.service entered failed state.
Jul 08 15:17:55 ip-172-30-1-196.ec2.internal systemd[1]: kibana.service failed.

```

**Analysis**  
After checking the unit file for systemd, kibana now starts up with user **kibana**.

```
[root@ip-172-30-1-196 logstash]# cat /usr/lib/systemd/system/kibana.service
[Unit]
Description=Kibana

[Service]
Type=simple
User=kibana
Group=kibana
ExecStart=/usr/share/kibana/bin/kibana "-c /etc/kibana/kibana.yml"
Restart=always

[Install]
WantedBy=multi-user.target

```

After creating user kibana , systemd still has errors

```
[root@ip-172-30-1-196 logstash]# useradd -M -s /sbin/nologin kibana
[root@ip-172-30-1-196 logstash]# grep kibana /etc/passwd
kibana:x:1001:1001::/home/kibana:/sbin/nologin

Jul 08 15:30:39 ip-172-30-1-196.ec2.internal systemd[1]: kibana.service holdoff time over, scheduling restart.
Jul 08 15:30:39 ip-172-30-1-196.ec2.internal systemd[1]: Started Kibana.
Jul 08 15:30:39 ip-172-30-1-196.ec2.internal systemd[1]: Starting Kibana...
Jul 08 15:30:40 ip-172-30-1-196.ec2.internal kibana[12623]: fs.js:549
Jul 08 15:30:40 ip-172-30-1-196.ec2.internal kibana[12623]: return binding.open(pathModule._makeLong(path), stringToFlags(flags), mode);
Jul 08 15:30:40 ip-172-30-1-196.ec2.internal kibana[12623]: ^
Jul 08 15:30:40 ip-172-30-1-196.ec2.internal kibana[12623]: Error: EACCES: permission denied, open '/usr/share/kibana/optimize/.babelcache.json'
Jul 08 15:30:40 ip-172-30-1-196.ec2.internal kibana[12623]: at Error (native)
Jul 08 15:30:40 ip-172-30-1-196.ec2.internal kibana[12623]: at Object.fs.openSync (fs.js:549:18)
Jul 08 15:30:40 ip-172-30-1-196.ec2.internal kibana[12623]: at Object.fs.writeFileSync (fs.js:1156:15)
Jul 08 15:30:40 ip-172-30-1-196.ec2.internal kibana[12623]: at save (/usr/share/kibana/node_modules/babel-core/lib/api/register/cache.js:35:19)
Jul 08 15:30:40 ip-172-30-1-196.ec2.internal kibana[12623]: at nextTickCallbackWith0Args (node.js:420:9)
Jul 08 15:30:40 ip-172-30-1-196.ec2.internal kibana[12623]: at process._tickDomainCallback (node.js:390:13)
Jul 08 15:30:40 ip-172-30-1-196.ec2.internal kibana[12623]: at Function.Module.runMain (module.js:443:11)
Jul 08 15:30:40 ip-172-30-1-196.ec2.internal kibana[12623]: at startup (node.js:139:18)
Jul 08 15:30:40 ip-172-30-1-196.ec2.internal kibana[12623]: at node.js:968:3

```

To bypass this error , I now start up kibana with _user root_ and _group root_.

**Question**  
My question is should I _chown_ the whole kibana env as below after yum update?

`chown -R kibana:kibana /usr/share/kibana`

Thanks,  
Yu

---

<div class="post-metadata">

**Author:** ![warkolm](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/warkolm/32/39224_2.png) [@warkolm](https://discuss.elastic.co/u/warkolm)\
**Post date:** [July 8, 2016, 8:04am UTC](https://discuss.elastic.co/t/kibana-service-fails-to-start-after-upgrading-from-4-5-1-to-5-0-0-alpha4/55022/2 "2016-07-08T08:04:10Z")

</div>

Can you please raise this on Github?

---

<div class="post-metadata">

**Author:** ![YuWatanabe](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yuwatanabe/32/13259_2.png) [@YuWatanabe](https://discuss.elastic.co/u/YuWatanabe)\
**Post date:** [July 8, 2016, 9:39am UTC](https://discuss.elastic.co/t/kibana-service-fails-to-start-after-upgrading-from-4-5-1-to-5-0-0-alpha4/55022/3 "2016-07-08T09:39:33Z")

</div>

Sure. No problem.

---

<div class="post-metadata">

**Author:** ![YuWatanabe](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yuwatanabe/32/13259_2.png) [@YuWatanabe](https://discuss.elastic.co/u/YuWatanabe)\
**Post date:** [July 8, 2016, 9:57am UTC](https://discuss.elastic.co/t/kibana-service-fails-to-start-after-upgrading-from-4-5-1-to-5-0-0-alpha4/55022/4 "2016-07-08T09:57:27Z")

</div>

Git hub link is

> <https://github.com/elastic/kibana/issues/7681>

---

<div class="post-metadata">

**Author:** ![YuWatanabe](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/yuwatanabe/32/13259_2.png) [@YuWatanabe](https://discuss.elastic.co/u/YuWatanabe)\
**Post date:** [July 13, 2016, 1:18am UTC](https://discuss.elastic.co/t/kibana-service-fails-to-start-after-upgrading-from-4-5-1-to-5-0-0-alpha4/55022/5 "2016-07-13T01:18:10Z")

</div>

After chowning the "/usr/share/kibana/optimize" kibana starts up properly.

**Before chowning**

```
[root@ip-172-30-1-196 ec2-user]# cd /usr/share/kibana/
[root@ip-172-30-1-196 kibana]# ls -ltr
total 20
-rw-rw-r--. 1 root root 2445 Jun 30 02:57 README.txt
-rw-rw-r--. 1 root root 563 Jun 30 02:57 LICENSE.txt
drwxrwxr-x. 2 993 990 6 Jun 30 02:57 installedPlugins
-rw-rw-r--. 1 root root 708 Jun 30 02:57 package.json
drwxr-xr-x. 95 root root 4096 Jul 8 14:33 node_modules
drwxr-xr-x. 9 root root 96 Jul 8 14:33 src
drwxr-xr-x. 2 root root 39 Jul 8 14:33 bin
drwxr-xr-x. 6 root root 101 Jul 8 14:33 node
drwxr-xr-x. 3 993 990 43 Jul 8 14:33 optimize
drwxr-xr-x. 2 root root 4096 Jul 8 14:34 webpackShims

```

**Chown command**

`[root@ip-172-30-1-196 kibana]# chown kibana:kibana -R /usr/share/kibana/optimize/`

**My systemd script**

```
[root@ip-172-30-1-196 kibana]# cat /usr/lib/systemd/system/kibana.service
[Unit]
Description=Kibana

[Service]
Type=simple
User=kibana
Group=kibana
#User=root
#Group=root
ExecStart=/usr/share/kibana/bin/kibana "-c /etc/kibana/kibana.yml"
Restart=always

[Install]
WantedBy=multi-user.target

```

**Make sure kibana user exists**

```
[root@ip-172-30-1-196 kibana]# grep kibana /etc/passwd
kibana:x:1001:1001::/home/kibana:/sbin/nologin

```

**Service startup and result**

```
[root@ip-172-30-1-196 kibana]# systemctl daemon-reload
[root@ip-172-30-1-196 kibana]# systemctl stop kibana
[root@ip-172-30-1-196 kibana]# systemctl start kibana
[root@ip-172-30-1-196 kibana]# systemctl status kibana
● kibana.service - Kibana
   Loaded: loaded (/usr/lib/systemd/system/kibana.service; enabled; vendor preset: disabled)
   Active: active (running) since Wed 2016-07-13 10:06:21 JST; 50s ago
 Main PID: 2278 (node)
   CGroup: /system.slice/kibana.service
           └─2278 /usr/share/kibana/bin/../node/bin/node /usr/share/kibana/bin/../src/cli -c /etc/kibana/kibana.y...

Jul 13 10:06:23 ip-172-30-1-196.ec2.internal kibana[2278]: {"type":"log","@timestamp":"2016-07-13T01:06:23Z","...d"}
Jul 13 10:06:23 ip-172-30-1-196.ec2.internal kibana[2278]: {"type":"log","@timestamp":"2016-07-13T01:06:23Z","...d"}
Jul 13 10:06:23 ip-172-30-1-196.ec2.internal kibana[2278]: {"type":"log","@timestamp":"2016-07-13T01:06:23Z","...d"}
Jul 13 10:06:23 ip-172-30-1-196.ec2.internal kibana[2278]: {"type":"log","@timestamp":"2016-07-13T01:06:23Z","...d"}
Jul 13 10:06:23 ip-172-30-1-196.ec2.internal kibana[2278]: {"type":"log","@timestamp":"2016-07-13T01:06:23Z","...h"}
Jul 13 10:06:23 ip-172-30-1-196.ec2.internal kibana[2278]: {"type":"log","@timestamp":"2016-07-13T01:06:23Z","...d"}
Jul 13 10:06:23 ip-172-30-1-196.ec2.internal kibana[2278]: {"type":"log","@timestamp":"2016-07-13T01:06:23Z","...d"}
Jul 13 10:06:23 ip-172-30-1-196.ec2.internal kibana[2278]: {"type":"log","@timestamp":"2016-07-13T01:06:23Z","...1"}
Jul 13 10:06:23 ip-172-30-1-196.ec2.internal kibana[2278]: {"type":"log","@timestamp":"2016-07-13T01:06:23Z","...d"}
Jul 13 10:06:35 ip-172-30-1-196.ec2.internal systemd[1]: Started Kibana.
Hint: Some lines were ellipsized, use -l to show in full.

```

Thanks,  
Yu

---

<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:** [July 6, 2017, 1:47pm UTC](https://discuss.elastic.co/t/kibana-service-fails-to-start-after-upgrading-from-4-5-1-to-5-0-0-alpha4/55022/6 "2017-07-06T13:47:03Z")

</div>


