Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

docker compose not work #477

Open
vvvli1 opened this issue Apr 11, 2024 · 7 comments
Open

docker compose not work #477

vvvli1 opened this issue Apr 11, 2024 · 7 comments
Labels
bug Something isn't working

Comments

@vvvli1
Copy link

vvvli1 commented Apr 11, 2024

Device Information (please complete the following information):

  • OS: [Macos 14.4.1 ]
  • Deployment: [Docker(Orbstack 1.5.1)]
  • Browser (if relevant): [ safari]
  • SIST2 Version: [simon987/sist2:3.4.2-x64-linux]
  • Elasticsearch Version (7.17.9) : ``

Command with arguments
docker compose up -d

Describe the bug
Elasticsearch container can not start, it restart again and again.
Here is the log

{"type": "server", "timestamp": "2024-04-10T22:17:44,413Z", "level": "INFO", "component": "o.e.n.Node", "cluster.name": "docker-cluster", "node.name": "ccfcacfb9176", "message": "version[7.17.9], pid[7], build[default/docker/ef48222227ee6b9e70e502f0f0daa52435ee634d/2023-01-31T05:34:43.305517834Z], OS[Linux/6.7.11-orbstack-00143-ge6b82e26cd22/aarch64], JVM[Oracle Corporation/OpenJDK 64-Bit Server VM/19.0.2/19.0.2+7-44]" }
{"type": "server", "timestamp": "2024-04-10T22:17:44,415Z", "level": "INFO", "component": "o.e.n.Node", "cluster.name": "docker-cluster", "node.name": "ccfcacfb9176", "message": "JVM home [/usr/share/elasticsearch/jdk], using bundled JDK [true]" }
{"type": "server", "timestamp": "2024-04-10T22:17:44,415Z", "level": "INFO", "component": "o.e.n.Node", "cluster.name": "docker-cluster", "node.name": "ccfcacfb9176", "message": "JVM arguments [-Xshare:auto, -Des.networkaddress.cache.ttl=60, -Des.networkaddress.cache.negative.ttl=10, -XX:+AlwaysPreTouch, -Xss1m, -Djava.awt.headless=true, -Dfile.encoding=UTF-8, -Djna.nosys=true, -XX:-OmitStackTraceInFastThrow, -XX:+ShowCodeDetailsInExceptionMessages, -Dio.netty.noUnsafe=true, -Dio.netty.noKeySetOptimization=true, -Dio.netty.recycler.maxCapacityPerThread=0, -Dio.netty.allocator.numDirectArenas=0, -Dlog4j.shutdownHookEnabled=false, -Dlog4j2.disable.jmx=true, -Dlog4j2.formatMsgNoLookups=true, -Djava.locale.providers=SPI,COMPAT, --add-opens=java.base/java.io=ALL-UNNAMED, -Djava.security.manager=allow, -XX:+UseG1GC, -Djava.io.tmpdir=/tmp/elasticsearch-11674212644239017817, -XX:+HeapDumpOnOutOfMemoryError, -XX:+ExitOnOutOfMemoryError, -XX:HeapDumpPath=data, -XX:ErrorFile=logs/hs_err_pid%p.log, -Xlog:gc*,gc+age=trace,safepoint:file=logs/gc.log:utctime,pid,tags:filecount=32,filesize=64m, -Des.cgroups.hierarchy.override=/, -Xms2g, -Xmx2g, -XX:MaxDirectMemorySize=1073741824, -XX:G1HeapRegionSize=4m, -XX:InitiatingHeapOccupancyPercent=30, -XX:G1ReservePercent=15, -Des.path.home=/usr/share/elasticsearch, -Des.path.conf=/usr/share/elasticsearch/config, -Des.distribution.flavor=default, -Des.distribution.type=docker, -Des.bundled_jdk=true]" }
{"type": "server", "timestamp": "2024-04-10T22:17:45,584Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "ccfcacfb9176", "message": "loaded module [aggs-matrix-stats]" }
{"type": "server", "timestamp": "2024-04-10T22:17:45,584Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "ccfcacfb9176", "message": "loaded module [analysis-common]" }
{"type": "server", "timestamp": "2024-04-10T22:17:45,584Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "ccfcacfb9176", "message": "loaded module [constant-keyword]" }
{"type": "server", "timestamp": "2024-04-10T22:17:45,584Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "ccfcacfb9176", "message": "loaded module [frozen-indices]" }
{"type": "server", "timestamp": "2024-04-10T22:17:45,584Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "ccfcacfb9176", "message": "loaded module [ingest-common]" }
{"type": "server", "timestamp": "2024-04-10T22:17:45,584Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "ccfcacfb9176", "message": "loaded module [ingest-geoip]" }
{"type": "server", "timestamp": "2024-04-10T22:17:45,584Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "ccfcacfb9176", "message": "loaded module [ingest-user-agent]" }
{"type": "server", "timestamp": "2024-04-10T22:17:45,584Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "ccfcacfb9176", "message": "loaded module [kibana]" }
{"type": "server", "timestamp": "2024-04-10T22:17:45,584Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "ccfcacfb9176", "message": "loaded module [lang-expression]" }
{"type": "server", "timestamp": "2024-04-10T22:17:45,584Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "ccfcacfb9176", "message": "loaded module [lang-mustache]" }
{"type": "server", "timestamp": "2024-04-10T22:17:45,584Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "ccfcacfb9176", "message": "loaded module [lang-painless]" }
{"type": "server", "timestamp": "2024-04-10T22:17:45,585Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "ccfcacfb9176", "message": "loaded module [legacy-geo]" }
{"type": "server", "timestamp": "2024-04-10T22:17:45,585Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "ccfcacfb9176", "message": "loaded module [mapper-extras]" }
{"type": "server", "timestamp": "2024-04-10T22:17:45,585Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "ccfcacfb9176", "message": "loaded module [mapper-version]" }
{"type": "server", "timestamp": "2024-04-10T22:17:45,585Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "ccfcacfb9176", "message": "loaded module [parent-join]" }
{"type": "server", "timestamp": "2024-04-10T22:17:45,585Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "ccfcacfb9176", "message": "loaded module [percolator]" }
{"type": "server", "timestamp": "2024-04-10T22:17:45,585Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "ccfcacfb9176", "message": "loaded module [rank-eval]" }
{"type": "server", "timestamp": "2024-04-10T22:17:45,585Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "ccfcacfb9176", "message": "loaded module [reindex]" }
{"type": "server", "timestamp": "2024-04-10T22:17:45,585Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "ccfcacfb9176", "message": "loaded module [repositories-metering-api]" }
{"type": "server", "timestamp": "2024-04-10T22:17:45,585Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "ccfcacfb9176", "message": "loaded module [repository-encrypted]" }
{"type": "server", "timestamp": "2024-04-10T22:17:45,585Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "ccfcacfb9176", "message": "loaded module [repository-url]" }
{"type": "server", "timestamp": "2024-04-10T22:17:45,585Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "ccfcacfb9176", "message": "loaded module [runtime-fields-common]" }
{"type": "server", "timestamp": "2024-04-10T22:17:45,585Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "ccfcacfb9176", "message": "loaded module [search-business-rules]" }
{"type": "server", "timestamp": "2024-04-10T22:17:45,585Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "ccfcacfb9176", "message": "loaded module [searchable-snapshots]" }
{"type": "server", "timestamp": "2024-04-10T22:17:45,585Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "ccfcacfb9176", "message": "loaded module [snapshot-repo-test-kit]" }
{"type": "server", "timestamp": "2024-04-10T22:17:45,586Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "ccfcacfb9176", "message": "loaded module [spatial]" }
{"type": "server", "timestamp": "2024-04-10T22:17:45,586Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "ccfcacfb9176", "message": "loaded module [transform]" }
{"type": "server", "timestamp": "2024-04-10T22:17:45,586Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "ccfcacfb9176", "message": "loaded module [transport-netty4]" }
{"type": "server", "timestamp": "2024-04-10T22:17:45,586Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "ccfcacfb9176", "message": "loaded module [unsigned-long]" }
{"type": "server", "timestamp": "2024-04-10T22:17:45,586Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "ccfcacfb9176", "message": "loaded module [vector-tile]" }
{"type": "server", "timestamp": "2024-04-10T22:17:45,586Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "ccfcacfb9176", "message": "loaded module [vectors]" }
{"type": "server", "timestamp": "2024-04-10T22:17:45,586Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "ccfcacfb9176", "message": "loaded module [wildcard]" }
{"type": "server", "timestamp": "2024-04-10T22:17:45,586Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "ccfcacfb9176", "message": "loaded module [x-pack-aggregate-metric]" }
{"type": "server", "timestamp": "2024-04-10T22:17:45,586Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "ccfcacfb9176", "message": "loaded module [x-pack-analytics]" }
{"type": "server", "timestamp": "2024-04-10T22:17:45,586Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "ccfcacfb9176", "message": "loaded module [x-pack-async]" }
{"type": "server", "timestamp": "2024-04-10T22:17:45,586Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "ccfcacfb9176", "message": "loaded module [x-pack-async-search]" }
{"type": "server", "timestamp": "2024-04-10T22:17:45,586Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "ccfcacfb9176", "message": "loaded module [x-pack-autoscaling]" }
{"type": "server", "timestamp": "2024-04-10T22:17:45,586Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "ccfcacfb9176", "message": "loaded module [x-pack-ccr]" }
{"type": "server", "timestamp": "2024-04-10T22:17:45,586Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "ccfcacfb9176", "message": "loaded module [x-pack-core]" }
{"type": "server", "timestamp": "2024-04-10T22:17:45,587Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "ccfcacfb9176", "message": "loaded module [x-pack-data-streams]" }
{"type": "server", "timestamp": "2024-04-10T22:17:45,587Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "ccfcacfb9176", "message": "loaded module [x-pack-deprecation]" }
{"type": "server", "timestamp": "2024-04-10T22:17:45,587Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "ccfcacfb9176", "message": "loaded module [x-pack-enrich]" }
{"type": "server", "timestamp": "2024-04-10T22:17:45,587Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "ccfcacfb9176", "message": "loaded module [x-pack-eql]" }
{"type": "server", "timestamp": "2024-04-10T22:17:45,587Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "ccfcacfb9176", "message": "loaded module [x-pack-fleet]" }
{"type": "server", "timestamp": "2024-04-10T22:17:45,587Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "ccfcacfb9176", "message": "loaded module [x-pack-graph]" }
{"type": "server", "timestamp": "2024-04-10T22:17:45,587Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "ccfcacfb9176", "message": "loaded module [x-pack-identity-provider]" }
{"type": "server", "timestamp": "2024-04-10T22:17:45,587Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "ccfcacfb9176", "message": "loaded module [x-pack-ilm]" }
{"type": "server", "timestamp": "2024-04-10T22:17:45,587Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "ccfcacfb9176", "message": "loaded module [x-pack-logstash]" }
{"type": "server", "timestamp": "2024-04-10T22:17:45,587Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "ccfcacfb9176", "message": "loaded module [x-pack-ml]" }
{"type": "server", "timestamp": "2024-04-10T22:17:45,587Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "ccfcacfb9176", "message": "loaded module [x-pack-monitoring]" }
{"type": "server", "timestamp": "2024-04-10T22:17:45,587Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "ccfcacfb9176", "message": "loaded module [x-pack-ql]" }
{"type": "server", "timestamp": "2024-04-10T22:17:45,587Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "ccfcacfb9176", "message": "loaded module [x-pack-rollup]" }
{"type": "server", "timestamp": "2024-04-10T22:17:45,587Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "ccfcacfb9176", "message": "loaded module [x-pack-security]" }
{"type": "server", "timestamp": "2024-04-10T22:17:45,587Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "ccfcacfb9176", "message": "loaded module [x-pack-shutdown]" }
{"type": "server", "timestamp": "2024-04-10T22:17:45,587Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "ccfcacfb9176", "message": "loaded module [x-pack-sql]" }
{"type": "server", "timestamp": "2024-04-10T22:17:45,587Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "ccfcacfb9176", "message": "loaded module [x-pack-stack]" }
{"type": "server", "timestamp": "2024-04-10T22:17:45,588Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "ccfcacfb9176", "message": "loaded module [x-pack-text-structure]" }
{"type": "server", "timestamp": "2024-04-10T22:17:45,588Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "ccfcacfb9176", "message": "loaded module [x-pack-voting-only-node]" }
{"type": "server", "timestamp": "2024-04-10T22:17:45,588Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "ccfcacfb9176", "message": "loaded module [x-pack-watcher]" }
{"type": "server", "timestamp": "2024-04-10T22:17:45,588Z", "level": "INFO", "component": "o.e.p.PluginsService", "cluster.name": "docker-cluster", "node.name": "ccfcacfb9176", "message": "no plugins loaded" }
{"type": "server", "timestamp": "2024-04-10T22:17:45,621Z", "level": "ERROR", "component": "o.e.b.ElasticsearchUncaughtExceptionHandler", "cluster.name": "docker-cluster", "node.name": "ccfcacfb9176", "message": "uncaught exception in thread [main]",
"stacktrace": ["org.elasticsearch.bootstrap.StartupException: ElasticsearchException[failed to bind service]; nested: AccessDeniedException[/usr/share/elasticsearch/data/nodes];",
"at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:173) ~[elasticsearch-7.17.9.jar:7.17.9]",
"at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:160) ~[elasticsearch-7.17.9.jar:7.17.9]",
"at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:77) ~[elasticsearch-7.17.9.jar:7.17.9]",
"at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:112) ~[elasticsearch-cli-7.17.9.jar:7.17.9]",
"at org.elasticsearch.cli.Command.main(Command.java:77) ~[elasticsearch-cli-7.17.9.jar:7.17.9]",
"at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:125) ~[elasticsearch-7.17.9.jar:7.17.9]",
"at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:80) ~[elasticsearch-7.17.9.jar:7.17.9]",
"Caused by: org.elasticsearch.ElasticsearchException: failed to bind service",
"at org.elasticsearch.node.Node.(Node.java:1088) ~[elasticsearch-7.17.9.jar:7.17.9]",
"at org.elasticsearch.node.Node.(Node.java:309) ~[elasticsearch-7.17.9.jar:7.17.9]",
"at org.elasticsearch.bootstrap.Bootstrap$5.(Bootstrap.java:234) ~[elasticsearch-7.17.9.jar:7.17.9]",
"at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:234) ~[elasticsearch-7.17.9.jar:7.17.9]",
"at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:434) ~[elasticsearch-7.17.9.jar:7.17.9]",
"at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:169) ~[elasticsearch-7.17.9.jar:7.17.9]",
"... 6 more",
"Caused by: java.nio.file.AccessDeniedException: /usr/share/elasticsearch/data/nodes",
"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.createDirectory(UnixFileSystemProvider.java:397) ~[?:?]",
"at java.nio.file.Files.createDirectory(Files.java:700) ~[?:?]",
"at java.nio.file.Files.createAndCheckIsDirectory(Files.java:807) ~[?:?]",
"at java.nio.file.Files.createDirectories(Files.java:793) ~[?:?]",
"at org.elasticsearch.env.NodeEnvironment.lambda$new$0(NodeEnvironment.java:300) ~[elasticsearch-7.17.9.jar:7.17.9]",
"at org.elasticsearch.env.NodeEnvironment$NodeLock.(NodeEnvironment.java:224) ~[elasticsearch-7.17.9.jar:7.17.9]",
"at org.elasticsearch.env.NodeEnvironment.(NodeEnvironment.java:298) ~[elasticsearch-7.17.9.jar:7.17.9]",
"at org.elasticsearch.node.Node.(Node.java:429) ~[elasticsearch-7.17.9.jar:7.17.9]",
"at org.elasticsearch.node.Node.(Node.java:309) ~[elasticsearch-7.17.9.jar:7.17.9]",
"at org.elasticsearch.bootstrap.Bootstrap$5.(Bootstrap.java:234) ~[elasticsearch-7.17.9.jar:7.17.9]",
"at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:234) ~[elasticsearch-7.17.9.jar:7.17.9]",
"at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:434) ~[elasticsearch-7.17.9.jar:7.17.9]",
"at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:169) ~[elasticsearch-7.17.9.jar:7.17.9]",
"... 6 more"] }
uncaught exception in thread [main]
ElasticsearchException[failed to bind service]; nested: AccessDeniedException[/usr/share/elasticsearch/data/nodes];
Likely root cause: java.nio.file.AccessDeniedException: /usr/share/elasticsearch/data/nodes
at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:90)
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:397)
at java.base/java.nio.file.Files.createDirectory(Files.java:700)
at java.base/java.nio.file.Files.createAndCheckIsDirectory(Files.java:807)
at java.base/java.nio.file.Files.createDirectories(Files.java:793)
at org.elasticsearch.env.NodeEnvironment.lambda$new$0(NodeEnvironment.java:300)
at org.elasticsearch.env.NodeEnvironment$NodeLock.(NodeEnvironment.java:224)
at org.elasticsearch.env.NodeEnvironment.(NodeEnvironment.java:298)
at org.elasticsearch.node.Node.(Node.java:429)
at org.elasticsearch.node.Node.(Node.java:309)
at org.elasticsearch.bootstrap.Bootstrap$5.(Bootstrap.java:234)
at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:234)
at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:434)
at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:169)
at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:160)
at org.elasticsearch.cli.EnvironmentAwareCommand.execute(EnvironmentAwareCommand.java:77)
at org.elasticsearch.cli.Command.mainWithoutErrorHandling(Command.java:112)
at org.elasticsearch.cli.Command.main(Command.java:77)
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:125)
at org.elasticsearch.bootstrap.Elasticsearch.main(Elasticsearch.java:80)
For complete error details, refer to the log at /usr/share/elasticsearch/logs/docker-cluster.log

Steps To Reproduce
write a compose file as follows

version: "3"

services:
elasticsearch:
image: elasticsearch:7.17.9
restart: unless-stopped
volumes:
# This directory must have 1000:1000 permissions (or update PUID & PGID below)
- /data/sist2-es-data/:/usr/share/elasticsearch/data
environment:
- "discovery.type=single-node"
- "ES_JAVA_OPTS=-Xms2g -Xmx2g"
- "PUID=1000"
- "PGID=1000"
sist2-admin:
image: simon987/sist2:3.4.2-x64-linux
restart: unless-stopped
volumes:
- /data/sist2-admin-data/:/sist2-admin/
- /:/host
ports:
- 4090:4090
# NOTE: Don't expose this port publicly!
- 8080:8080
working_dir: /root/sist2-admin/
entrypoint: python3
command:
- /root/sist2-admin/sist2_admin/app.py

docker compose up -d

Expected behavior

the containers start

Actual Behavior

Elasticsearch container can not start,

Screenshots

Additional context

With these command

docker pull docker.elastic.co/elasticsearch/elasticsearch:7.17.9
docker run -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" docker.elastic.co/elasticsearch/elasticsearch:7.17.9

A docker container starts without problem.

So elasticsearch can work in this way.

@vvvli1 vvvli1 added the bug Something isn't working label Apr 11, 2024
@MarioSob
Copy link

I would suggest using the following docker-compose.yml:

version: '3.9'

services:
  elasticsearch:
    container_name: elasticsearch
    image: elasticsearch:7.17.18
    volumes:
      - /tmp/elasticsearch:/usr/share/elasticsearch/data
    environment:
      - "discovery.type=single-node"
    healthcheck:
      test: curl -s http://localhost:9200 >/dev/null || exit 1
      interval: 3s
      timeout: 5s
      retries: 15
    deploy:
      resources:
        limits:
          memory: 1280m

  sist2:
    container_name: sist2
    image: simon987/sist2:x64-linux
    volumes:
      - /tmp/sist2/admin-data:/sist2-admin
    ports:
      - "21021:21021" # sist2
      - "8080:8080" # sist2-admin
    working_dir: /root/sist2-admin/
    entrypoint: python3 /root/sist2-admin/sist2_admin/app.py
    depends_on:
      elasticsearch:
        condition: service_healthy
    deploy:
      resources:
        limits:
          memory: 1024m

networks:
  default:
    name: sist2

I has several changes:

  • sist2 awaits for ES to be up and ready instead of error-ing if it stands up first
  • ES takes Docker's resources limit into account so no need to use JAVA_OPTS flags
  • ES is instructed to work as single node
  • sist2 has memory limit too so in case of abnormal memory explosion it won't ruin your server by killing other applications
  • all containers run in separate network "sist2" which encapsulates ES from other containers making it private to sist2 (security)

@vvvli1
Copy link
Author

vvvli1 commented Apr 14, 2024

Thank you! It works.

I would suggest using the following docker-compose.yml:

version: '3.9'

services:
  elasticsearch:
    container_name: elasticsearch
    image: elasticsearch:7.17.18
    volumes:
      - /tmp/elasticsearch:/usr/share/elasticsearch/data
    environment:
      - "discovery.type=single-node"
    healthcheck:
      test: curl -s http://localhost:9200 >/dev/null || exit 1
      interval: 3s
      timeout: 5s
      retries: 15
    deploy:
      resources:
        limits:
          memory: 1280m

  sist2:
    container_name: sist2
    image: simon987/sist2:x64-linux
    volumes:
      - /tmp/sist2/admin-data:/sist2-admin
    ports:
      - "21021:21021" # sist2
      - "8080:8080" # sist2-admin
    working_dir: /root/sist2-admin/
    entrypoint: python3 /root/sist2-admin/sist2_admin/app.py
    depends_on:
      elasticsearch:
        condition: service_healthy
    deploy:
      resources:
        limits:
          memory: 1024m

networks:
  default:
    name: sist2

I has several changes:

  • sist2 awaits for ES to be up and ready instead of error-ing if it stands up first
  • ES takes Docker's resources limit into account so no need to use JAVA_OPTS flags
  • ES is instructed to work as single node
  • sist2 has memory limit too so in case of abnormal memory explosion it won't ruin your server by killing other applications
  • all containers run in separate network "sist2" which encapsulates ES from other containers making it private to sist2 (security)

@vvvli1
Copy link
Author

vvvli1 commented Apr 14, 2024

There is a problem. How to use the frontend? I connected to localhost:8080 then set the backend and frontend. The default Listen address of the frontend is 0.0.0.0:4090. But I cannot connected to the frontend by localhost:4090.
Is it because 4090 port is not written in the docker-compose.xml?

I would suggest using the following docker-compose.yml:

version: '3.9'

services:
  elasticsearch:
    container_name: elasticsearch
    image: elasticsearch:7.17.18
    volumes:
      - /tmp/elasticsearch:/usr/share/elasticsearch/data
    environment:
      - "discovery.type=single-node"
    healthcheck:
      test: curl -s http://localhost:9200 >/dev/null || exit 1
      interval: 3s
      timeout: 5s
      retries: 15
    deploy:
      resources:
        limits:
          memory: 1280m

  sist2:
    container_name: sist2
    image: simon987/sist2:x64-linux
    volumes:
      - /tmp/sist2/admin-data:/sist2-admin
    ports:
      - "21021:21021" # sist2
      - "8080:8080" # sist2-admin
    working_dir: /root/sist2-admin/
    entrypoint: python3 /root/sist2-admin/sist2_admin/app.py
    depends_on:
      elasticsearch:
        condition: service_healthy
    deploy:
      resources:
        limits:
          memory: 1024m

networks:
  default:
    name: sist2

I has several changes:

  • sist2 awaits for ES to be up and ready instead of error-ing if it stands up first
  • ES takes Docker's resources limit into account so no need to use JAVA_OPTS flags
  • ES is instructed to work as single node
  • sist2 has memory limit too so in case of abnormal memory explosion it won't ruin your server by killing other applications
  • all containers run in separate network "sist2" which encapsulates ES from other containers making it private to sist2 (security)

@MarioSob
Copy link

MarioSob commented Apr 14, 2024

Right, the docker-compose file I gave you assumes frontend will be configured on port 21021.
You can either set that port in sist2 admin panel or simply go to docker-compose file and change port to 4090 or any other port you like. Just replace line that contains

- "21021:21021" # sist2

to

- "4090:4090" # sist2

Whatever you set there it has to be in sync with what you set in sist2 admin panel as frontend port.

@dpieski
Copy link
Contributor

dpieski commented Jun 4, 2024

Device Information (please complete the following information):

  • OS: [Macos 14.4.1 ]
  • Deployment: [Docker(Orbstack 1.5.1)]
  • Browser (if relevant): [ safari]
  • SIST2 Version: [simon987/sist2:3.4.2-x64-linux]
  • Elasticsearch Version (7.17.9) : ``

Command with arguments docker compose up -d

Describe the bug Elasticsearch container can not start, it restart again and again. Here is the log

{"type": "server", "timestamp": "2024-04-10T22:17:44,413Z", "level": "INFO", "component": "o.e.n.Node", "cluster.name": "docker-cluster", "node.name": "ccfcacfb9176", "message": "version[7.17.9], pid[7], build[default/docker/ef48222227ee6b9e70e502f0f0daa52435ee634d/2023-01-31T05:34:43.305517834Z], OS[Linux/6.7.11-orbstack-00143-ge6b82e26cd22/aarch64], JVM[Oracle Corporation/OpenJDK 64-Bit Server VM/19.0.2/19.0.2+7-44]" }
....
{"type": "server", "timestamp": "2024-04-10T22:17:45,621Z", "level": "ERROR", "component": "o.e.b.ElasticsearchUncaughtExceptionHandler", "cluster.name": "docker-cluster", "node.name": "ccfcacfb9176", "message": "uncaught exception in thread [main]", "stacktrace": ["org.elasticsearch.bootstrap.StartupException: ElasticsearchException[failed to bind service]; nested: AccessDeniedException[/usr/share/elasticsearch/data/nodes];", 
...
"uncaught exception in thread [main] ElasticsearchException[failed to bind service]; nested: ***AccessDeniedException***[/usr/share/elasticsearch/data/nodes]; Likely root cause: java.nio.file.AccessDeniedException: /usr/share/elasticsearch/data/nodes at java.base/sun.nio.fs.UnixException.translateToIOException(UnixException.java:90) ...

This is an "Access Denied Exception". Notice the comment in the compose file stating "This directory must have 1000:1000 permissions (or update PUID & PGID below)" - If you want to use this Compose file, fix that line. Figure out what the PUID/PGID should be and update them here. Or make sure 1000/1000 has access to the /data/sist2-es-data/ directory.

version: "3"
services: 
  elasticsearch: 
    image: elasticsearch:7.17.9 
    restart: unless-stopped 
    volumes: 
      # This directory must have 1000:1000 permissions (or update PUID & PGID below) 
      - /data/sist2-es-data/:/usr/share/elasticsearch/data 
    environment: 
      - "discovery.type=single-node" 
      - "ES_JAVA_OPTS=-Xms2g -Xmx2g" 
      - "PUID=1000" 
      - "PGID=1000" 

  sist2-admin: 
    image: simon987/sist2:3.4.2-x64-linux 
    restart: unless-stopped 
    volumes: 
      - /data/sist2-admin-data/:/sist2-admin/ 
      - /:/host 
    ports: 
      - 4090:4090 
      # NOTE: Don't expose this port publicly! 
      - 8080:8080 
    working_dir: /root/sist2-admin/ 
    entrypoint: python3 
    command: 
      - /root/sist2-admin/sist2_admin/app.py

You said the following commands worked:
docker pull docker.elastic.co/elasticsearch/elasticsearch:7.17.9
docker run -p 9200:9200 -p 9300:9300 -e "discovery.type=single-node" docker.elastic.co/elasticsearch/elasticsearch:7.17.9

This is because those commands do not include the bind mounts to the Volumes.

The Compose file provided by MarioSob works for you because linux allows all users of the system to access files/folders under the /tmp directory. So you do not have permission issues accessing /tmp/elasticsearch

The downside to using that directory for your actual data that you want to persist is that everyone on the system has access to the directory and the files placed in /tmp may be removed during various reboots / updates / upgrades of the system and should not be considered a persistent location.

For longer term use, you should figure out your permissions issue.

ETA: Using Version in Docker Compose files is deprecated and no longer needed. That line can be removed.

@MarioSob
Copy link

MarioSob commented Jun 4, 2024

Right, I'm sorry, as I though that will be obvious, I forgot to underline that volumes I provided in my example files require modifying to something more useful. Namely the paths:

  • /tmp/elasticsearch
  • /tmp/sist2/admin-data

Should be replaced with some persistent paths you desire to keep. Docker will access those paths as root user.
Adding to that you may want to modify ports (ports section) as mentioned in comments above.

@whimsee
Copy link

whimsee commented Jan 22, 2025

Had the same AccessDenied issue and I realized that (at least in TrueNAS with its permission handling and installed via Portainer) it doesn't respect the PUID and PGID env var. The folder must be owned by root. Setting it to another owner will cause the error.

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

4 participants