elastic / helm-charts

You know, for Kubernetes
Apache License 2.0
1.89k stars 1.93k forks source link

Elasticsearch 7.17 - persistencevolume error FileSystemException[/usr/share/elasticsearch/data/nodes/0: Not a directory] #1681

Open rlatjd1f opened 2 years ago

rlatjd1f commented 2 years ago

I cloned the elasticserach 7.10 branch version and installed it as Helm. I tried to run it right away without a separate setting, but the following error occurred.

{"type": "server", "timestamp": "2022-08-08T05:48:08,390Z", "level": "ERROR", "component": "o.e.b.ElasticsearchUncaughtExceptionHandler", "cluster.name": "elasticsearch", "node.name": "elasticsearch-master-0", "message": "uncaught exception in thread [main]", 
"stacktrace": ["org.elasticsearch.bootstrap.StartupException: ElasticsearchException[failed to bind service]; nested: FileSystemException[/usr/share/elasticsearch/data/nodes/0: Not a directory];",
"at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:174) ~[elasticsearch-7.10.3-SNAPSHOT.jar:7.10.3-SNAPSHOT]",
"at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:161) ~[elasticsearch-7.10.3-SNAPSHOT.jar:7.10.3-SNAPSHOT]",
"at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86) ~[elasticsearch-7.10.3-SNAPSHOT.jar:7.10.3-SNAPSHOT]",
"at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:127) ~[elasticsearch-cli-7.10.3-SNAPSHOT.jar:7.10.3-SNAPSHOT]",
"at org.elasticsearch.cli.Command.main(Command.java:90) ~[elasticsearch-cli-7.10.3-SNAPSHOT.jar:7.10.3-SNAPSHOT]",
"at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:126) ~[elasticsearch-7.10.3-SNAPSHOT.jar:7.10.3-SNAPSHOT]",
"at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:92) ~[elasticsearch-7.10.3-SNAPSHOT.jar:7.10.3-SNAPSHOT]",
"Caused by: org.elasticsearch.ElasticsearchException: failed to bind service",
"at org.elasticsearch.node.Node.<init>(Node.java:729) ~[elasticsearch-7.10.3-SNAPSHOT.jar:7.10.3-SNAPSHOT]",
"at org.elasticsearch.node.Node.<init>(Node.java:289) ~[elasticsearch-7.10.3-SNAPSHOT.jar:7.10.3-SNAPSHOT]",
"at org.elasticsearch.bootstrap.Bootstrap$5.<init>(Bootstrap.java:227) ~[elasticsearch-7.10.3-SNAPSHOT.jar:7.10.3-SNAPSHOT]",
"at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:227) ~[elasticsearch-7.10.3-SNAPSHOT.jar:7.10.3-SNAPSHOT]",
"at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:393) ~[elasticsearch-7.10.3-SNAPSHOT.jar:7.10.3-SNAPSHOT]",
"at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:170) ~[elasticsearch-7.10.3-SNAPSHOT.jar:7.10.3-SNAPSHOT]",
"... 6 more",
"Caused by: java.nio.file.FileSystemException: /usr/share/elasticsearch/data/nodes/0: Not a directory",
"at sun.nio.fs.UnixException.translateToIOException(UnixException.java:100) ~[?:?]",
"at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:106) ~[?:?]",
"at sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111) ~[?:?]",
"at sun.nio.fs.UnixFileSystemProvider.createDirectory(UnixFileSystemProvider.java:388) ~[?:?]",
"at java.nio.file.Files.createDirectory(Files.java:694) ~[?:?]",
"at java.nio.file.Files.createAndCheckIsDirectory(Files.java:801) ~[?:?]",
"at java.nio.file.Files.createDirectories(Files.java:787) ~[?:?]",
"at org.elasticsearch.env.NodeEnvironment.lambda$new$0(NodeEnvironment.java:275) ~[elasticsearch-7.10.3-SNAPSHOT.jar:7.10.3-SNAPSHOT]",
uncaught exception in thread [main]
ElasticsearchException[failed to bind service]; nested: FileSystemException[/usr/share/elasticsearch/data/nodes/0: Not a directory];
Likely root cause: java.nio.file.FileSystemException: /usr/share/elasticsearch/data/nodes/0: Not a directory
        at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:100)
        at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:106)
        at java.base/sun.nio.fs.UnixException.rethrowAsIOException(UnixException.java:111)
        at java.base/sun.nio.fs.UnixFileSystemProvider.createDirectory(UnixFileSystemProvider.java:388)
        at java.base/java.nio.file.Files.createDirectory(Files.java:694)
        at java.base/java.nio.file.Files.createAndCheckIsDirectory(Files.java:801)
        at java.base/java.nio.file.Files.createDirectories(Files.java:787)
        at org.elasticsearch.env.NodeEnvironment.lambda$new$0(NodeEnvironment.java:275)
        at org.elasticsearch.env.NodeEnvironment$NodeLock.<init>(NodeEnvironment.java:212)
        at org.elasticsearch.env.NodeEnvironment.<init>(NodeEnvironment.java:272)
        at org.elasticsearch.node.Node.<init>(Node.java:362)
        at org.elasticsearch.node.Node.<init>(Node.java:289)
        at org.elasticsearch.bootstrap.Bootstrap$5.<init>(Bootstrap.java:227)
        at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:227)
        at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:393)
        at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:170)
        at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:161)
        at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:86)
        at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:127)
        at org.elasticsearch.cli.Command.main(Command.java:90)
        at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:126)
"at org.elasticsearch.env.NodeEnvironment$NodeLock.<init>(NodeEnvironment.java:212) ~[elasticsearch-7.10.3-SNAPSHOT.jar:7.10.3-SNAPSHOT]",
        at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:92)
For complete error details, refer to the log at /usr/share/elasticsearch/logs/elasticsearch.log
"at org.elasticsearch.env.NodeEnvironment.<init>(NodeEnvironment.java:272) ~[elasticsearch-7.10.3-SNAPSHOT.jar:7.10.3-SNAPSHOT]",
"at org.elasticsearch.node.Node.<init>(Node.java:362) ~[elasticsearch-7.10.3-SNAPSHOT.jar:7.10.3-SNAPSHOT]",
"at org.elasticsearch.node.Node.<init>(Node.java:289) ~[elasticsearch-7.10.3-SNAPSHOT.jar:7.10.3-SNAPSHOT]",
"at org.elasticsearch.bootstrap.Bootstrap$5.<init>(Bootstrap.java:227) ~[elasticsearch-7.10.3-SNAPSHOT.jar:7.10.3-SNAPSHOT]",
"at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:227) ~[elasticsearch-7.10.3-SNAPSHOT.jar:7.10.3-SNAPSHOT]",
"at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:393) ~[elasticsearch-7.10.3-SNAPSHOT.jar:7.10.3-SNAPSHOT]",
"at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:170) ~[elasticsearch-7.10.3-SNAPSHOT.jar:7.10.3-SNAPSHOT]",
"... 6 more"] }

I thought the problem was caused by the lack of the directory on the local equipment, so I also created the /usr/share/elasticsearch/data/nodes/0 directory and gave user rights with the chown command, but the error still occurred.

In Elasticsearch's values.yaml file line 130, it was set as follows, but I have to use persistent to preserve data permanently, but I keep getting errors, so I am at a loss what to do.

persistence:
  enabled: true
  labels:
    # # Add default labels for the volumeClaimTemplate of the StatefulSet
    enabled: false
  annotations: {}
Syingc commented 2 years ago

I have the same problem and it has been bothering me for a long time. It can be solved by deleting the following configuration. Do you have any other good solutions? ` capabilities: drop:

botelastic[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.