New TV Agent does not honor plexignore and ruined my very large library

Server Version#: 1.24.1.4931-1a38e63c6
Player Version#: n/a

I attempted upgrading to the new TV agent tonight. Immediately it scanned all the folders that I had ignored in my .plexignore file which worked fine for years. It created massive numbers of items and duplicates that I’m now rolling back.

Two things:

  1. plexignore seems to be entirely broken or abandoned with this new scanner. Please fix it because it’s super useful

  2. The documentation for plexignore is just not very good. Documentation is generally very good here, so it stood out to me.

All I want is for folders prefixed with an underscore to not be scanned. I have a simple one line .plexignore at the root of each library which worked up until these new scanners came along. If plexignore has been abandoned please update the documentation so we can work around it. For now I’m going to just remove world read permissions from these folders so Plex doesn’t scan them in, but it has side effects that aren’t great.

For reference here’s my very basic .plexignore:

*_/*

EDIT: The above was me making an egregious typo. It’s actually

_*/*

and always was.

So you want to ignore folders inside the same folder as the .plexingore file that start with _?

If so that rule would look like this:

_*/*

Your current rule should only ignore folders that are named _ (exactly).

If you could give some examples I could confirm it but I think this is the issue.

Sorry, that was a typo. I don’t know why I chose to post this at 4AM.

Here’s an actual copy/paste of the file which has remained the same for years:

# Ignore folders that start with _ (e.g. _ignoreme, _extras, _honkhonk)
_*/*

By the way, the new Movie scanner broke this too.

See also: .plexignore stops working after agent "upgrade" (Plex Tv Series) - #2

Could you give me an example of how the folders are structured and where the .plexignore file sits in the hierarchy?

Library root set to /Movies
/Movies/.plexignore
/Movies/My Great Movie (2010)
/Movies/My Great Movie (2010)/My.Great.Movie.2010.mkv
/Movies/My Great Movie (2010)/_old_version/My.Great.Movie.2010.old.mkv

Both MKVs will be scanned in despite the rule set in .plexignore.

For TV, similar setup:

Library root set to /TV
/TV/.plexignore
/TV/My Great Show/Season 01/My.Great.Show.S01E01.mkv
/TV/My Great Show/Season 01/_ignore/garbage_file.mkv

Both files are scanned in.

I can reproduce this with a couple of staging libraries with the new scanners.

Based on what I can tell the folder wildcards aren’t working, maybe when they appear midway through the path or something.

This kind of rule still works, if you have a _sonarr folder anywhere in the path

_sonarr/*

It’s correctly applied to subfolders too (I tested this).

This is the rule I want to work:

_*/*

But this fails everywhere except at the library root.

/TV/_myfolder/somefile ← this is ignored properly
/TV/Show Name/Season 01/_myfolder/somefile ← this is not

Probably a bug in path handling when the plexignore is applied to subdirectories.

Bumping this for visibility. The bug is easily reproduced so I hope it’s getting some attention internally.

Bumping again. Problem still exists.

I wish Plex had a better way to track issues than a forum thread that is automatically closed after it’s ignored long enough

2 Likes

don’t we all …

groan

i find this out after i just got done nuking every plexignore in every directory. So i could turn it on and off, then work on some detail where the new scanner is failing and some tweaks for it.

After all that deep cleaning and tweaking and crafting it don’t work :’( almost everything that should in theory be ignored isn’t.

One thing that i have noticed is that ' can be picked up and will break code

/tv/Fat.Pizza.Series.+.Movie/Pizza - Series 4/Fat Pizza-s04e03- Bobo And Pauly The Early Years Part 2.avi 
/tv/Fat.Pizza.Series.+.Movie/Pizza - Series 5/Fat Pizza-s05e03-Father's Day Pizza.avi 

in the mean time can we use \ to escape? Take this as a separate example (not the duplicates i was talking about earlier) What needs to be escaped here:

#plexignore placed in libary root. Perhaps literal not dynamic path? 
24 S01-S09 (2001-) + Movie (2008)/24 S08 (360p re-webrip)/*S08X*
24 S01-S09 (2001-) + Movie (2008)/24 S09 Live Another Day (360p re-webrip)/*S09X*
24 S01-S09 (2001-) + Movie (2008)/24 S04 (360p re-webrip)/*S04X*

Try as i might haven’t quite figured this out. Though in theory, it should work.

Hey, so I gave you a really clear and reproducible example and you quit responding. Is this a tracked bug now?

Yes, it’s on the list.

1 Like

The workaround of using permissions (disallowing the Plex user to read the directories I want it to skip) is also bad because of another bug.

The thread that registers inotify watches abandons an entire subtree if it hits a folder/file it cannot register, rather than just moving onto the next one. Watching the debug logs on startup I can see it successfully register a good number of watches in my “TV” library until it hits an example folder (where plex has no read permissions), then the whole thing breaks and it moves onto another library section rather than the next item in the tree.

So, yeah, that is no good either.

Also, inotify watches are generated despite the contents of .plexignore. It may not matter if the bugs around plexignore are fixed later but it is a waste of kernel memory. Folders that should be excluded from scans according to the rules are still generating watches.

When you put this together, a library may have a folder that the Plex user cannot access, the user tries to work around it by adding an entry to .plexignore, and this doesn’t help because the inotify registration thread is not aware of these rules, and is too brittle and breaks the moment it encounters a folder it cannot read. This results in a library not being auto-updated as it should, since inotify watches are only generated for an unpredictable portion of the library.

  1. Please fix wildcards in paths in .plexignore
  2. Please fix inotify registration so it obeys rules in .plexignore
  3. Please fix inotify registration so it does not fail catastrophically when a single folder is inaccessible – catch the exception and move onto the next watch instead

Sorry to tag you but I don’t know how else to get this read @drzoidberg33

The workaround for now is going to be to restore read permissions for everything in the library section, and to use a standardized “_hidden” folder to hide stuff, since this type of rule still works:

_hidden/*
1 Like

I’m also are having trouble with the .plexignore file.

I thought the issue was that sonarr creates hardlinks and that this is confusing Plex but it might just be the rule parsing…

This is my current .plexignore file:

./_dl_/*

I’ve just changed it to:

_dl_/*

And hope that will work better, or else I guess i have to restructure my whole lib (currently I have all my series under /volume 2/Media/Series and this is where my .plexignore is located too).

Plex doesn’t mind hardlinks.

Can you simply download to a different folder structure?

It’s much better to think of .plexignore as a filter that happens after all scanning has been performed, instead of a bypass that happens up front. It’s almost always better to restructure than to rely on .plexignore.

I changed my .plexignore to this and it seems to work fine (for now):

/volume2/Media/Series$ cat .plexignore
_dl_/*
/volume2/Media/Series$ cat _dl_/.plexignore 
*/*
*
/volume2/Media/Series$ 

If the issues persists I’m going to reorganize…

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