JNA temporary directory '/tmp' is not writable

I am train to use this YML in a Oracle Container Cloud Service:

version: 2
services:
_ elasticsearch:_
_ image: 'docker.elastic.co/elasticsearch/elasticsearch:6.3.2'_
_ ports:_
_ - '9200:9200/tcp'_
_ - '9300:9300/tcp'_
_ hostname: elasticsearch_
_ container_name: elasticsearch_
_ environment:_
_ - discovery.type=single-node_
_ - ES_TMPDIR=/tmp_
_ - ES_JAVA_OPTS=-Xms512m -Xmx512m_
_ - ES_JVM_OPTS="$JVM_OPTS -Djna.tmpdir=/var/tmp"_
_ volumes:_
_ - 'elasticsearch:/usr/share/elasticsearch/data'_

Unfortunately, I am receiving this error:

018-08-07T23:50:13.172253813Z OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
2018-08-07T23:50:14.318492274Z JNA Warning: IOException removing temporary files: JNA temporary directory '/tmp' is not writable
2018-08-07T23:50:14.334735465Z [2018-08-07T23:50:14,328][WARN ][o.e.b.Natives ] unable to load JNA native support library, native methods will be disabled.
2018-08-07T23:50:14.334759190Z java.lang.UnsatisfiedLinkError: Failed to create temporary file for /com/sun/jna/linux-x86-64/libjnidispatch.so library: JNA temporary directory '/tmp' is not writable
2018-08-07T23:50:14.334763625Z at com.sun.jna.Native.loadNativeDispatchLibraryFromClasspath(Native.java:962) ~[jna-4.5.1.jar:4.5.1 (b0)]
...
...
...
etc...

Could someone help me to check what values is incorrect in my YML file?

It looks like you have /tmp not writable on your system. I see you try to set the jna tmpdir, but in ES_JVM_OPTS, which is not an env var elasticsearch looks for.

Hi Ryan, I have updated the YML file again:

version: 2
services:
** elasticsearch:**
** image: 'docker.elastic.co/elasticsearch/elasticsearch:6.3.2'**
** ports:**
** - '9200:9200/tcp'**
** - '9300:9300/tcp'**
** hostname: elasticsearch**
** container_name: elasticsearch**
** environment:**
** - discovery.type=single-node**
** - ES_JAVA_OPTS=-Djna.tmpdir=/var/lib.elasticsearch/tmp**
** - ES_TMPDIR=/tmp**
** volumes:**
** - 'elasticsearch:/usr/share/elasticsearch/data'**

and the issue is still happening... I checked using ** image: 'docker.elastic.co/elasticsearch/elasticsearch:6.3.1'** and it workd without errors (weird, isnt?

this is the new output (any idea...?):

Error: container exited uncleanly with exit code 1
2018-08-08T18:19:58.795182383Z OpenJDK 64-Bit Server VM warning: Option UseConcMarkSweepGC was deprecated in version 9.0 and will likely be removed in a future release.
2018-08-08T18:20:00.131814223Z JNA Warning: IOException removing temporary files: JNA temporary directory '/var/lib.elasticsearch/tmp' does not exist
2018-08-08T18:20:00.141226642Z [2018-08-08T18:20:00,135][WARN ][o.e.b.Natives ] unable to load JNA native support library, native methods will be disabled.
2018-08-08T18:20:00.141244199Z java.lang.UnsatisfiedLinkError: Failed to create temporary file for /com/sun/jna/linux-x86-64/libjnidispatch.so library: JNA temporary directory '/var/lib.elasticsearch/tmp' does not exist
2018-08-08T18:20:00.141248892Z at com.sun.jna.Native.loadNativeDispatchLibraryFromClasspath(Native.java:962) ~[jna-4.5.1.jar:4.5.1 (b0)]
2018-08-08T18:20:00.141253001Z at com.sun.jna.Native.loadNativeDispatchLibrary(Native.java:922) ~[jna-4.5.1.jar:4.5.1 (b0)]
2018-08-08T18:20:00.141256438Z at com.sun.jna.Native.(Native.java:190) ~[jna-4.5.1.jar:4.5.1 (b0)]
2018-08-08T18:20:00.141260012Z at java.lang.Class.forName0(Native Method) ~[?:?]
2018-08-08T18:20:00.141262958Z at java.lang.Class.forName(Class.java:291) ~[?:?]
2018-08-08T18:20:00.141266021Z at org.elasticsearch.bootstrap.Natives.(Natives.java:45) [elasticsearch-6.3.2.jar:6.3.2]
2018-08-08T18:20:00.141269474Z at org.elasticsearch.bootstrap.Bootstrap.initializeNatives(Bootstrap.java:103) [elasticsearch-6.3.2.jar:6.3.2]
2018-08-08T18:20:00.141272525Z at org.elasticsearch.bootstrap.Bootstrap.setup(Bootstrap.java:171) [elasticsearch-6.3.2.jar:6.3.2]
2018-08-08T18:20:00.141275633Z at org.elasticsearch.bootstrap.Bootstrap.init(Bootstrap.java:326) [elasticsearch-6.3.2.jar:6.3.2]
2018-08-08T18:20:00.141278555Z at org.elasticsearch.bootstrap.Elasticsearch.init(Elasticsearch.java:136) [elasticsearch-6.3.2.jar:6.3.2]
2018-08-08T18:20:00.141281687Z at org.elasticsearch.bootstrap.Elasticsearch.execute(Elasticsearch.java:127) [elasticsearch-6.3.2.jar:6.3.2]
...
...
...
etc

Does the directory actually exist?

I dont think so because I am running a docker container... I assume when the container starts the directories are created, but not before...

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