# ERROR Unable to delete file

**URL:** <https://discuss.elastic.co/t/error-unable-to-delete-file/237948>\
**Category:** Elasticsearch\
**Created:** [June 21, 2020, 6:41am UTC](https://discuss.elastic.co/t/error-unable-to-delete-file/237948 "2020-06-21T06:41:54Z")\
**Posts on this page:** 7\
**Page:** 1

<div class="post-metadata">

**Author:** ![rezekiel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rezekiel/32/70759_2.png) [@rezekiel](https://discuss.elastic.co/u/rezekiel)\
**Post date:** [June 21, 2020, 6:41am UTC](https://discuss.elastic.co/t/error-unable-to-delete-file/237948/1 "2020-06-21T06:41:54Z")

</div>

Hi ,  
I use elasticsearch for windows  
amd getting

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [June 21, 2020, 9:42am UTC](https://discuss.elastic.co/t/error-unable-to-delete-file/237948/2 "2020-06-21T09:42:13Z")

</div>

What is the issue?

---

<div class="post-metadata">

**Author:** ![rezekiel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rezekiel/32/70759_2.png) [@rezekiel](https://discuss.elastic.co/u/rezekiel)\
**Post date:** [June 22, 2020, 10:03am UTC](https://discuss.elastic.co/t/error-unable-to-delete-file/237948/3 "2020-06-22T10:03:32Z")

</div>

Using elasticsearch for Windows i keep on getting errors as in :  
Unable to delete file and unable to move file

How do I fix it?

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [June 22, 2020, 1:42pm UTC](https://discuss.elastic.co/t/error-unable-to-delete-file/237948/4 "2020-06-22T13:42:21Z")

</div>

What are elaticsearch full logs?

---

<div class="post-metadata">

**Author:** ![rezekiel](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/rezekiel/32/70759_2.png) [@rezekiel](https://discuss.elastic.co/u/rezekiel)\
**Post date:** [June 22, 2020, 1:54pm UTC](https://discuss.elastic.co/t/error-unable-to-delete-file/237948/5 "2020-06-22T13:54:01Z")

</div>

Here you go:

[RONEZEKIEL4FAE][scheduler][T#1] ERROR Unable to move file C:\ProgramData\Elastic\Elasticsearch\logs\elasticsearch\_server.json to C:\ProgramData\Elastic\Elasticsearch\logs\elasticsearch-2020-06-21-1.json: java.nio.file.AccessDeniedException C:\ProgramData\Elastic\Elasticsearch\logs\elasticsearch\_server.json -\> C:\ProgramData\Elastic\Elasticsearch\logs\elasticsearch-2020-06-21-1.json  
[RONEZEKIEL4FAE][scheduler][T#1] ERROR Unable to delete file C:\ProgramData\Elastic\Elasticsearch\logs\elasticsearch\_server.json: java.nio.file.AccessDeniedException C:\ProgramData\Elastic\Elasticsearch\logs\elasticsearch\_server.json  
[RONEZEKIEL4FAE][scheduler][T#1] ERROR Unable to move file C:\ProgramData\Elastic\Elasticsearch\logs\elasticsearch.log to C:\ProgramData\Elastic\Elasticsearch\logs\elasticsearch-2020-06-21-1.log: java.nio.file.AccessDeniedException C:\ProgramData\Elastic\Elasticsearch\logs\elasticsearch.log -\> C:\ProgramData\Elastic\Elasticsearch\logs\elasticsearch-2020-06-21-1.log  
[RONEZEKIEL4FAE][scheduler][T#1] ERROR Unable to delete file C:\ProgramData\Elastic\Elasticsearch\logs\elasticsearch.log: java.nio.file.AccessDeniedException C:\ProgramData\Elastic\Elasticsearch\logs\elasticsearch.log

![photo](https://us1.discourse-cdn.com/elastic/original/3X/1/6/16fc7d1e5c83a5197dda7678cdc3b02ffb99b0ca.png)

Ron E. Ezekiel

A Rosh Ha'ayin, Israel

M +972 549777122

E [rezekiel@gmail.com](mailto:rezekiel@gmail.com)

[![](https://us1.discourse-cdn.com/elastic/original/3X/7/0/704dc86b45f707ada563fb7ec31cfa977c5f5ef9.png)](https://www.linkedin.com/in/ronezekiel/)

[Create your own WiseStamp email signature](https://www.wisestamp.com/signature-in-email/?utm_source=promotion&utm_medium=signature&utm_campaign=create_your_own&srcid=4901449043279872)

---

<div class="post-metadata">

**Author:** ![dadoonet](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/dadoonet/32/137187_2.png) [@dadoonet](https://discuss.elastic.co/u/dadoonet)\
**Post date:** [June 22, 2020, 3:13pm UTC](https://discuss.elastic.co/t/error-unable-to-delete-file/237948/6 "2020-06-22T15:13:28Z")

</div>

Please format your code, logs or configuration files using `</>` icon as explained in [this guide](https://discuss.elastic.co/t/about-the-elasticsearch-category/21) and not the citation button. It will make your post more readable.

Or use markdown style like:

````
```
CODE
```

````

This is the icon to use if you are not using markdown format:

 ![image](https://us1.discourse-cdn.com/elastic/original/3X/7/e/7e6e239431ec2d71cbf1beef741f2e93e7cc762c.jpg)

There's a live preview panel for exactly this reasons.

Lots of people read these forums, and many of them will simply skip over a post that is difficult to read, because it's just too large an investment of their time to try and follow a wall of badly formatted text.  
If your goal is to get an answer to your questions, it's in your interest to make it as easy to read and understand as possible.

A guess is that elasticsearch process does not have the rights to remove the logs? (Log rotation).  
How did you install Elasticsearch?

---

<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:** [July 20, 2020, 3:13pm UTC](https://discuss.elastic.co/t/error-unable-to-delete-file/237948/7 "2020-07-20T15:13:31Z")

</div>

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