# Kibana plugin develop problem

**URL:** <https://discuss.elastic.co/t/kibana-plugin-develop-problem/136515>\
**Category:** Kibana\
**Created:** [June 19, 2018, 2:55pm UTC](https://discuss.elastic.co/t/kibana-plugin-develop-problem/136515 "2018-06-19T14:55:11Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![f26227279](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/f26227279/32/21296_2.png) [@f26227279](https://discuss.elastic.co/u/f26227279)\
**Post date:** [June 19, 2018, 2:55pm UTC](https://discuss.elastic.co/t/kibana-plugin-develop-problem/136515/1 "2018-06-19T14:55:12Z")

</div>

Hi, I refer the instruction([https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#setting-up-your-development-environment](https://github.com/elastic/kibana/blob/master/CONTRIBUTING.md#setting-up-your-development-environment)) to try to develop a kibana plugin, but there are some problems.

at this step: `yarn es snapshot`  
I can't run es snapshot as user mode because I install `yarn` at root.  
I know ES can't run as root, so how can I do?  
when I run as root:  
`[root@localhost kibana]# yarn es snapshot yarn run v1.9.0-20180614.1132 $ node scripts/es snapshot info Installing from snapshot │ info version: 7.0.0-alpha1 │ info install path: /run/media/es3/80967063-20eb-4c15-82d1-56e01f888254/kibana/.es/7.0.0-alpha1 │ info license: basic │ info downloading from https://snapshots.elastic.co/downloads/elasticsearch/elasticsearch-7.0.0-alpha1-SNAPSHOT.tar.gz │ info etags match, using cache from 2018-06-19T14:11:24.808Z │ info install directory already exists, removing │ info extracting /run/media/es3/80967063-20eb-4c15-82d1-56e01f888254/kibana/.es/cache/elasticsearch-7.0.0-alpha1-SNAPSHOT.tar.gz │ info extracted to /run/media/es3/80967063-20eb-4c15-82d1-56e01f888254/kibana/.es/7.0.0-alpha1 │ info setting bootstrap password to changeme info Starting │ debg bin/elasticsearch │ info [o.e.b.ElasticsearchUncaughtExceptionHandler] [] uncaught exception in thread [main] │ org.elasticsearch.bootstrap.StartupException: java.lang.RuntimeException: can not run elasticsearch as root │ at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:140) ~[elasticsearch-7.0.0-alpha1-SNAPSHOT.jar:7.0.0-alpha1-SNAPSHOT] │ at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:127) ~[elasticsearch-7.0.0-alpha1-SNAPSHOT.jar:7.0.0-alpha1-SNAPSHOT] │ at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86) ~[elasticsearch-7.0.0-alpha1-SNAPSHOT.jar:7.0.0-alpha1-SNAPSHOT] │ at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:124) ~[elasticsearch-cli-7.0.0-alpha1-SNAPSHOT.jar:7.0.0-alpha1-SNAPSHOT] │ at org.elasticsearch.cli.Command.main(Command.java:90) ~[elasticsearch-cli-7.0.0-alpha1-SNAPSHOT.jar:7.0.0-alpha1-SNAPSHOT] │ at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:93) ~[elasticsearch-7.0.0-alpha1-SNAPSHOT.jar:7.0.0-alpha1-SNAPSHOT] │ at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:86) ~[elasticsearch-7.0.0-alpha1-SNAPSHOT.jar:7.0.0-alpha1-SNAPSHOT] │ Caused by: java.lang.RuntimeException: can not run elasticsearch as root │ at org.elasticsearch.bootstrap.Bootstrap.initializeNatives(Bootstrap.java:103) ~[elasticsearch-7.0.0-alpha1-SNAPSHOT.jar:7.0.0-alpha1-SNAPSHOT] │ at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:170) ~[elasticsearch-7.0.0-alpha1-SNAPSHOT.jar:7.0.0-alpha1-SNAPSHOT] │ at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:323) ~[elasticsearch-7.0.0-alpha1-SNAPSHOT.jar:7.0.0-alpha1-SNAPSHOT] │ at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:136) ~[elasticsearch-7.0.0-alpha1-SNAPSHOT.jar:7.0.0-alpha1-SNAPSHOT] │ ... 6 more │ERROR ES exited with code 1 error Command failed with exit code 1. info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.`

thank you in advance!

---

<div class="post-metadata">

**Author:** ![Larry\_Gregory](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/larry_gregory/32/34969_2.png) [@Larry\_Gregory](https://discuss.elastic.co/u/Larry_Gregory)\
**Post date:** [June 19, 2018, 3:09pm UTC](https://discuss.elastic.co/t/kibana-plugin-develop-problem/136515/2 "2018-06-19T15:09:50Z")

</div>

Hi @f26227279,

Are you able to reinstall `yarn` as a user instead of root?

Otherwise, you could not use `yarn` for starting Elasticsearch and instead build it from source by cloning the [repository](https://github.com/elastic/elasticsearch) and executing `./gradlew`

---

<div class="post-metadata">

**Author:** ![f26227279](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/f26227279/32/21296_2.png) [@f26227279](https://discuss.elastic.co/u/f26227279)\
**Post date:** [June 20, 2018, 2:32pm UTC](https://discuss.elastic.co/t/kibana-plugin-develop-problem/136515/3 "2018-06-20T14:32:39Z")

</div>

Thanks for your reply!  
Now I install yarn as a user, and when I go to this step `yarn start`, there are some problems.  
this is the log:

```
 [wlogger@localhost kibana]$ yarn start
yarn run v1.9.0-20180614.1132
$ node scripts/kibana --dev
(node:10539) [DEP0022] DeprecationWarning: os.tmpDir() is deprecated. Use os.tmpdir() instead.
 failed to watch files! Error: watch /home/wlogger/Downloads/kibana/x-pack/plugins/index_management/ __jest__ ENOSPC
    at _errnoException (util.js:992:11)
    at FSWatcher.start (fs.js:1382:19)
    at Object.fs.watch (fs.js:1408:11)
    at createFsWatchInstance (/home/wlogger/Downloads/kibana/node_modules/chokidar/lib/nodefs-handler.js:37:15)
    at setFsWatchListener (/home/wlogger/Downloads/kibana/node_modules/chokidar/lib/nodefs-handler.js:80:15)
    at FSWatcher.NodeFsHandler._watchWithNodeFs (/home/wlogger/Downloads/kibana/node_modules/chokidar/lib/nodefs-handler.js:228:14)
    at FSWatcher.NodeFsHandler._handleDir (/home/wlogger/Downloads/kibana/node_modules/chokidar/lib/nodefs-handler.js:407:19)
    at FSWatcher.<anonymous> (/home/wlogger/Downloads/kibana/node_modules/chokidar/lib/nodefs-handler.js:455:19)
    at FSWatcher.<anonymous> (/home/wlogger/Downloads/kibana/node_modules/chokidar/lib/nodefs-handler.js:460:16)
    at FSReqWrap.oncomplete (fs.js:153:5)
error Command failed with exit code 1.
info Visit https://yarnpkg.com/en/docs/cli/run for documentation about this command.

```

thanks a lot!

---

<div class="post-metadata">

**Author:** ![f26227279](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/f26227279/32/21296_2.png) [@f26227279](https://discuss.elastic.co/u/f26227279)\
**Post date:** [June 20, 2018, 2:53pm UTC](https://discuss.elastic.co/t/kibana-plugin-develop-problem/136515/4 "2018-06-20T14:53:40Z")

</div>

change to root mode then it can run!

---

<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 18, 2018, 2:53pm UTC](https://discuss.elastic.co/t/kibana-plugin-develop-problem/136515/5 "2018-07-18T14:53:50Z")

</div>

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