# Fatal error: Cannot delete files/folders outside the current working directory

**URL:** <https://discuss.elastic.co/t/fatal-error-cannot-delete-files-folders-outside-the-current-working-directory/190299>\
**Category:** Kibana\
**Created:** [July 12, 2019, 7:49pm UTC](https://discuss.elastic.co/t/fatal-error-cannot-delete-files-folders-outside-the-current-working-directory/190299 "2019-07-12T19:49:57Z")\
**Posts on this page:** 4\
**Page:** 1

<div class="post-metadata">

**Author:** ![mxplusb](https://avatars.discourse-cdn.com/v4/letter/m/59ef9b/32.png) [@mxplusb](https://discuss.elastic.co/u/mxplusb)\
**Post date:** [July 12, 2019, 7:49pm UTC](https://discuss.elastic.co/t/fatal-error-cannot-delete-files-folders-outside-the-current-working-directory/190299/1 "2019-07-12T19:49:57Z")

</div>

I was reading through [this post](https://discuss.elastic.co/t/error-cannot-delete-files-folders-outside-the-current-working-directory/148702), and I have the exact same issue on Kibana 6.4.3:

```auto
FATAL Error: Cannot delete files/folders outside the current working directory. Can be overriden with the `force` option.
    at safeCheck (/var/vcap/data/packages/kibana/18cc759ef9f7faf785ce8b87573928862ad26958/node_modules/del/index.js:18:9)
    at mapper (/var/vcap/data/packages/kibana/18cc759ef9f7faf785ce8b87573928862ad26958/node_modules/del/index.js:33:4)
    at Promise.resolve.then.el (/var/vcap/data/packages/kibana/18cc759ef9f7faf785ce8b87573928862ad26958/node_modules/p-map/index.js:46:16)
    at <anonymous>

```

However, in my circumstance, I cannot add the `--force` flag because Kibana cannot write outside of it's own directory. What is the cause of this error and what steps can I take to resolve it?

---

<div class="post-metadata">

**Author:** ![mxplusb](https://avatars.discourse-cdn.com/v4/letter/m/59ef9b/32.png) [@mxplusb](https://discuss.elastic.co/u/mxplusb)\
**Post date:** [July 12, 2019, 8:09pm UTC](https://discuss.elastic.co/t/fatal-error-cannot-delete-files-folders-outside-the-current-working-directory/190299/2 "2019-07-12T20:09:03Z")

</div>

I continued to debug the issue (just enabling debug everywhere, and I found this:

```auto
{"type":"log","@timestamp":"2019-07-12T20:00:16Z","tags":["plugin","debug"],"pid":27183,"path":"/var/vcap/data/packages/kibana/18cc759ef9f7faf785ce8b87573928862ad26958/src/core_plugins/vega","message":"Found plugin at /var/vcap/data/packages/kibana/18cc759ef9f7faf785ce8b87573928862ad26958/src/core_plugins/vega"}
{"type":"error","@timestamp":"2019-07-12T20:00:17Z","tags":["fatal"],"pid":27183,"level":"fatal","error":{"message":"Cannot delete files/folders outside the current working directory. Can be overriden with the `force` option.","name":"Error","stack":"Error: Cannot delete files/folders outside the current working directory. Can be overriden with the `force` option.\n at safeCheck (/var/vcap/data/packages/kibana/18cc759ef9f7faf785ce8b87573928862ad26958/node_modules/del/index.js:18:9)\n at mapper (/var/vcap/data/packages/kibana/18cc759ef9f7faf785ce8b87573928862ad26958/node_modules/del/index.js:33:4)\n at Promise.resolve.then.el (/var/vcap/data/packages/kibana/18cc759ef9f7faf785ce8b87573928862ad26958/node_modules/p-map/index.js:46:16)\n at <anonymous>"},"message":"Cannot delete files/folders outside the current working directory. Can be overriden with the `force` option."}

```

So I think the Vega plugin is causing the issue.

---

<div class="post-metadata">

**Author:** ![Marius\_Dragomir](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/marius_dragomir/32/42087_2.png) [@Marius\_Dragomir](https://discuss.elastic.co/u/Marius_Dragomir)\
**Post date:** [July 18, 2019, 11:29am UTC](https://discuss.elastic.co/t/fatal-error-cannot-delete-files-folders-outside-the-current-working-directory/190299/3 "2019-07-18T11:29:28Z")

</div>

You could maybe try symlinking the folders to fool the OS to think they are in the same working directory. It's a pretty weird issue, and without more information it's going to be hard to reproduce and troubleshoot.

---

<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:** [August 15, 2019, 11:29am UTC](https://discuss.elastic.co/t/fatal-error-cannot-delete-files-folders-outside-the-current-working-directory/190299/4 "2019-08-15T11:29:41Z")

</div>

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