This started on 1.2.6, but updating to 1.2.7 didn’t help.
I noticed half my movie collection vanished overnight, and checking the logs it gets about halfway through before I get repeated errors: Nov 13, 2016 01:20:33.530 [7612] ERROR - Error in Python: Running scanner: Traceback (most recent call last): File "C:\Program Files (x86)\Plex\Plex Media Server\Resources\Plug-ins-1bef33a\Scanners.bundle\Contents\Resources\Common\VideoFiles.py", line 192, in Scan Filter.Scan(path, files, mediaList, subdirs, video_exts, root) File "C:\Program Files (x86)\Plex\Plex Media Server\Resources\Plug-ins-1bef33a\Scanners.bundle\Contents\Resources\Common\Filter.py", line 103, in Scan ignore_list = glob.glob(pattern) File "C:\Program Files (x86)\Plex\Plex Media Server\python27.zip\glob.py", line 27, in glob return list(iglob(pathname)) File "C:\Program Files (x86)\Plex\Plex Media Server\python27.zip\glob.py", line 59, in iglob for name in glob_in_dir(dirname, basename): File "C:\Program Files (x86)\Plex\Plex Media Server\python27.zip\glob.py", line 73, in glob1 names = os.listdir(dirname) TypeError: must be (buffer overflow), not str Nov 13, 2016 01:20:33.530 [7612] ERROR - Error scanning directory .
I am using .plexignore, but it hasn’t been a problem up until now.
So I did some more testing…
I created another library with one of my folders, but the error persisted and would not add any movies at all.
Then I removed the .plexignore file, and the new library is now scanning and tagging everything like normal.
I’m going to see if I can modify my plexignore to still suit my needs and allow it to keep the movies like it should.
@ChuckPa Sorry, I didn’t keep any logs and they’ve since cycled off. But when the error occurred, basically it would scan a few different library folders without incident (D:\Movies, E:\Movies, etc.), but then on one particular root folder (I:\Movies), it would log the posted error, and then every single subfolder found after that would show the same buffer overflow error, eventually leading to the scanner deleting hundreds of movies from the library.
After I reviewed the .plexignore KB article, I ended up simplifying my .plexignore and it seems to taken care of the problem.
Old: *sample* *SAMPLE* */*sample* */*SAMPLE* */*/*sample* */*/*SAMPLE*
Now: *sample* *SAMPLE*
Note I am running 2012 R2, fully patched.
I should also note that I tried uninstalling and going back to 1.1.4 and the problem persisted. Once I overwrote all my .plexignore files it was finally fixed, and upgrading back to 1.2.7 didn’t re-introduce the problem.
So it’s possible that the .plexignore file was somehow corrupted or freaking out the scanner in some way, and just writing a new copy to that particular folder fixed it. I’m not sure…
Windows system where \ is the path separator but you used ‘/’ (Linux separator) ?
Would you, as an experiment, please attempt something\another\* and verify the results?
OK I created a new library with just one of my folders and scanned the folders.
I was not able to reproduce my original error but here are my results.
I created a .plexignore file containing: *\Test*\*
When .plexignore contained Windows system '', the scanner did not parse this correctly and permitted my test file to be scanned/added.
When .plexignore contained Linux system ‘/’, the scanner did correctly parse this, and subsequently deleted that test file from the library.
In both cases, there were no errors registered in the log, just that it picked up the file, or queued it for soft-deletion.
I believe I did run into this behaviour a long time ago, which is why I used Linux separators while in Windows. However, since * should capture all subfolders when .plexignore is placed in the root folder, the nested */*/*sample* entries were likely redundant for me anyway.
@ChuckPa said:
Thank you.
Now for the ultimate question: Should the directory separators be OS-specific? e.g. \ on windows and / on other platforms?
Typically it is OS-specific (although Windows can understand both), but I am guessing that since it’s Python that is reading the .plexignore file, it would depend on what libraries are being used in PMS implementation of Python.
My not-really-dev-educated guess would be that the included libraries for Python are Linux focused, which could explain why the \ separator isn’t working.
As for why I got those errors in the first place, I will never know, since I can no longer reproduce it after re-writing the .plexignore file. Even reverting it back doesn’t cause it.