Scanner sees “@” directories on QNAP

Server Version#: 1.18.3.2156-349e9837e
Player Version#: 4.8.4 chrome console

I have this exact same problem as this closed thread. I recently enabled snapshots and all my media is getting duplicated in my plex apps.

https://forums.plex.tv/t/scanner-sees-directories-on-qnap/314850/3

Has anyone figured out how to fix this? There is no solution in this old thread.

Regards.

If using the MultiMedia share, then look here:

See: Incorrect file path?

If not, we really would like some more info about file path

I don’t use the integrated Multimedia functions on the QNAP TS-877 NAS as those don’t fix any of my needs…so all the default QNAP folders on my NAS are empty. I simply created a shared folder called “Movies”, and within that folder I have various folders containing my blah.mp4 files. Interestingly enough, when I delete a file in the Movies share, it goes to the @Recycle bin where it is stored and Plex doesn’t see it there. Conversely, when a snapshot kicks off and places files into the @Recently-Snapshot folder, it picks them all up as duplicates. I believe that Plex must be hard-coded to ignore “@Recycle” expression, and seems like we also need to add “@Recently-Snapshot”. Or better yet, allow us to configure the ignores with regex wildcards in settings.

File structure:

[/share/Movies] # ls -l
total 56
drwxrwx— 2 user everyone 4096 2019-07-15 05:49 Bluray/
drwxrwx— 3 user everyone 20480 2019-12-24 16:05 Files/
drwxrwxrwx 2 admin administrators 4096 2020-01-02 16:58 @Recently-Snapshot/
drwxrwxrwx 2 admin administrators 4096 2020-01-02 00:14 @Recycle/
[/share/Movies] #

Share details:

Yep, this might be a bug, since the scanner is defined to exclude @Recently-Snapshot but sadly not as the root/directory :frowning:

Not tested though, and as a workaround, look into:

I am using 1.18.3.2175

I cannot recreate this:

My library section begins at /share/movies (/share/CACHEDEV2_DATA/movies), which is where @Recycle and @Recently-Snapshot exist along with the other movies.

Which directory is PMS given as the top of the library section?

Chuck, does your snapshot folder have files inside it? The folder exists on the NAS even if you don’t use snapshots. If you do use snapshots then you will see all the same files duplicated inside that snapshots folder which is causing the dupes.

We have the exact same setup then. Mine is also “/share/CACHEDEV1_DATA/Movies/”. In plex setup I have Movies as it’s own library, see screenshot below. Additionally, for my music I have another share and additional library “/share/CACHEDEV1_DATA/Music/”. They are all separate.

I went the other way. I enabled the Network Recycle Bin and deleted one.

It shows up when it should not. I consider this now adequate recreation if you do?

Yes.

For the snapshots here is what i found: Hybrid backup sync (HBS3) does a snapshot while the backup is running. During the backup, the snapshot rolls and creates file structure in that snapshot folder on EVERY single share on the NAS. This means /share/Music, Photos, Movies, ALL populate instantly in the snapshot folder until the backup is finished. Once the backup is finished, the folder empties. So essentially when the backup takes off, Plex freaks out and sees DOUBLE the media I actually have across movies, pics, music, and cranks away at indexing it during the backup. But then, when the backup finishes, it freaks out again because half of what it saw earlier disappears and it has to re-index. Talk about risk of database corruption! Eeeeks! So in summary, every time a backup job runs (7 to 8 jobs a week) this cycle occurs.

Path in snapshot folder:

Plex freaking out and indexing. Thumbs temporary lost:

Would you be willing to do some quick editing and see if we can wrangle control until Engineering can address it? (I just completed writing it up for them)

Sure! Send me the details.

  1. SSH into the QNAP
  2. Your directory will be different but still be of the same form.
/share/CACHEDEV1_DATA/.qpkg/PlexMediaServer/Resources/Plug-ins-41af4e729/Scanners.bundle/Contents/Resources/Common

(the Plug-ins-xxxxxxx will be different for you)

  1. vi Filter.py
  2. Add , '@Recycle' , '@Recently-Snapshot' before the closing ] on Line 5

It should look like this:

ROOT_IGNORE_DIRS = ['\$Recycle.Bin', 'System Volume Information', 'Temporary Items', 'Network Trash Folder', '@Recycle', '@Recently-Snapshot']

Save and restart PMS
Now scan

If this is where it’s happening, the change above will stop it from going crazy while the backups are running.

Sorry, correction, it did not work. I had checked the tick mark in the backup job to not create the snapshot during backup. I removed that check and scan immediately picked up the changes again. Are there any other edits I can try?

I used this command to restart the server. Is it sufficient for testing?

$(getcfg -f /etc/config/qpkg.conf PlexMediaServer Install_path)/plex.sh restart

Edited screenshot:

may I see what you changed?
I tested here and it stopped it.

See edited post above.

Ok.

You found it stopped by changing the backup options?

Is it possible we need an escape character in Filter.py? When i tab to autocomplete the directory in terminal it requires "".

[/share/CACHEDEV1_DATA/.qpkg/PlexMediaServer/Resources/Plug-ins-349e9837e/Scanners.bundle/Contents/Resources/Common] # ls -l /share/Movies/@Recently-Snapshot/

When I unchecked this box in the shot below “Do not take a snapshot”, it found it in the scans again:

any @ directory is considered Hidden in QNAP so that’s likely the root cause of it being created.

It still doesn’t explain why PMS continued to scan it.
My trouble ticket will hopefully resolve that.

You are stating: By not scanning hidden files and folders. everything is ok?

I am saying that even after the edits we did, it’s still picking up the snapshot files. :frowning: I thought it was fixed at first, but when I edited the backup job, I noticed I had temporarily disabled the snapshot option during the backup job (my mistake). So with the box unchecked as shows in the shot below, it still has the original problem.

Additionally, here are my commands to ensure the service was stopped and edits are indeed in place. After stopping and starting again, I did a final test and the problem still exists.

(Stop Plex)
[/share] # $(getcfg -f /etc/config/qpkg.conf PlexMediaServer Install_path)/plex.sh stop
Stopping Plex Media Server…

(Make sure plex is dead, and it is. Made sure client would not connect)
[/share] # ps | grep plex
5348 admin 101336 S /share/CACHEDEV1_DATA/.qpkg/PlexPy/bin/python PlexPy.py --daemon --port=8659 --datadir=/share/CACHEDEV1_DATA/.qpkg/PlexPy/DATADIR --config=/share/CACHEDEV1_DATA/.qpkg/PlexPy/CONFIG/plexpy.conf
12831 admin 2276 S grep plex

(Start Plex after confirming dead)
[/share] # $(getcfg -f /etc/config/qpkg.conf PlexMediaServer Install_path)/plex.sh start
Starting Plex Media Server…

(Edits are still in place)
[/share] # cat Filter.py |grep Recently-Snapshot
IGNORE_DIRS = [‘@eaDir’, ‘.UNPACK.’, ‘.FAILED.’, ‘..', ‘lost+found’, ‘.AppleDouble’, '..itlp$’, ‘@Recycle’, ‘.*.photoslibrary’, ‘#recycle’, ‘@Recently-Snapshot’]
ROOT_IGNORE_DIRS = [‘$Recycle.Bin’, ‘System Volume Information’, ‘Temporary Items’, ‘Network Trash Folder’, ‘@Recycle’, ‘@Recently-Snapshot’]

(Plex still indexing dupes)
:frowning:

Thanks for that. I’ve linked this thread in the trouble ticket. I’m sure they’ll read what’s written here.

For sake of completeness, I have found a good temp solution until the filtering can be addressed in Filter.py. In the snapshot properties on the QNAP there is a section to not make the snapshot on each drive not-visible which is extremely helpful! However, the Filter.py still needs fixed to ignore these directories as we can see above it’s not working as intended.

2 Likes