# What's the cause and the solution of this error

**URL:** <https://discuss.elastic.co/t/whats-the-cause-and-the-solution-of-this-error/315055>\
**Category:** Elasticsearch\
**Created:** [September 23, 2022, 8:43pm UTC](https://discuss.elastic.co/t/whats-the-cause-and-the-solution-of-this-error/315055 "2022-09-23T20:43:49Z")\
**Posts on this page:** 11\
**Page:** 1

<div class="post-metadata">

**Author:** ![morad\_della3](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/morad_della3/32/101241_2.png) [@morad\_della3](https://discuss.elastic.co/u/morad_della3)\
**Post date:** [September 23, 2022, 8:43pm UTC](https://discuss.elastic.co/t/whats-the-cause-and-the-solution-of-this-error/315055/1 "2022-09-23T20:43:49Z")

</div>

ubuntu 22.04 VM  
elasticsearch,kibana,filebeat8.4.1 ,elastalert,suricata  
i have this error in the log of elasticsearch when i try to start elasticsearch it failed to start

```auto
Failed to get the temporary directory; falling back to: /tmp
[2022-09-23T20:38:58,847][ERROR][o.e.b.Elasticsearch] [elastic] fatal exception while booting Elasticsearch
java.security.AccessControlException: access denied ("java.io.FilePermission" "/tmp" "read")

```

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [September 23, 2022, 9:37pm UTC](https://discuss.elastic.co/t/whats-the-cause-and-the-solution-of-this-error/315055/2 "2022-09-23T21:37:52Z")

</div>

According to the error the user you are running elasticsearch as can not read (and probably write) to the `/tmp` directly.

Elasticsearch like mini programs need to be able to read and write from the `/tmp` directory.

You need to fix the permissions on that directory

---

<div class="post-metadata">

**Author:** ![morad\_della3](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/morad_della3/32/101241_2.png) [@morad\_della3](https://discuss.elastic.co/u/morad_della3)\
**Post date:** [September 23, 2022, 9:39pm UTC](https://discuss.elastic.co/t/whats-the-cause-and-the-solution-of-this-error/315055/3 "2022-09-23T21:39:00Z")

</div>

> You need to fix the permissions on that directory  
> How can I?

---

<div class="post-metadata">

**Author:** ![stephenb](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/stephenb/32/40856_2.png) [@stephenb](https://discuss.elastic.co/u/stephenb)\
**Post date:** [September 23, 2022, 9:43pm UTC](https://discuss.elastic.co/t/whats-the-cause-and-the-solution-of-this-error/315055/4 "2022-09-23T21:43:56Z")

</div>

Google is your friend 🙂

`$ sudo chmod 1777 /tmp`

---

<div class="post-metadata">

**Author:** ![morad\_della3](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/morad_della3/32/101241_2.png) [@morad\_della3](https://discuss.elastic.co/u/morad_della3)\
**Post date:** [September 23, 2022, 9:53pm UTC](https://discuss.elastic.co/t/whats-the-cause-and-the-solution-of-this-error/315055/5 "2022-09-23T21:53:31Z")

</div>

Oh yea i google it now and i find it thanks @stephenb for help 😃

---

<div class="post-metadata">

**Author:** ![morad\_della3](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/morad_della3/32/101241_2.png) [@morad\_della3](https://discuss.elastic.co/u/morad_della3)\
**Post date:** [October 13, 2022, 10:14am UTC](https://discuss.elastic.co/t/whats-the-cause-and-the-solution-of-this-error/315055/6 "2022-10-13T10:14:34Z")

</div>

@stephenb hello stephen the error The error was repeated today and when i try to do this cmd

> [@stephenb](#):
>
> sudo chmod 1777 /tmp

it still the same not solved

---

<div class="post-metadata">

**Author:** ![Akhtar\_Zaman](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/akhtar_zaman/32/112014_2.png) [@Akhtar\_Zaman](https://discuss.elastic.co/u/Akhtar_Zaman)\
**Post date:** [October 13, 2022, 10:38am UTC](https://discuss.elastic.co/t/whats-the-cause-and-the-solution-of-this-error/315055/7 "2022-10-13T10:38:43Z")

</div>

May be you need to check what user is being used for Elasticsearch. Try find the user from the Elasticsearch service unit file. and then run the command provided by stephenb from that user. you can simply do  
sudo -u {USER} chmod 1777 /tmp

---

<div class="post-metadata">

**Author:** ![morad\_della3](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/morad_della3/32/101241_2.png) [@morad\_della3](https://discuss.elastic.co/u/morad_della3)\
**Post date:** [October 13, 2022, 12:09pm UTC](https://discuss.elastic.co/t/whats-the-cause-and-the-solution-of-this-error/315055/8 "2022-10-13T12:09:56Z")

</div>

@Akhtar_Zaman thanks for the response  
how to check the user used by elastic what cmd?  
I think you mean the user that i used to access elastic from kibana is "elastic"  
i try to do what you told but this is the result

```auto
elastic@elastic:~$ sudo -u elastic chmod 1777 /tmp
chmod: changing permissions of '/tmp': Operation not permitted

```

---

<div class="post-metadata">

**Author:** ![wangphun](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/wangphun/32/103430_2.png) [@wangphun](https://discuss.elastic.co/u/wangphun)\
**Post date:** [October 17, 2022, 9:20am UTC](https://discuss.elastic.co/t/whats-the-cause-and-the-solution-of-this-error/315055/9 "2022-10-17T09:20:36Z")

</div>

Hi @morad_della3, did you fixed your problem? i face the same issue.

---

<div class="post-metadata">

**Author:** ![morad\_della3](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/morad_della3/32/101241_2.png) [@morad\_della3](https://discuss.elastic.co/u/morad_della3)\
**Post date:** [October 17, 2022, 9:51am UTC](https://discuss.elastic.co/t/whats-the-cause-and-the-solution-of-this-error/315055/10 "2022-10-17T09:51:03Z")

</div>

No but i used a solution last month it worked with me but now when I used it it did not work see if it work for you  
the solution is to decrease the the amount of the ram here , you will find 4g change it to 1g or 512m  
to enter to this file of configyou can use : sudo nano /etc/elasticsearch/jvm.options  
then save the config and restart elasticsearch

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/4/a/4ab987fc771af22c0ed5819aa56b1abfbabe56d1.png)

---

<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:** [November 14, 2022, 9:51am UTC](https://discuss.elastic.co/t/whats-the-cause-and-the-solution-of-this-error/315055/11 "2022-11-14T09:51:37Z")

</div>

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