# JNA temporary directory '/tmp' is not writable

**URL:** <https://discuss.elastic.co/t/jna-temporary-directory-tmp-is-not-writable/143413>\
**Category:** Elasticsearch\
**Created:** [August 7, 2018, 11:51pm UTC](https://discuss.elastic.co/t/jna-temporary-directory-tmp-is-not-writable/143413 "2018-08-07T23:51:46Z")\
**Posts on this page:** 6\
**Page:** 1

<div class="post-metadata">

**Author:** ![robegome](https://avatars.discourse-cdn.com/v4/letter/r/c6cbf5/32.png) [@robegome](https://discuss.elastic.co/u/robegome)\
**Post date:** [August 7, 2018, 11:51pm UTC](https://discuss.elastic.co/t/jna-temporary-directory-tmp-is-not-writable/143413/1 "2018-08-07T23:51:46Z")

</div>

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](http://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?

---

<div class="post-metadata">

**Author:** ![rjernst](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rjernst/32/6363_2.png) [@rjernst](https://discuss.elastic.co/u/rjernst)\
**Post date:** [August 8, 2018, 4:24pm UTC](https://discuss.elastic.co/t/jna-temporary-directory-tmp-is-not-writable/143413/2 "2018-08-08T16:24:03Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![robegome](https://avatars.discourse-cdn.com/v4/letter/r/c6cbf5/32.png) [@robegome](https://discuss.elastic.co/u/robegome)\
**Post date:** [August 8, 2018, 6:22pm UTC](https://discuss.elastic.co/t/jna-temporary-directory-tmp-is-not-writable/143413/3 "2018-08-08T18:22:03Z")

</div>

Hi Ryan, I have updated the YML file again:

_ **version: 2** _  
_ **services:** _  
_\*\* elasticsearch:\*\*_  
_\*\* image: '[docker.elastic.co/elasticsearch/elasticsearch:6.3.2](http://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](http://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** _

---

<div class="post-metadata">

**Author:** ![rjernst](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rjernst/32/6363_2.png) [@rjernst](https://discuss.elastic.co/u/rjernst)\
**Post date:** [August 8, 2018, 6:57pm UTC](https://discuss.elastic.co/t/jna-temporary-directory-tmp-is-not-writable/143413/4 "2018-08-08T18:57:32Z")

</div>

Does the directory actually exist?

---

<div class="post-metadata">

**Author:** ![robegome](https://avatars.discourse-cdn.com/v4/letter/r/c6cbf5/32.png) [@robegome](https://discuss.elastic.co/u/robegome)\
**Post date:** [August 9, 2018, 8:21pm UTC](https://discuss.elastic.co/t/jna-temporary-directory-tmp-is-not-writable/143413/5 "2018-08-09T20:21:18Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![system](https://us1.discourse-cdn.com/elastic/original/3X/1/a/1ac57faf039f6b580b3f104ef42a2a89e41014de.png) [@system](https://discuss.elastic.co/u/system)\
**Post date:** [September 6, 2018, 8:21pm UTC](https://discuss.elastic.co/t/jna-temporary-directory-tmp-is-not-writable/143413/6 "2018-09-06T20:21:30Z")

</div>

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