l3uddz / plex_autoscan

Script to assist sonarr/radarr with plex imports. Will only scan the folder that has been imported, instead of the whole library section.

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Support request - Could not locate record in 'media_parts' where 'file'

NicoLeOca opened this issue · comments

Hi @l3uddz

Sorry if I post a request for support here, I went to discord twice in a week and didn't get support there. Could you please help me?

I also found a similar issue on github but it didn't help either
#35

I keep getting this issue here:

Line 1 : 2019-12-21 09:46:32,889 - ERROR - PLEX [139687123838720]: Could not locate record in 'media_parts' where 'file' = '/home/nicoleoca/cloud-media-scripts/media/Movies/1080p/Fantastic Beasts and Where to Find Them (2016)/Fantastic.Beasts.and.Where.to.Find.Them.2016.MULTi.Truefrench.1080p.BluRay.Remux.AVC.NoTag.mkv' after 5 tries 

I have made many changed to my config file without success
Can you please have a look at my logs and config below and guide me a bit?

logs:
https://pastebin.com/SQr8tuHm

config:
https://pastebin.com/S8JY0uzN

Thank you

I have the same issue.

I've only just setup PlexAutoScan and from what i can tell it doing its job. The problem seems to be that the Plex Media Scanner is not actually scanning the media. Therefore when PlexAutoScan tries to analyze the file it thinks it just added Plex Media Scanner can't find it and this is where the error: "Could not locate record in 'media_parts' where 'file' = " appears.

The Plex Media Scanner, when run manually with the same command as PlexAutoScan uses returns no results. There is no out put on screen, nothing in the plexmediascanner logs, and nothing appears in the Plex Library. I am not sure if there should be though.

I would suggest the following to amendments to PlexAutoScan to make this clearer:

  • Assuming that there should be some output from the Plex Media Scanner it would good for PlexAutoScan to monitor for it, and if none are received assume the scan failed and log it

  • If no output is expected, PlexAutoScan should check the PlexDatabase for the media it thinks was just scanned. If it is not found in the database this should be logged and a retry of the scan should ocurr (up to x times after a small wait period).

  • PlexAutoScan should not try to tell Plex to analayze a media file unless it can find it in the database.

@jennec did you manage to work around this in the end? I've having the exact same issue.

Weird thing is its only happening for a new library i've created for music. All my other libraries are all working and following the same paths etc. so can't find a difference between them apart from the issue library being newer?