Facing issue to start elasticsearch "permission denied"

Hi,
I have added x-pack to the elastic search but after doing so, I am not able to start using

service elasticsearch start 
sudo service elasticsearch start 
bin/elasticsearch

but I'm getting permission denied errors.

I am attaching the SS of the permission for the file directories

For service elasticsearch start

bin/elasticsearch

Permissions
etc

usr-share.

Thanks

1 Like

You do not have x permission on the plugins directory. I would be tempted to

find /usr/share/elasticsearch -type d -exec chmod +x {} \;
1 Like

Hi @Badger,

It added the x permissions but I have whole new errors now.

New permissions:

:/usr/share/elasticsearch# ls -l
total 224
drwxr-xr-x 3 root root 4096 May 15 19:30 bin
-rw-r--r-- 1 root root 3451 May 15 19:32 elastic-certificates.p12
-rw-r--r-- 1 root root 2527 May 15 19:31 elastic-stack-ca.p12
drwxr-xr-x 2 root root 4096 May 14 20:31 lib
drwxr-xr-x 16 root root 4096 May 14 20:31 modules
-rw-r--r-- 1 root root 191887 Apr 13 02:09 NOTICE.txt
drwxr-xr-x 3 root root 4096 May 15 19:30 plugins
-rw-r--r-- 1 root root 9268 Apr 13 02:09 README.textile

When I tried to start:
===========using bin/elasticsearch

:/usr/share/elasticsearch# bin/elasticsearch
[2018-05-15T21:04:48,041][WARN ][o.e.b.ElasticsearchUncaughtExceptionHandler] uncaught exception in thread [main]
org.elasticsearch.bootstrap.StartupException: org.elasticsearch.bootstrap.BootstrapException: java.io.IOException: Cannot run program "/usr/share/elasticsearch/plugins/x-pack/x-pack-ml/platform/linux-x86_64/bin/controller": error=13, Permission denied
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:125) ~[elasticsearch-6.2.4.jar:6.2.4]
at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:112) ~[elasticsearch-6.2.4.jar:6.2.4]
at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86) ~[elasticsearch-6.2.4.jar:6.2.4]
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:124) ~[elasticsearch-cli-6.2.4.jar:6.2.4]
at org.elasticsearch.cli.Command.main(Command.java:90) ~[elasticsearch-cli-6.2.4.jar:6.2.4]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:92) ~[elasticsearch-6.2.4.jar:6.2.4]
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:85) ~[elasticsearch-6.2.4.jar:6.2.4]
Caused by: org.elasticsearch.bootstrap.BootstrapException: java.io.IOException: Cannot run program "/usr/share/elasticsearch/plugins/x-pack/x-pack-ml/platform/linux-x86_64/bin/controller": error=13, Permission denied
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:169) ~[elasticsearch-6.2.4.jar:6.2.4]
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:323) ~[elasticsearch-6.2.4.jar:6.2.4]
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:121) ~[elasticsearch-6.2.4.jar:6.2.4]
... 6 more
Caused by: java.io.IOException: Cannot run program "/usr/share/elasticsearch/plugins/x-pack/x-pack-ml/platform/linux-x86_64/bin/controller": error=13, Permission denied
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1048) ~[?:1.8.0_171]
at org.elasticsearch.bootstrap.Spawner.spawnNativePluginController(Spawner.java:123) ~[elasticsearch-6.2.4.jar:6.2.4]
at org.elasticsearch.bootstrap.Spawner.spawnNativePluginControllers(Spawner.java:88) ~[elasticsearch-6.2.4.jar:6.2.4]
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:167) ~[elasticsearch-6.2.4.jar:6.2.4]
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:323) ~[elasticsearch-6.2.4.jar:6.2.4]
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:121) ~[elasticsearch-6.2.4.jar:6.2.4]
... 6 more
Caused by: java.io.IOException: error=13, Permission denied
at java.lang.UNIXProcess.forkAndExec(Native Method) ~[?:1.8.0_171]
at java.lang.UNIXProcess.(UNIXProcess.java:247) ~[?:1.8.0_171]
at java.lang.ProcessImpl.start(ProcessImpl.java:134) ~[?:1.8.0_171]
at java.lang.ProcessBuilder.start(ProcessBuilder.java:1029) ~[?:1.8.0_171]
at org.elasticsearch.bootstrap.Spawner.spawnNativePluginController(Spawner.java:123) ~[elasticsearch-6.2.4.jar:6.2.4]
at org.elasticsearch.bootstrap.Spawner.spawnNativePluginControllers(Spawner.java:88) ~[elasticsearch-6.2.4.jar:6.2.4]
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:167) ~[elasticsearch-6.2.4.jar:6.2.4]
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:323) ~[elasticsearch-6.2.4.jar:6.2.4]
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:121) ~[elasticsearch-6.2.4.jar:6.2.4]
... 6 more

===========using service

/usr/share/elasticsearch# service elasticsearch start

  • Starting Elasticsearch Server Java HotSpot(TM) 64-Bit Server VM warning: Cannot open file /var/log/elasticsearch/gc.log due to Permission denied

2018-05-15 21:01:00,157 main ERROR Unable to create file /var/log/elasticsearch/elasticsearch.log java.io.IOException: Could not create directory /var/log/elasticsearch
at org.apache.logging.log4j.core.util.FileUtils.mkdir(FileUtils.java:127)
at org.apache.logging.log4j.core.util.FileUtils.makeParentDirs(FileUtils.java:144)
at org.apache.logging.log4j.core.appender.rolling.RollingFileManager$RollingFileManagerFactory.createManager(RollingFileManager.java:627)
at org.apache.logging.log4j.core.appender.rolling.RollingFileManager$RollingFileManagerFactory.createManager(RollingFileManager.java:608)
at org.apache.logging.log4j.core.appender.AbstractManager.getManager(AbstractManager.java:113)
at org.apache.logging.log4j.core.appender.OutputStreamManager.getManager(OutputStreamManager.java:115)
at org.apache.logging.log4j.core.appender.rolling.RollingFileManager.getFileManager(RollingFileManager.java:188)
at org.apache.logging.log4j.core.appender.RollingFileAppender$Builder.build(RollingFileAppender.java:144)
at org.apache.logging.log4j.core.appender.RollingFileAppender$Builder.build(RollingFileAppender.java:60)
at org.apache.logging.log4j.core.config.plugins.util.PluginBuilder.build(PluginBuilder.java:122)
at org.apache.logging.log4j.core.config.AbstractConfiguration.createPluginObject(AbstractConfiguration.java:958)
at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:898)
at org.apache.logging.log4j.core.config.AbstractConfiguration.createConfiguration(AbstractConfiguration.java:890)
at org.apache.logging.log4j.core.config.AbstractConfiguration.doConfigure(AbstractConfiguration.java:513)
at org.apache.logging.log4j.core.config.AbstractConfiguration.initialize(AbstractConfiguration.java:237)
at org.apache.logging.log4j.core.config.AbstractConfiguration.start(AbstractConfiguration.java:249)

What do you get from an ls?

ls -l /usr/share/elasticsearch/plugins/x-pack/x-pack-ml/platform/linux-x86_64/bin/controller

I would expect /var/log to only be writeable by root. If the service does not run as root you would need to to create the directory and chown it to whichever id the service runs as.

-rw-r--r-- 1 root root 84352 May 15 19:29 /usr/share/elasticsearch/plugins/x-pack/x-pack-ml/platform/linux-x86_64/bin/controller

For

/var/log/elasticsearch$ ls -al
total 64
drwxrwxrwx 2 elasticsearch elasticsearch 4096 May 15 20:36 .
drw-r--r-- 20 root syslog 4096 May 15 15:49 ..
-rwxrwxrwx 1 elasticsearch elasticsearch 13993 May 15 00:23 elasticsearch-2018-05-14-1.log.gz
-rwxrwxrwx 1 elasticsearch elasticsearch 0 May 15 16:53 elasticsearch_access.log
-rwxrwxrwx 1 elasticsearch elasticsearch 7563 May 15 13:48 elasticsearch_deprecation.log
-rwxrwxrwx 1 elasticsearch elasticsearch 0 May 14 20:21 elasticsearch_index_indexing_slowlog.log
-rwxrwxrwx 1 elasticsearch elasticsearch 0 May 14 20:21 elasticsearch_index_search_slowlog.log
-rwxrwxrwx 1 elasticsearch elasticsearch 22960 May 15 21:16 elasticsearch.log
-rwxrwxrwx 1 elasticsearch elasticsearch 3026 May 15 21:16 gc.log.0.current

You have a seriously messed up server. Is re-provisioning and starting from scratch an option? Otherwise

chmod +x /usr/share/elasticsearch/plugins/x-pack/x-pack-ml/platform/linux-x86_64/bin/controller
chmod +x /var/log

Hi @Badger,

I think we can do re-provisioning and starting from scratch...

I want to add some data and see visualisations using Kibana but also, I want to add few users who will have following roles:

  • Admin
  • User
  • Anonymous User

And based on this roles I want the data and visualisations to be changed, like by permissions and access control.

Can you answer few of my question?

  1. How can we achieve this?
  2. If by ELK, then what should be the priority of installation?
  3. I am using Ubuntu, is it less compatible with Ubuntu?
  4. Can you share links to follow to achieve the above scenario?
  5. How much time it should take, to achieve the goal here?

Thanks

I do not use Ubuntu or x-pack security, so I cannot really address those questions.

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