0

I am trying to start elasticSearch 6.8 on Mac OS X 10.15 Catalina but it shows error. I already gives 777 permission to System/Volumes/Data/usr/local/var/lib/elasticsearch/nodes/0 folder.

  • ElasticSearch 6.8
  • OpenJDK 12

    [2019-06-24T15:12:32,803][WARN ][o.e.b.ElasticsearchUncaughtExceptionHandler] [unknown] uncaught exception in thread [main] org.elasticsearch.bootstrap.StartupException: java.security.AccessControlException: access denied ("java.io.FilePermission" "/System/Volumes/Data/usr/local/var/lib/elasticsearch/nodes/0" "write") at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:163) ~[elasticsearch-6.8.1.jar:6.8.1] at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:150) ~[elasticsearch-6.8.1.jar:6.8.1] at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86) ~[elasticsearch-6.8.1.jar:6.8.1] at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:124) ~[elasticsearch-cli-6.8.1.jar:6.8.1] at org.elasticsearch.cli.Command.main(Command.java:90) ~[elasticsearch-cli-6.8.1.jar:6.8.1] at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:116) ~[elasticsearch-6.8.1.jar:6.8.1] at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:93) ~[elasticsearch-6.8.1.jar:6.8.1] Caused by: java.security.AccessControlException: access denied ("java.io.FilePermission" "/System/Volumes/Data/usr/local/var/lib/elasticsearch/nodes/0" "write") at java.security.AccessControlContext.checkPermission(AccessControlContext.java:472) ~[?:1.8.0_212] at java.security.AccessController.checkPermission(AccessController.java:884) ~[?:1.8.0_212] at java.lang.SecurityManager.checkPermission(SecurityManager.java:549) ~[?:1.8.0_212] at java.lang.SecurityManager.checkWrite(SecurityManager.java:979) ~[?:1.8.0_212] at sun.nio.fs.UnixPath.checkWrite(UnixPath.java:801) ~[?:?] at sun.nio.fs.UnixFileSystemProvider.createDirectory(UnixFileSystemProvider.java:376) ~[?:?] at java.nio.file.Files.createDirectory(Files.java:674) ~[?:1.8.0_212] at java.nio.file.Files.createAndCheckIsDirectory(Files.java:781) ~[?:1.8.0_212] at java.nio.file.Files.createDirectories(Files.java:727) ~[?:1.8.0_212] at org.apache.lucene.store.NativeFSLockFactory.obtainFSLock(NativeFSLockFactory.java:92) ~[lucene-core-7.7.0.jar:7.7.0 8c831daf4eb41153c25ddb152501ab5bae3ea3d5 - jimczi - 2019-02-04 23:16:28] at org.apache.lucene.store.FSLockFactory.obtainLock(FSLockFactory.java:41) ~[lucene-core-7.7.0.jar:7.7.0 8c831daf4eb41153c25ddb152501ab5bae3ea3d5 - jimczi - 2019-02-04 23:16:28] at org.apache.lucene.store.BaseDirectory.obtainLock(BaseDirectory.java:45) ~[lucene-core-7.7.0.jar:7.7.0 8c831daf4eb41153c25ddb152501ab5bae3ea3d5 - jimczi - 2019-02-04 23:16:28] at org.elasticsearch.env.NodeEnvironment$NodeLock.(NodeEnvironment.java:211) ~[elasticsearch-6.8.1.jar:6.8.1] at org.elasticsearch.env.NodeEnvironment.(NodeEnvironment.java:270) ~[elasticsearch-6.8.1.jar:6.8.1] at org.elasticsearch.node.Node.(Node.java:296) ~[elasticsearch-6.8.1.jar:6.8.1] at org.elasticsearch.node.Node.(Node.java:266) ~[elasticsearch-6.8.1.jar:6.8.1] at org.elasticsearch.bootstrap.Bootstrap$5.(Bootstrap.java:212) ~[elasticsearch-6.8.1.jar:6.8.1] at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:212) ~[elasticsearch-6.8.1.jar:6.8.1] at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:333) ~[elasticsearch-6.8.1.jar:6.8.1] at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:159) ~[elasticsearch-6.8.1.jar:6.8.1] ... 6 more

vipin
  • 2,374
  • 1
  • 19
  • 36

4 Answers4

0

try sudo ./elsticsearch or I think giving permissions to the data folder in your ELASTIC BASEDIR(depends upon how you installed) will solve it(not sure though worth a try)

Shanmukh
  • 63
  • 6
0

Catalina symlinks /usr/local/ to some other data volume now.

Elasticsearch installed through brew creates different directory links for data and logs. You can insert the full path in the config file like this. It's because elastic search doesn't like symlinks somehow?

path.data: /System/Volumes/Data/usr/local/var/lib/elasticsearch/
path.logs: /System/Volumes/Data/usr/local/var/log/elasticsearch/

It results in another error not having access to the plugins though.

Caused by: java.security.AccessControlException: access denied ("java.io.FilePermission" "/System/Volumes/Data/usr/local/Cellar/elasticsearch-full/7.1.1/libexec/modules/percolator/percolator-client-7.1.1.jar" "read")

A workaround is to download elasticsearch manually and run from your user directory with a custom launch daemon. This worked for me.

Maybe someone else could shine some light on this.

0

I had the same error with ElasticSearch 2.4 and OpenJDK 8, and got it working without chmod or chown or running ES with sudo.

The solution in this comment, while not ideal (you're arguably making your java environment less secure), helped me getting it to run: https://stackoverflow.com/a/12317528

I basically added the following to my java.policy (since I had AdoptOpenJDK 8 installed, I edited that with $ sudo nano /Library/Java/JavaVirtualMachines/adoptopenjdk-8.jdk/Contents/Home/jre/lib/security/java.policy), inside the second grant {} block, at the end:

permission java.io.FilePermission "/System/Volumes/Data/usr/local/Cellar/elasticsearch@2.4/-", "read";
permission java.io.FilePermission "/System/Volumes/Data/usr/local/var/elasticsearch/-", "read";
permission java.io.FilePermission "/System/Volumes/Data/usr/local/var/elasticsearch/-", "write";
permission java.io.FilePermission "/System/Volumes/Data/usr/local/var/elasticsearch/-", "delete";

Note my paths and yours are slightly different (I'm on ES 2.4 and you're on 6.8, which might be related), but hopefully this helps you get unstuck.

Bruno Bernardino
  • 476
  • 2
  • 5
  • 12
0

In case you have downgrade your version of Elasticsearch, Elasticsearch is not able to understand files mades by the most recent version, so one solution is to delete the data directory (be careful it will delete all your data)

rm -rf System/Volumes/Data/usr/local/var/lib/elasticsearch/nodes

Or the other solution is to go back to your previous version (the recent one)

Morgan
  • 37
  • 6