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

(Frank Dorssers) #1

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 - | sudo apt-key add -
echo "deb 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. /usr/share/elasticsearch/logs/elasticsearch.log (Permission denied)
	at Method)
	at org.apache.log4j.FileAppender.setFile(
	at org.apache.log4j.FileAppender.activateOptions(
	at org.apache.log4j.DailyRollingFileAppender.activateOptions(
	at org.apache.log4j.config.PropertySetter.activate(
	at org.apache.log4j.config.PropertySetter.setProperties(
	at org.apache.log4j.config.PropertySetter.setProperties(
	at org.apache.log4j.PropertyConfigurator.parseAppender(
	at org.apache.log4j.PropertyConfigurator.parseCategory(
	at org.apache.log4j.PropertyConfigurator.configureRootCategory(
	at org.apache.log4j.PropertyConfigurator.doConfigure(
	at org.apache.log4j.PropertyConfigurator.configure(
	at org.elasticsearch.common.logging.log4j.LogConfigurator.configure(
	at org.elasticsearch.plugins.PluginManagerCliParser.main(
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:


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.

(Mark Harwood) #2

The install command looks wrong.
See the 2.0 plugin installation docs here:

(Frank Dorssers) #3

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.

(system) #4