# Permission troubles in Ubuntu with log files when installing plugins (and possibly other actions)

**URL:** <https://discuss.elastic.co/t/permission-troubles-in-ubuntu-with-log-files-when-installing-plugins-and-possibly-other-actions/33143>\
**Category:** Elasticsearch\
**Created:** [October 28, 2015, 11:22am UTC](https://discuss.elastic.co/t/permission-troubles-in-ubuntu-with-log-files-when-installing-plugins-and-possibly-other-actions/33143 "2015-10-28T11:22:40Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![fdorssers](https://avatars.discourse-cdn.com/v4/letter/f/4da419/32.png) [@fdorssers](https://discuss.elastic.co/u/fdorssers)\
**Post date:** [October 28, 2015, 11:22am UTC](https://discuss.elastic.co/t/permission-troubles-in-ubuntu-with-log-files-when-installing-plugins-and-possibly-other-actions/33143/1 "2015-10-28T11:22:41Z")

</div>

The machine I'm using runs Ubuntu 15.04 with Java version 1.8.0\_66 (`java -version`). Installation of Elasticsearch was done using PPA:

```
wget -qO - https://packages.elastic.co/GPG-KEY-elasticsearch | sudo apt-key add -
echo "deb http://packages.elastic.co/elasticsearch/2.0/debian stable main" | sudo tee -a /etc/apt/sources.list.d/elk.list
sudo apt-get update && sudo apt-get install elasticsearch -y
sudo service elasticsearch start

```

And it seemed to work flawless:

```
{
  "name" : "Michael Nowman",
  "cluster_name" : "elasticsearch",
  "version" : {
    "number" : "2.0.0-beta2",
    "build_hash" : "91726c3f7cf57336f2f304a5cdc738db3b817234",
    "build_timestamp" : "2015-09-14T14:58:02Z",
    "build_snapshot" : false,
    "lucene_version" : "5.2.1"
  },
  "tagline" : "You Know, for Search"
}

```

The next thing that I wanted to do was install kopf with the following command:

```
/usr/share/elasticsearch/bin/plugin -install lmenezes/elasticsearch-kopf

```

However this gave the following error:

```
log4j:ERROR setFile(null,true) call failed.
java.io.FileNotFoundException: /usr/share/elasticsearch/logs/elasticsearch.log (Permission denied)
	at java.io.FileOutputStream.open0(Native Method)
	at java.io.FileOutputStream.open(FileOutputStream.java:270)
	at java.io.FileOutputStream.<init>(FileOutputStream.java:213)
	at java.io.FileOutputStream.<init>(FileOutputStream.java:133)
	at org.apache.log4j.FileAppender.setFile(FileAppender.java:294)
	at org.apache.log4j.FileAppender.activateOptions(FileAppender.java:165)
	at org.apache.log4j.DailyRollingFileAppender.activateOptions(DailyRollingFileAppender.java:223)
	at org.apache.log4j.config.PropertySetter.activate(PropertySetter.java:307)
	at org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java:172)
	at org.apache.log4j.config.PropertySetter.setProperties(PropertySetter.java:104)
	at org.apache.log4j.PropertyConfigurator.parseAppender(PropertyConfigurator.java:842)
	at org.apache.log4j.PropertyConfigurator.parseCategory(PropertyConfigurator.java:768)
	at org.apache.log4j.PropertyConfigurator.configureRootCategory(PropertyConfigurator.java:648)
	at org.apache.log4j.PropertyConfigurator.doConfigure(PropertyConfigurator.java:514)
	at org.apache.log4j.PropertyConfigurator.configure(PropertyConfigurator.java:440)
	at org.elasticsearch.common.logging.log4j.LogConfigurator.configure(LogConfigurator.java:116)
	at org.elasticsearch.plugins.PluginManagerCliParser.main(PluginManagerCliParser.java:56)
....
log4j:ERROR Either File or DatePattern options are not set for appender [index_search_slow_log_file].
ERROR: unknown command [-install]. Use [-h] option to list available commands

```

_Had to remove part of the error due to character limit._

Running this command with `sudo` also didn't work, however in that case it did not give the extensive error, but only:

```
ERROR: unknown command [-install]. Use [-h] option to list available commands

```

So apparently there's a permission issue. So I checked what users exist using `cat /etc/passwd` and the resulting list contains:

```
elasticsearch:x:124:135::/home/elasticsearch:/bin/false

```

So there seems to be an Elasticsearch user. In the next step I checked the permissions of `/usr/share/elasticsearch/logs` with `ls -al /usr/share/elasticsearch` and this gave:

```
drwxr-xr-x 2 elasticsearch elasticsearch 4096 okt 27 13:42 logs

```

So that also seems to be right.

Next I tried changing the permissions to that folder using `sudo chmod -R 777 /usr/share/elasticsearch/logs`. That didn't work either. The only thing this changed was that the non sudo version of the command also didn't give any output except for `ERROR: unknown command...` so I put it back to `755`.

This is a personal machine, so I have full access and can change anything required. I'm also still relatively new to Ubuntu, so for all I know I'm missing something very obvious.

Would anyone happen to have a suggestion what I can do to get everything working? Because at the moment I have no idea.

---

<div class="post-metadata">

**Author:** ![Mark\_Harwood](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/mark_harwood/32/10538_2.png) [@Mark\_Harwood](https://discuss.elastic.co/u/Mark_Harwood)\
**Post date:** [October 28, 2015, 12:02pm UTC](https://discuss.elastic.co/t/permission-troubles-in-ubuntu-with-log-files-when-installing-plugins-and-possibly-other-actions/33143/2 "2015-10-28T12:02:48Z")

</div>

The install command looks wrong.  
See the 2.0 plugin installation docs here: [https://www.elastic.co/guide/en/elasticsearch/plugins/2.0/installation.html](https://www.elastic.co/guide/en/elasticsearch/plugins/2.0/installation.html)

---

<div class="post-metadata">

**Author:** ![fdorssers](https://avatars.discourse-cdn.com/v4/letter/f/4da419/32.png) [@fdorssers](https://discuss.elastic.co/u/fdorssers)\
**Post date:** [October 28, 2015, 12:08pm UTC](https://discuss.elastic.co/t/permission-troubles-in-ubuntu-with-log-files-when-installing-plugins-and-possibly-other-actions/33143/3 "2015-10-28T12:08:44Z")

</div>

You're completely right! I removed the dash and it worked immediately. My fault for assuming the tutorial I was following was completely right, should've taken a better look at the actual docs and at the actual error that explicitly stated that I was using the wrong command. Was too focused on the permission issues.

Thank you.

---

<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 5, 2017, 11:42pm UTC](https://discuss.elastic.co/t/permission-troubles-in-ubuntu-with-log-files-when-installing-plugins-and-possibly-other-actions/33143/4 "2017-07-05T23:42:10Z")

</div>


