"Failed to add watch" (permissions and fs_inotify sysctl set)

Server Version#: 1.15.8.1198
Player Version#: 3.95.2

Since I got such great response about my CPU 100% issue, I thought I’d see if lightning struck twice. I’ve done a search of the previous threads, thus far no luck.

Getting the dreaded “Failed to add watch” issue.
I checked permissions, Plex has full read (and write) access into these directories.
There are only ~6000 directory inodes in this tree, but for giggles I bumped things up to 128k.

It only appears in a few of my movie directories, but almost all (if not all) of my television directories, which makes it seem like Plex is running out of watch list resources, despite bumping up the max user watches value and restarting Plex.

Any thoughts?

Jun 12, 2019 19:07:40.909 [0x7fa8c8899700] ERROR - [Notify] Failed to add watch for "/volume1/Videos/television/UFO" (13: Permission denied)

root@xx:/volume1/Videos/television/UFO# sysctl fs.inotify.max_user_watches
fs.inotify.max_user_watches = 131072
root@xx:/volume1/Videos/television/UFO# find /volume1/Videos -type d | wc -l
5946

root@xx:/volume1/Videos/television/UFO# pwd
/volume1/Videos/television/UFO
root@xx:/volume1/Videos/television/UFO# synoacltool -get-perm . plex
ACL version: 1
Archive: is_inherit,is_support_ACL
Owner: [sc-transmission(user)]
---------------------
	 [0] group:administrators:allow:rwxpdDaARWc--:fd--  (level:2)
	 [1] user::allow:r-x---a-R-c--:fd--  (level:2)
	 [2] group:http:allow:r-x---a-R-c--:fd--  (level:2)
	 [3] group:users:allow:r-x---a-R-c--:fd--  (level:2)
	 [4] group:mediamgr:allow:rwxpdDaARWc--:fd--  (level:2)
====================================================
User/Group: [plex/users,mediamgr,video]

Final permission: [rwxpdDaARWc--]

root@xx:/volume1/Videos/television/UFO# sudo su -s /bin/bash plex
plex@xx:/volume1/Videos/television/UFO$ ls -la
total 7075208
drwxrwxrwx+ 1 sc-transmission transmission      2352 Dec 11  2018 .
drwxrwxrwx+ 1 sc-transmission transmission      4878 May 28 09:21 ..
drwxrwxrwx+ 1 sc-transmission transmission      1160 Jul  3  2018 @eaDir
-rwxrwxrwx+ 1 guest           users             5726 Dec 11  2018 tvshow.nfo
-rwxrwxrwx+ 1 sc-transmission transmission 367499264 Jan 29  2008 UFO.S01E01.Identified.avi
-rwxrwxrwx+ 1 guest           users             3864 Dec 11  2018 UFO.S01E01.Identified.nfo


plex@xx:/volume1/Videos/television/UFO$ head -10c UFO.S01E01.Identified.avi
RIFF��AVplex@waystation2:/volume1/Videos/television/UFO$

plex@xx:/volume1/Videos/television/UFO$ ls -ld .
drwxrwxrwx+ 1 sc-transmission transmission 2352 Dec 11  2018 .

ACL’s are terrible.

What are the normal directory permissions looking like please?

Can you show me

ls -la /volume1/Videos/television/UFO

Also, Is Video Station installed?

No VideoStation is no longer installed but was a year ago.

pst@xx:~$ sudo su -s /bin/bash plex
plex@xx:/volume1/homes/pst$ cd /volume1/Videos/television/UFO
plex@xx:/volume1/Videos/television/UFO$ ls -la .
total 7075208
drwxrwxrwx+ 1 sc-transmission transmission      2352 Dec 11  2018 .
drwxrwxrwx+ 1 sc-transmission transmission      4878 May 28 09:21 ..
drwxrwxrwx+ 1 sc-transmission transmission      1160 Jul  3  2018 @eaDir
-rwxrwxrwx+ 1 guest           users             5726 Dec 11  2018 tvshow.nfo
-rwxrwxrwx+ 1 sc-transmission transmission 367499264 Jan 29  2008 UFO.S01E01.Identified.avi
-rwxrwxrwx+ 1 guest           users             3864 Dec 11  2018 UFO.S01E01.Identified.nfo
-rwxrwxrwx+ 1 sc-transmission transmission 369153796 Jan 29  2008 UFO.S01E02.Exposed (September 23, 1970).avi
-rwxrwxrwx+ 1 guest           users             4647 Dec 11  2018 UFO.S01E02.Exposed (September 23, 1970).nfo
-rwxrwxrwx+ 1 sc-transmission transmission 366913536 Jan 29  2008 UFO.S01E03.Kill Straker!.avi
-rwxrwxrwx+ 1 guest           users             5151 Dec 11  2018 UFO.S01E03.Kill Straker!.nfo
-rwxrwxrwx+ 1 sc-transmission transmission 366721024 Jan 29  2008 UFO.S01E04.The Cat With Ten Lives.avi
-rwxrwxrwx+ 1 guest           users             4624 Dec 11  2018 UFO.S01E04.The Cat With Ten Lives.nfo
-rwxrwxrwx+ 1 sc-transmission transmission 368935384 Jan 29  2008 UFO.S01E05.Conflict.avi
-rwxrwxrwx+ 1 guest           users             5170 Dec 11  2018 UFO.S01E05.Conflict.nfo
-rwxrwxrwx+ 1 sc-transmission transmission 170507586 Jan 29  2008 UFO.S01E06.ESP.avi
-rwxrwxrwx+ 1 guest           users             4578 Dec 11  2018 UFO.S01E06.ESP.nfo
-rwxrwxrwx+ 1 sc-transmission transmission 366921728 Jan 29  2008 UFO.S01E07.The Sound Of Silence.avi
-rwxrwxrwx+ 1 guest           users             4161 Dec 11  2018 UFO.S01E07.The Sound Of Silence.nfo
-rwxrwxrwx+ 1 sc-transmission transmission 367869720 Jan 29  2008 UFO.S01E08.A Question of Priorities.avi
-rwxrwxrwx+ 1 guest           users             4857 Dec 11  2018 UFO.S01E08.A Question of Priorities.nfo
-rwxrwxrwx+ 1 sc-transmission transmission 371395112 Jan 29  2008 UFO.S01E09.The Square Triangle.avi
-rwxrwxrwx+ 1 guest           users             5119 Dec 11  2018 UFO.S01E09.The Square Triangle.nfo
-rwxrwxrwx+ 1 sc-transmission transmission 366673920 Jan 29  2008 UFO.S01E10.Sub-Smash.avi
-rwxrwxrwx+ 1 guest           users             5320 Dec 11  2018 UFO.S01E10.Sub-Smash.nfo
-rwxrwxrwx+ 1 sc-transmission transmission 367198208 Jan 29  2008 UFO.S01E11.Destruction.avi
-rwxrwxrwx+ 1 guest           users             5006 Dec 11  2018 UFO.S01E11.Destruction.nfo
-rwxrwxrwx+ 1 sc-transmission transmission 367659008 Jan 29  2008 UFO.S01E12.Computer Affair.avi
-rwxrwxrwx+ 1 guest           users             6016 Dec 11  2018 UFO.S01E12.Computer Affair.nfo
-rwxrwxrwx+ 1 sc-transmission transmission 367851520 Jan 29  2008 UFO.S01E13.Close Up.avi
-rwxrwxrwx+ 1 guest           users             4636 Dec 11  2018 UFO.S01E13.Close Up.nfo
-rwxrwxrwx+ 1 sc-transmission transmission 395718656 Jan 29  2008 UFO.S01E14.The Psychobombs.avi
-rwxrwxrwx+ 1 guest           users             6619 Dec 11  2018 UFO.S01E14.The Psychobombs.nfo
-rwxrwxrwx+ 1 sc-transmission transmission 365006710 Jan 29  2008 UFO.S01E15.Survival.avi
-rwxrwxrwx+ 1 guest           users             4628 Dec 11  2018 UFO.S01E15.Survival.nfo
-rwxrwxrwx+ 1 sc-transmission transmission 395753472 Jan 29  2008 UFO.S01E16.Mindbender.avi
-rwxrwxrwx+ 1 guest           users             5429 Dec 11  2018 UFO.S01E16.Mindbender.nfo
-rwxrwxrwx+ 1 sc-transmission transmission 368063056 Jan 29  2008 UFO.S01E17.Flight path.avi
-rwxrwxrwx+ 1 guest           users             5143 Dec 11  2018 UFO.S01E17.Flight path.nfo
-rwxrwxrwx+ 1 sc-transmission transmission 370237208 Jan 29  2008 UFO.S01E18.Ordeal.avi
-rwxrwxrwx+ 1 guest           users             4599 Dec 11  2018 UFO.S01E18.Ordeal.nfo
-rwxrwxrwx+ 1 sc-transmission transmission 395804672 Jan 29  2008 UFO.S01E19.The Man Who Came Back .avi
-rwxrwxrwx+ 1 guest           users             5663 Dec 11  2018 UFO.S01E19.The Man Who Came Back .nfo
-rwxrwxrwx+ 1 sc-transmission transmission 368933032 Jan 29  2008 UFO.S01E20.The Dalotek Affair.avi
-rwxrwxrwx+ 1 guest           users             5407 Dec 11  2018 UFO.S01E20.The Dalotek Affair.nfo
plex@xx:/volume1/Videos/television/UFO$ 

You need to fix the acl’s.

These work.

sh-4.3# ls -la
total 12589408
drwxr-xr-x   2 chuck users        4096 Sep  2  2018 .
drwxrwxrwx 269 chuck users       20480 Apr 26 23:39 ..
-rw-r--r--   1 chuck users        3646 Aug 31  2016 Zero Days (2016).eng.forced.srt
-rw-r--r--   1 chuck users 12891512409 May 27  2018 Zero Days (2016).mkv
-rw-rw-rw-   1 root  root         5393 Jun  3  2018 Zero Days (2016).nfo
sh-4.3# synoacltool -get-perm . plex
ACL version: No ACL 
Archive: None 
Owner: [chuck(user)] 
==================================================== 
User/Group: [plex/users,administrators,video]

Final permission: [r-x-d-a-R-c--] 

sh-4.3#

Notice the d is missing from yours.

I find it far easier to not use ACLs.
With the implementation of PMS 1.15.4.994, plex is no longer in the administrators group.
As such, you can control access at the per-user level through the GUI. There is no more need to manually crunch and fuss with ACLs

Hi Chuck, thanks for the help!

I’m sorry, I think I’m missing something:

Your final permissions were:

User/Group: [plex/users,administrators,video]
Final permission: [r-x-d-a-R-c--] 

and mine are:

User/Group: [plex/users,mediamgr,video]
Final permission: [rwxpdDaARWc--]

and you said: “Notice the d is missing from yours.”

I think my permissions are more permissive than yours, and if I understand what you’re saying, I’ve got the d, same as you? When I su to user plex, I have full read and write access to the directory as well.

pst@xx:/volume1/Videos/television/UFO$ sudo su -s /bin/bash plex
plex@xx:/volume1/Videos/television/UFO$ touch xxtestxx
plex@xx:/volume1/Videos/television/UFO$ ls -l xxtestxx
-rwxrwxrwx+ 1 plex users 0 Jun 14 11:33 xxtestxx
plex@xx:/volume1/Videos/television/UFO$ ls -ld .
drwxrwxrwx+ 1 sc-transmission transmission 2368 Jun 14 11:33 .
plex@xx:/volume1/Videos/television/UFO$ id plex
uid=1030(plex) gid=100(users) groups=100(users),65537(mediamgr),65538(video)

One thing is that your directories are world-readable, where mine are not:

pst@xx:/volume1/Videos/television/UFO$ sudo su -s /bin/bash nobody
nobody@xx:/volume1/Videos/television/UFO$ rm xxtestxx
rm: cannot remove ‘xxtestxx’: Permission denied
nobody@xx:/volume1/Videos/television/UFO$ touch yytextyy
touch: cannot touch ‘yytextyy’: Permission denied
nobody@xx:/volume1/Videos/television/UFO$ ls -la .
ls: cannot access .: Permission denied

Sorry for being obtuse, but what am I missing?

UPDATE: I added a user:plex specific ACE to allow full access and that didn’t fix the problem, so it’s not an initgroup(2) issue in the executable.

Interestingly enough though, there are plenty of directories with the same ACLs that get watchlists applied with no warning, and Plex can stream from those directories just fine, so I suspect we might be bouncing up against a resource limit similar to the fs_inotify sysctl.

Hmmm. I’m thinking about both of us at this point.

ACLs are the red-herring. I fell right into it. I am sorry about that!

Synology overrules us on /etc/sysctl.conf now. They moved it to a different control mechanism. (GRRRRR). I think that default is ~2000 directories.

This is mine and is likely the root of your problem now that I think more about it.

/etc/synoinfo.conf:s2s_watches_max="65536"

Set the value and then restart DSM

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