Description
I've set up my media directory on my NAS like described in this article, where each subdirectory under Media is a library section.
/Media
/Movies
movie content
/Music
music content
/TV Shows
television content
e.g. I have a library section called Movies that has no folders within, just a bunch of movie files.
I've found that with this setup, scans seem to think that the files I add/modify/remove are paths, and Plex treats them as paths and fails to pick it up.
In this example, I add a file Hercules (1997).m4v to my Movies folder on my NAS (I'll attach my .env and docker-compose later down this post)
docker logs
...
INFO: Adding to queue for section Movies (created): Hercules (1997).m4v
INFO: Requesting Plex to scan the remote path /Movies/Hercules (1997).m4v
...
Plex console
...
Dec 04, 2025 22:58:33.066 [136485292485432] DEBUG - Performing a scan with 'Plex Movie' (language: en-US virtual: 0).
Dec 04, 2025 22:58:33.066 [136485292485432] DEBUG - * Scanning /Movies/Hercules (1997).m4v
Dec 04, 2025 22:58:33.153 [136485292485432] ERROR - Failed to create iterator to "/Movies/Hercules (1997).m4v": Not a directory
Dec 04, 2025 22:58:33.191 [136485292485432] DEBUG - Scanner: Processing directory /Movies/Hercules (1997).m4v (parent: yes)
Dec 04, 2025 22:58:33.191 [136485292485432] VERBOSE - * Noting that 'Hercules (1997).m4v' was updated at 2025-12-04 22:49:42
Dec 04, 2025 22:58:33.191 [136485292485432] VERBOSE - * Taking directory 'Hercules (1997).m4v' (121) out of the map (0 left)
I think the issue is introduced here:
https://github.com/LightDestory/PlexNFSWatchdog/blob/master/src/plex_nfs_watchdog/modules/plex/plex_agent.py#L234
for location in self._internal_sections[section_id]["locations"]:
scan_path: Path = Path(location / item).absolute()
logging.info(f"Requesting Plex to scan the remote path {str(scan_path)}")
if shared.user_input.dry_run:
logging.info("Skipping Plex scan due to dry-run")
else:
plex_section.update(str(scan_path))
Here, location would be set to /Movies and item would be set to Hercules (1997).m4v. However, item is supposed to be a folder, not a file. The proper thing to do would be to ask Plex to scan the /Movies path.
I can fix this by creating a folder within Movies and adding stuff there, which works like a charm because the scan is for /Movies/<subfolder>, but I think permitting scans of the entire library section (in my case where i don't have sub folders) should be a supported usecase, even if the intent seems to be to only allow partial scans on subfolders.
Reproduction
docker-compose
services:
plexnfswatchdog:
build: .
image: plexnfswatchdog
container_name: plexnfswatchdog
restart: unless-stopped
env_file: ./.env
environment:
- PLEX_SERVER=${PLEX_SERVER}
- PLEX_TOKEN=${PLEX_TOKEN}
- WATCH_PATHS=${WATCH_PATHS}
- SCAN_INTERVAL=${SCAN_INTERVAL}
- LISTENERS=${LISTENERS}
- ALLOW_FOLDER=${ALLOW_FOLDER}
- ALWAYS_OVERWRITE_CONFIG=${ALWAYS_OVERWRITE_CONFIG}
volumes:
- /volume1/Media/Movies:/volume1/Media/Movies:ro
.env
# Plex Configuration
PLEX_SERVER=http://192.168.86.168:32400
PLEX_TOKEN=<my token>
# Watchdog Configuration
WATCH_PATHS=/volume1/Media/Movies
SCAN_INTERVAL=30
LISTENERS=move modify create delete
To replicate:
- Plex server: NFS Mount
/volume1/Media/Movies on your storage server to /mnt/nas/Movies
- Plex server: Create a library section in Plex called
Movies that points to the mounted folder /Movies
- Start nfs watchdog with provided docker-compose on the storage server
- Add a file to
volume1/Media/Movies/ on the storage server
- Plex will acknowlege the scan request, but will fail to add the file to the library
Environment
Storage server running nfs watchdog:
Linux nas 4.4.302+ #72806 SMP Mon Jul 21 23:12:58 CST 2025 x86_64 GNU/Linux synology_r1000_923+
Plex server
Linux myServer 6.8.0-49-generic #49~22.04.1-Ubuntu SMP PREEMPT_DYNAMIC Wed Nov 6 17:42:15 UTC 2 x86_64 x86_64 x86_64 GNU/Linux
Description
I've set up my media directory on my NAS like described in this article, where each subdirectory under
Mediais a library section.e.g. I have a library section called
Moviesthat has no folders within, just a bunch of movie files.I've found that with this setup, scans seem to think that the files I add/modify/remove are paths, and Plex treats them as paths and fails to pick it up.
In this example, I add a file
Hercules (1997).m4vto myMoviesfolder on my NAS (I'll attach my .env and docker-compose later down this post)I think the issue is introduced here:
https://github.com/LightDestory/PlexNFSWatchdog/blob/master/src/plex_nfs_watchdog/modules/plex/plex_agent.py#L234
Here,
locationwould be set to/Moviesanditemwould be set toHercules (1997).m4v. However,itemis supposed to be a folder, not a file. The proper thing to do would be to ask Plex to scan the/Moviespath.I can fix this by creating a folder within
Moviesand adding stuff there, which works like a charm because the scan is for/Movies/<subfolder>, but I think permitting scans of the entire library section (in my case where i don't have sub folders) should be a supported usecase, even if the intent seems to be to only allow partial scans on subfolders.Reproduction
docker-compose
.env
To replicate:
/volume1/Media/Movieson your storage server to/mnt/nas/MoviesMoviesthat points to the mounted folder/Moviesvolume1/Media/Movies/on the storage serverEnvironment
Storage server running nfs watchdog:
Plex server