# ResourceWatcherService Exception even on changing the permissions

**URL:** <https://discuss.elastic.co/t/resourcewatcherservice-exception-even-on-changing-the-permissions/135868>\
**Category:** Elasticsearch\
**Created:** [June 14, 2018, 8:06am UTC](https://discuss.elastic.co/t/resourcewatcherservice-exception-even-on-changing-the-permissions/135868 "2018-06-14T08:06:52Z")\
**Posts on this page:** 5\
**Page:** 1

<div class="post-metadata">

**Author:** ![emanzaman](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/emanzaman/32/31960_2.png) [@emanzaman](https://discuss.elastic.co/u/emanzaman)\
**Post date:** [June 14, 2018, 8:06am UTC](https://discuss.elastic.co/t/resourcewatcherservice-exception-even-on-changing-the-permissions/135868/1 "2018-06-14T08:06:52Z")

</div>

I have changed permission for the scripts directory to "drwxrwxr-x". But still getting the following exception:

failed to run scheduled task [org.elasticsearch.watcher.ResourceWatcherService$ResourceMonitor@3f813572] on thread pool [same]  
java.security.AccessControlException: access denied ("java.io.FilePermission" "" "read")  
at java.security.AccessControlContext.checkPermission(AccessControlContext.java:472) ~[?:1.8.0\_66]  
at java.security.AccessController.checkPermission(AccessController.java:884) ~[?:1.8.0\_66]  
at java.lang.SecurityManager.checkPermission(SecurityManager.java:549) ~[?:1.8.0\_66]  
at java.lang.SecurityManager.checkRead(SecurityManager.java:888) ~[?:1.8.0\_66]  
at sun.nio.fs.UnixPath.checkRead(UnixPath.java:795) ~[?:?]  
at sun.nio.fs.UnixFileSystemProvider.checkAccess(UnixFileSystemProvider.java:290) ~[?:?]  
at java.nio.file.Files.exists(Files.java:2385) ~[?:1.8.0\_66]  
at org.elasticsearch.watcher.FileWatcher$FileObserver.checkAndNotify(FileWatcher.java:93) ~[elasticsearch-5.6.8.jar:5.6.8]  
at org.elasticsearch.watcher.FileWatcher.doCheckAndNotify(FileWatcher.java:70) ~[elasticsearch-5.6.8.jar:5.6.8]  
at org.elasticsearch.watcher.AbstractResourceWatcher.checkAndNotify(AbstractResourceWatcher.java:44) ~[elasticsearch-5.6.8.jar:5.6.8]  
at org.elasticsearch.watcher.ResourceWatcherService$ResourceMonitor.run(ResourceWatcherService.java:197) ~[elasticsearch-5.6.8.jar:5.6.8]  
at org.elasticsearch.threadpool.ThreadPool$ReschedulingRunnable.doRun(ThreadPool.java:811) [elasticsearch-5.6.8.jar:5.6.8]  
at org.elasticsearch.common.util.concurrent.AbstractRunnable.run(AbstractRunnable.java:37) [elasticsearch-5.6.8.jar:5.6.8]  
at org.elasticsearch.threadpool.ThreadPool$LoggingRunnable.run(ThreadPool.java:436) [elasticsearch-5.6.8.jar:5.6.8]  
at java.util.concurrent.Executors$RunnableAdapter.call(Executors.java:511) [?:1.8.0\_66]  
at java.util.concurrent.FutureTask.run(FutureTask.java:266) [?:1.8.0\_66]  
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.access$201(ScheduledThreadPoolExecutor.java:180) [?:1.8.0\_66]  
at java.util.concurrent.ScheduledThreadPoolExecutor$ScheduledFutureTask.run(ScheduledThreadPoolExecutor.java:293) [?:1.8.0\_66]  
at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1142) [?:1.8.0\_66]  
at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:617) [?:1.8.0\_66]  
at java.lang.Thread.run(Thread.java:745) [?:1.8.0\_66]

---

<div class="post-metadata">

**Author:** ![TimV](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/timv/32/13162_2.png) [@TimV](https://discuss.elastic.co/u/TimV)\
**Post date:** [June 18, 2018, 2:03am UTC](https://discuss.elastic.co/t/resourcewatcherservice-exception-even-on-changing-the-permissions/135868/2 "2018-06-18T02:03:36Z")

</div>

If you are going to open duplicate issues in the forums and github (but really, please don't), then can you at least link them so we don't try and answer them twice.

> <https://github.com/elastic/elasticsearch/issues/31321>

---

<div class="post-metadata">

**Author:** ![TimV](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/timv/32/13162_2.png) [@TimV](https://discuss.elastic.co/u/TimV)\
**Post date:** [June 18, 2018, 2:09am UTC](https://discuss.elastic.co/t/resourcewatcherservice-exception-even-on-changing-the-permissions/135868/3 "2018-06-18T02:09:16Z")

</div>

What do the permissions look like on the hierachy of that scripts directory?

Try

```auto
#!/bin/bash

Dir="/apps/IRDuatrun/rsu/ldn/uat/elasticsearch/bin/scripts"

while [-n "$Dir" -a "$Dir" != "/" -a -d "$Dir"]
do
    ls -ld $Dir
    Dir=$(dirname $Dir)
done

```

---

<div class="post-metadata">

**Author:** ![emanzaman](https://sea2.discourse-cdn.com/elastic/user_avatar/discuss.elastic.co/emanzaman/32/31960_2.png) [@emanzaman](https://discuss.elastic.co/u/emanzaman)\
**Post date:** [June 18, 2018, 12:18pm UTC](https://discuss.elastic.co/t/resourcewatcherservice-exception-even-on-changing-the-permissions/135868/4 "2018-06-18T12:18:00Z")

</div>

Apologies for not linking the issue....but my intention was to get help from where ever I could.  
Yes the issue is resolved now as I updated the scripts location to be within the config directory.  
Just one question why path.scripts variable is provided if we have to keep scripts inside the CONFIG DIRECTORY?

---

<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 16, 2018, 12:18pm UTC](https://discuss.elastic.co/t/resourcewatcherservice-exception-even-on-changing-the-permissions/135868/5 "2018-07-16T12:18:01Z")

</div>

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