Can't start elasticsearch 8.5 with docker

I'm trying to execute the docker-compose.yml from this page Install Elasticsearch with Docker | Elasticsearch Guide [8.5] | Elastic
In the .env file, I left everything to default except the two passwords

Ther first service "setup" starts without issues. The second service "es01" fails, here is the end of the output

{"@timestamp":"2022-11-02T16:20:56.995Z", "log.level": "INFO", "message":"Native controller process has stopped - no new native processes can be started", "ecs.version": "1.2.0","service.name":"ES_ECS","event.dataset":"elasticsearch.server","process.thread.name":"ml-cpp-log-tail-thread","log.logger":"org.elasticsearch.xpack.ml.process.NativeController","elasticsearch.node.name":"es01","elasticsearch.cluster","log.logger":"org.elasticsearch.node.Node","elasticsearch.node.name":.name":"docker-cluster"}
2022-11-02 16:20:57,001 process reaper (pid 235) ERROR Recursive call to appender rolling   
{"@timestamp":"2022-11-02T15:13:40.397Z", "log.level":"ERROR", "message":"uncaught exception in thread [process reaper (pid 234)]", "ecs.version": "1.2.0","service.name":"ES_ECS","event.dataset":"elasticsearch.server","process.thread.name":"process reaper (pid 234)","log.logger":"org.elasticsearch.bootstrap.ElasticsearchUncaughtExceptionHandler","elasticsearch.node.name":"es01","error.type":"java.security.AccessControlException","error.message":"access denied (\"java.lang.RuntimePermission\" \"modifyThread\")","error.stack_trace":"java.security.AccessControlException: access denied (\"java.lang.RuntimePermission\" (I truncated the callstack for brevety)
ERROR: [1] bootstrap checks failed. You must address the points described in the following [1] lines before starting Elasticsearch.
es01_1 exited with code 78

yeah same. Unclear what to do. I made some changes to java.policy per the recommendations of others, but, no dice so far

Same issue here. Is this logged as an issue in the github project?

One question for you, what is the OS of server that the docker engine is running on?

sysctl -w vm.max_map_count=262144 on my host machine worked for me.

I have Docker Desktop running on a windows machine, but using Linux containers

Open CMD / Powershell and run following command:
This command let you access to docker desktop env

wsl -d docker-desktop

And command to increate limit in wsl

sysctl -w vm.max_map_count=262144
1 Like

Hi everyone. I'm running into the same issue when trying to spin up Elasticsearch in a container on my Mac. I only see this error when I set xpack.security.enabled: true. When security is disabled, the container runs successfully.

Note: I've tried letting Docker use all the available RAM (16GB) and all the available Swap (4GB). That didn't fix my problem. The reason I tried that is because of the comments on this stackoverflow answer.
I've also tried adding the line RUN sysctl -w vm.max_map_count=262144 to the relevant Dockerfile. That hasn't helped either. I did confirm that the command works by first starting the container with security disabled, executing into the container and running sysctl -a to view all the variables; among them was max_map_count=262144.

I would very much appreciate any help that you can provide. :slight_smile:

Did you try to run the command?

From the command line, run:

screen ~/Library/Containers/com.docker.docker/Data/vms/0/tty

Press enter and use sysctl to configure vm.max_map_count :

sysctl -w vm.max_map_count=262144

To exit the screen session, type Ctrl a d.

Note: I've never used screen, but I use tmux regularly.
I'm having trouble running the command you provided.
screen ~/Library/Containers/com.docker.docker/Data/vms/0/tty gives Cannot exec ... No such file or directory.

ls -a ~/Library/Containers/com.docker.docker/Data/vms/0 doesn't show a tty file/folder.

In case it's helpful: the Docker version I'm running is 20.10.17, build100c701. The OS version is macOS Monterey 12.6.

Note: the issue persists on ES v9.5.0. On v9.4.1, I'm not experiencing the issue.

@powerful_clouds Exactly what error did you have when you have security enabled xpack.security.enabled: true?

Did you see the same error message as in the original post, i.e.

ERROR: [1] bootstrap checks failed. You must address the points described in the following [1] lines before starting Elasticsearch.
es01_1 exited with code 78

?
If so, could you share more logs about exactly which bootstrap check failed? (It should be below the above log line as said in the logging message)

Also, you said

Note: the issue persists on ES v9.5.0. On v9.4.1, I'm not experiencing the issue.

I assume you meant v8.5.0 and v8.4.1? And you were using docker-compose file from this documentation page?

@Yang_Wang First of all, you're right about me getting the versions mixed up - I definitely meant v8.5.0 and v8.4.1. :slight_smile:

Yes, I did see the exact same error message as in the original post. I can't seem to reproduce the issue now, though, so maybe I did something else wrong initially.

seeing the same issue just now...what is the resolution?

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