Open martinraie opened 1 year ago
This remains a bug. I was able to recreate this error on a RHEL 9 system with SELinux enabled. When I ran it on Ubuntu 20.04 the umask did not appear to affect the elasticsearch container startup.
On RHEL 9, umask 027 failed, umask 000 worked just fine. On Ubuntu 20-04, umask 027 worked, umask 077 also worked.
Module
Elasticsearch
Testcontainers version
1.17.6
Using the latest Testcontainers version?
Yes
Host OS
Linux
Host Arch
x86_64
Docker version
What happened?
I have a similar problem as discussed in ticket #4952 but for Elasticsearch. Elasticsearch fails to start with the following error:
Exception in thread "main" java.nio.file.AccessDeniedException: /usr/share/elasticsearch/config/jvm.options.d/ elasticsearch-default-memory-vm.options
Testcontainers library copieselasticsearch-default-memory-vm.options
file into elasticsearch container with default file permissions which in my case is-rw-------
because umask in my computer is set to 077. As uid and gid in my computer are different than those in elasticsearch container, this file is not accessible by elasticsearch and the mentioned error is thrown.I guess the solution should be similar as in #5401 where temporary file is created with predefined permissions which allow reading the file for everyone instead of default permissions.
Relevant log output
No response
Additional Information
No response