In the past when I’ve hard linked items into my library (linking for both my wife and myself so we can each delete independently without doubling the disk space usage) the items are not detected in both directories. The fact that they are not detected is not the issue, this is known and I worked around the limitation by using Plex Media Scanner in a processing script:
Plex Media Scanner --scan --section x
This would find the new files and when the new files were found, Plex would obtain their metadata and all was good.
A while ago, and I don’t know exactly how long it’s been, there seems to have been a change in the logic and now it will find the new files if I kick off a --scan, however, it won’t automatically obtain the metadata for the files. It ends up generating icons off the actual files rather than downloading the professional metadata on the internet.
It will also not auto-correct itself over time despite having "Update Library Interval" == Daily in my settings. The only thing that will force it to obtain the internet metadata is:
Plex Media Scanner --refresh --force --section x
This is a change from how it operated before. Previously if Plex found new media with --scan it would download the metadata instead of generating the icons itself. Can this be changed back to the previous functionality?
I’m not familiar with linux but there hasn’t been a change like what you’ve described. The scanner has always took screen grabs from your media file. It just doesn’t use it unless it can’t match you movie file. There have been changes that may affect matching your filename to a movie. If you’ve been using the recommended naming guidelines, then things shouldn’t have changed. If you are using your own naming convention, then matching may have changed. Double check your filenames.
Please provide your scanner logs from PMS after having added one of these files.
It matches the movie name fine from what I can tell, otherwise forcing a refresh wouldn’t have worked: Plex Media Scanner --refresh --force --section x
Am I understanding you’re not seeing Update my library automatically activity? (Settings - Server - Library)
If this is true, Uncheck the box, save. wait 10 seconds, Check the box, and save again.
Now go touch a directory and see if you get any of those new files added.
Depending on how many directories PMS is watching (the linux default max is 8192), you could conceivably have hit the limit).
Also, if the media directories are on your LAN, these will never be seen. iNotify (kernel function) is within the confines of the ‘local’ host only. There is no inter-host operability
@ChuckPA said:
Am I understanding you’re not seeing Update my library automatically activity? (Settings - Server - Library)
Sorry no. It does detect changes, just not all hard link type activities. If I copy something in, yes, it detects it. If I hard link something in, then maybe it detects it. The ‘maybe’ is why I use the Plex Media Scanner to force a scan to detect the new items. @ChuckPA said:
Depending on how many directories PMS is watching (the linux default max is 8192), you could conceivably have hit the limit).
I’m nowhere near the limit, this isn’t the problem. @ChuckPA said:
Also, if the media directories are on your LAN, these will never be seen. iNotify (kernel function) is within the confines of the ‘local’ host only. There is no inter-host operability
No, this is local.
To summarize the problem stated above (even shorter):
There are items not detected. (Regardless of the ‘why’, this is the starting state)
I run Plex Media Scanner --scan --section x. It detects the files and uses the self-generated image.
I run Plex Media Scanner --refresh --force --section x and it uses the downloaded metadata from the internet.
The issue is that it didn’t download/use the metadata upon doing the --scan command. It took a --refresh --force to get it to use the downloaded metadata. This is not the preferred option as a forced refresh is going to do a lot more downloading as it refreshes everything.
If IN_ATTRIB were specified in the mask PMS uses, any change of any kind would trigger a rescan.
It does trigger on CLOSE_WRITE, CREATE, MODIFY, DELETE, and MOVE of the file itself.
Since ATTRIB is link related, I will check this out further.
The pro to adding ATTRIB is Hard Links will be detected (link count to the file changes)
The con to adding ATTRIB is: When the link count increases or decreases, the source file is processed again, as if an independent file. If any other attribute of the file, including a touch is executed (changing date/time), everything touched is scanned again.
I’m open to testing things out, but I’m afraid I’m not qualified to gauge the impact of what you are suggesting above across all the OSes and implementations that Plex supports.
My main concern was that the simple --scan command I used in the past won’t always use downloaded metadata like it used to, forcing me to use the more resource intensive --refresh --force to guarantee it uses downloaded metadata.
--scan --refresh is what you need. --scan only scans for the files. --refresh picks up the metadata / performs the matching. This is what "Update Library’ does from the Web/UI.
Edit: --scan all by itself only triggers the LMA (Local Media Assets) to update metadata within extras, etc.
Reed,
Would you do it your way then capture the full logs (settings - server - help - download logs) ?
That’s not supposed to be needed.
I’m beginning to wonder if this is a simple matter of your agent caches are munged up somehow and need a simple ‘flush’
@ChuckPA said:
If IN_ATTRIB were specified in the mask PMS uses, any change of any kind would trigger a rescan.
It does trigger on CLOSE_WRITE, CREATE, MODIFY, DELETE, and MOVE of the file itself.
Since ATTRIB is link related, I will check this out further.
The pro to adding ATTRIB is Hard Links will be detected (link count to the file changes)
I’m absolutely no expert in this area, so I could be completely wrong, but wouldn’t ATTRIB mean that you get a notification for the old file (path) when you add a new link elsewhere? The inotify man page seems to indicate that you get CREATE when a new hard link is created in a directory (but presumably without IN_CLOSE_WRITE):
IN_CREATE (+)
File/directory created in watched directory (e.g., open(2)
O_CREAT, mkdir(2), link(2), symlink(2), bind(2) on a UNIX
domain socket).
I’ve uploaded the logs. The new item in the logs is the movie “McLaren”, which was replicated into both ‘Reed’ and ‘Heather’ directories with a hard link (at 23:30) and then forced to be detected in Plex with “–scan”:
Plex Media Scanner --scan --section 4 Plex Media Scanner --scan --section 6
Lines from the log file:
root@NAS:/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Logs# fgrep -i mclaren *
Plex Media Server.log:May 31, 2017 23:30:01.896 [0x7f36e4fdb700] INFO - Library section 4 (Reed’s Movies) will be updated because of a change in /media/ssd/Movies/Unwatched/Reed/Movies/McLaren (2016)
Plex Media Server.log:May 31, 2017 23:30:01.900 [0x7f36e4fdb700] INFO - Library section 6 (Heather’s Movies) will be updated because of a change in /media/ssd/Movies/Unwatched/Heather/Movies/McLaren (2016)
@ChuckPA said:
If IN_ATTRIB were specified in the mask PMS uses, any change of any kind would trigger a rescan.
I’d be happy to test this out if you could boil it down to what changes and I’d need to make and where.
@jonkv said:
I’m absolutely no expert in this area, so I could be completely wrong, but wouldn’t ATTRIB mean that you get a notification for the old file (path) when you add a new link elsewhere? The inotify man page seems to indicate that you get CREATE when a new hard link is created in a directory (but presumably without IN_CLOSE_WRITE):
IN_CREATE (+)
File/directory created in watched directory (e.g., open(2)
O_CREAT, mkdir(2), link(2), symlink(2), bind(2) on a UNIX
domain socket).
I am looking at my notes and went to look for the logs here again to correlate and show my findings but don’t see your logs here for me to grab fresh.
Do you still have the ZIP file handy?
I apologize for being slower than normal. I’ve had an equipment issue here and am, today, having major internet issues.
When I saw your logs, the very first thing that went through my mind was a functionally corrupted database. The EPG errors are outrageous.
The other Plex components ‘held transaction too long’ are another sign of things being fouled up badly either at the machine or within PMS itself.
I would like you to conduct a test.
Stop PMS
Rename /var/lib/plexmediaserver/Library to Library.SAVE
Start PMS
Stand up a ‘new’ server with a ‘test’ name. (we don’t want to conflict with your established name)
Add in one section containing the primary media and one section containing the links.
As metadata is coming down, complete making Settings tweaks per your normal operating state
When it’s ready (stable and quiet), Optimize the DB