Failed to start Elasticsearch.7.15.2

I want to start Elasticsearch v7.12.1. But it is not working. I don't know what is wrong. Someone help me, please!!!!!!!!

elasticsearch.service - Elasticsearch
   Loaded: loaded (/usr/lib/systemd/system/elasticsearch.service; enabled; vendor preset: enabled)
   Active: failed (Result: exit-code) since Wed 2021-11-17 01:29:29 +07; 7s ago
     Docs: https://www.elastic.co
  Process: 25418 ExecStart=/usr/share/elasticsearch/bin/systemd-entrypoint -p ${PID_DIR}/elasticsearch.pid --quiet (code=exited, status=1/FAILURE)
 Main PID: 25418 (code=exited, status=1/FAILURE)

Thg 11 17 01:29:28 dell-Precision-M4800 systemd-entrypoint[25418]:         at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:150)
Thg 11 17 01:29:28 dell-Precision-M4800 systemd-entrypoint[25418]:         at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:75)
Thg 11 17 01:29:28 dell-Precision-M4800 systemd-entrypoint[25418]:         at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:116)
Thg 11 17 01:29:28 dell-Precision-M4800 systemd-entrypoint[25418]:         at org.elasticsearch.cli.Command.main(Command.java:79)
Thg 11 17 01:29:28 dell-Precision-M4800 systemd-entrypoint[25418]:         at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:115)
Thg 11 17 01:29:28 dell-Precision-M4800 systemd-entrypoint[25418]:         at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:81)
Thg 11 17 01:29:28 dell-Precision-M4800 systemd-entrypoint[25418]: For complete error details, refer to the log at /var/log/elasticsearch/elasticsearch.log
Thg 11 17 01:29:29 dell-Precision-M4800 systemd[1]: elasticsearch.service: Main process exited, code=exited, status=1/FAILURE
Thg 11 17 01:29:29 dell-Precision-M4800 systemd[1]: elasticsearch.service: Failed with result 'exit-code'.
Thg 11 17 01:29:29 dell-Precision-M4800 systemd[1]: Failed to start Elasticsearch.

As it says:

1 Like

I read file Elasticsearch.log and found the notice

org.elasticsearch.ElasticsearchException: failed to bind service
	at org.elasticsearch.node.Node.<init>(Node.java:744) ~[elasticsearch-7.12.1.jar:7.12.1]
	at org.elasticsearch.node.Node.<init>(Node.java:278) ~[elasticsearch-7.12.1.jar:7.12.1]
	at org.elasticsearch.bootstrap.Bootstrap$5.<init>(Bootstrap.java:217)

Can you show me what it is? Please!

These few lines aren't helpful unfortunately. If you need help understanding the log, please share it in full.

2 Likes

This is the log content. It says Unable to access 'path.data', but i don't know how to fix :sneezing_face:

[2021-11-17T23:40:12,226][ERROR][o.e.b.Bootstrap          ] [dell-Precision-M4800] Exception
java.lang.IllegalStateException: Unable to access 'path.data' (/var/lib/elasticsearch)
	at org.elasticsearch.bootstrap.FilePermissionUtils.addDirectoryPath(FilePermissionUtils.java:61) ~[elasticsearch-7.15.2.jar:7.15.2]
	at org.elasticsearch.bootstrap.Security.addFilePermissions(Security.java:208) ~[elasticsearch-7.15.2.jar:7.15.2]
	at org.elasticsearch.bootstrap.Security.createPermissions(Security.java:155) ~[elasticsearch-7.15.2.jar:7.15.2]
	at org.elasticsearch.bootstrap.Security.configure(Security.java:105) ~[elasticsearch-7.15.2.jar:7.15.2]
	at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:214) ~[elasticsearch-7.15.2.jar:7.15.2]
	at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:399) [elasticsearch-7.15.2.jar:7.15.2]
	at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:167) [elasticsearch-7.15.2.jar:7.15.2]
	at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:158) [elasticsearch-7.15.2.jar:7.15.2]
	at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:75) [elasticsearch-7.15.2.jar:7.15.2]
	at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:114) [elasticsearch-cli-7.15.2.jar:7.15.2]
	at org.elasticsearch.cli.Command.main(Command.java:79) [elasticsearch-cli-7.15.2.jar:7.15.2]
	at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:123) [elasticsearch-7.15.2.jar:7.15.2]
	at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:81) [elasticsearch-7.15.2.jar:7.15.2]
Caused by: java.nio.file.AccessDeniedException: /var/lib/elasticsearch
	at sun.nio.fs.UnixException.translateToIOException(UnixException.java:90) ~[?:?]
	at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:106) ~[?:?]
	at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111) ~[?:?]
	at sun.nio.fs.UnixFileSystemProvider.checkAccess(UnixFileSystemProvider.java:314) ~[?:?]
	at org.elasticsearch.bootstrap.Security.ensureDirectoryExists(Security.java:296) ~[elasticsearch-7.15.2.jar:7.15.2]
	at org.elasticsearch.bootstrap.FilePermissionUtils.addDirectoryPath(FilePermissionUtils.java:59) ~[elasticsearch-7.15.2.jar:7.15.2]
	... 12 more
[2021-11-17T23:40:12,238][ERROR][o.e.b.ElasticsearchUncaughtExceptionHandler] [dell-Precision-M4800] uncaught exception in thread [main]
org.elasticsearch.bootstrap.StartupException: java.lang.IllegalStateException: Unable to access 'path.data' (/var/lib/elasticsearch)
	at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:171) ~[elasticsearch-7.15.2.jar:7.15.2]
	at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:158) ~[elasticsearch-7.15.2.jar:7.15.2]
	at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:75) ~[elasticsearch-7.15.2.jar:7.15.2]
	at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:114) ~[elasticsearch-cli-7.15.2.jar:7.15.2]
	at org.elasticsearch.cli.Command.main(Command.java:79) ~[elasticsearch-cli-7.15.2.jar:7.15.2]
	at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:123) ~[elasticsearch-7.15.2.jar:7.15.2]
	at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:81) ~[elasticsearch-7.15.2.jar:7.15.2]
Caused by: java.lang.IllegalStateException: Unable to access 'path.data' (/var/lib/elasticsearch)
	at org.elasticsearch.bootstrap.FilePermissionUtils.addDirectoryPath(FilePermissionUtils.java:61) ~[elasticsearch-7.15.2.jar:7.15.2]
	at org.elasticsearch.bootstrap.Security.addFilePermissions(Security.java:208) ~[elasticsearch-7.15.2.jar:7.15.2]
	at org.elasticsearch.bootstrap.Security.createPermissions(Security.java:155) ~[elasticsearch-7.15.2.jar:7.15.2]
	at org.elasticsearch.bootstrap.Security.configure(Security.java:105) ~[elasticsearch-7.15.2.jar:7.15.2]
	at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:214) ~[elasticsearch-7.15.2.jar:7.15.2]
	at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:399) ~[elasticsearch-7.15.2.jar:7.15.2]
	at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:167) ~[elasticsearch-7.15.2.jar:7.15.2]
	... 6 more
Caused by: java.nio.file.AccessDeniedException: /var/lib/elasticsearch
	at sun.nio.fs.UnixException.translateToIOException(UnixException.java:90) ~[?:?]
	at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:106) ~[?:?]
	at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111) ~[?:?]
	at sun.nio.fs.UnixFileSystemProvider.checkAccess(UnixFileSystemProvider.java:314) ~[?:?]
	at org.elasticsearch.bootstrap.Security.ensureDirectoryExists(Security.java:296) ~[elasticsearch-7.15.2.jar:7.15.2]
	at org.elasticsearch.bootstrap.FilePermissionUtils.addDirectoryPath(FilePermissionUtils.java:59) ~[elasticsearch-7.15.2.jar:7.15.2]
	at org.elasticsearch.bootstrap.Security.addFilePermissions(Security.java:208) ~[elasticsearch-7.15.2.jar:7.15.2]
	at org.elasticsearch.bootstrap.Security.createPermissions(Security.java:155) ~[elasticsearch-7.15.2.jar:7.15.2]
	at org.elasticsearch.bootstrap.Security.configure(Security.java:105) ~[elasticsearch-7.15.2.jar:7.15.2]
	at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:214) ~[elasticsearch-7.15.2.jar:7.15.2]
	at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:399) ~[elasticsearch-7.15.2.jar:7.15.2]
	at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:167) ~[elasticsearch-7.15.2.jar:7.15.2]
	... 6 more

The user as which you're running Elasticsearch doesn't have permission to access this path. Either give it permission or choose a different path.

Thank you so much :smiling_face_with_three_hearts:. I ran complete Elasticsearch

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