On what platform is that Plex Media Server of yours?
Linux based system (e.g. most NAS devices) have an OS configuration on how many folders can be monitored. If I remember correctly, the default in somewhere around 80k folders.
If you have a large library you can end up beyond that threshold.
If that applies to your setup you can update the related settings for your OS.
Thanks for reply, I have installed the server on a Win10 PC, the media files are on two external 4 Tb NAS HDD
I have 4202 movies and some TV series
Problem still persit, I added couple of movies yesterday and I could not see them until I performed a full scan
I see, it is also stated: Note : In most cases, this should work for content on local filesystems. It will generally not work for network shares mounted via SMB, NFS, AFP, or similar.
Most of the cases! I have to figure out what has happened as before my vacation everything was working fine, probably a sofware update on my NAS. Thanks a lot!
SMB/CIFS supports directory change notifications, and Windows servers support directory change notifications really well.
Samba also supports directory change notifications, but … it’s not uncommon for smaller NAS appliances to have issues with it. And cross-platform … weirdness. Sometimes they won’t notify when there’s a change within a subdirectory, for instance. Or will notify if the change came from the same client, but not if it came from elsewhere. Etc.
Have you recently added a bunch of media? You mentioned 4000+ items.
Random brainfart:
if the SMB directory change check of SAMBA (which is the software that all those Linux-based NAS devices are using to offer Windows-compatible network shares) is relying on Linux inotify events, you may still have to check if you’ve exceeded the default folder count on your machine for inotify: Increase the number of directories Linux can monitor (Notify)
I looked to confirm. Samba checks for inotify.h on Linux, and uses it when “kernel change notify = yes”.
@giabett, does your NAS give you the option to modify sysctls or tunables, as per @tom80H’s first link? Or to add a startup script? Or get to a CLI prompt?
Thanks, for me the situation is quite clear, it is a NAS problem related to the file numbesr, so nothing to do with Plex. I will figure out how to solve the problem.
Well, I wrote a scipt, that can run on linux based share server (eg. a QNAP NAS) to catch new files added, and makes an HTTP call for PLEX to force scan on that folder.
#!/bin/sh
PlexIP="XXX.XXX.XXX.XXX" #your PLEX server's local IP address
PlexToken="XXXXX" #your PLEX auth token - HOWTO: https://support.plex.tv/articles/204059436-finding-an-authentication-token-x-plex-token/
PlexFolderKey="X" #watched folder ID (key arg.) - HOWTO: "Listing Defined Libraries" section at https://support.plex.tv/articles/201638786-plex-media-server-url-commands/
prev_path=""
/usr/sbin/inotifywait -m "/PATH/TO/YOUR/WATCHED/FOLDER" -r -e close_write -e move --format '%w' | while read -r line
do
path="${line%/*}"
if [[ $prev_path == $path ]]; then
sleep 1
else
url="http://"$PlexIP":32400/library/sections/"$PlexFolderKey"/refresh?path="$path"&X-Plex-Token="$PlexToken
prev_path=$path
curl $url
fi
sleep 1
done
Save this code to an “anything.sh” file, and run it.
It helps for me