Closed slunat closed 8 months ago
This is clearly problem at plex server side. Check it's logs, enable it's debug logging. There's no rate limits towards plex server. Might be slow io so it fails to process some item. but 300s is quite long timeout already.
Try syncing only problematic item only. Try figuring out what the problematic item is.
This might help with debug:
but it assumes the crash happens after plex has given out the id, seems in your case it timeouts before that.
You should also disable sync features to minimize the effect. at least the logs would be less noisy if you (for example) don't sync liked lists.
I think I have found the culprit. The specific media item (Grand Tour S03E11) that it was trying to add to collection had not yet had the metadata scan in Plex completed for it, which meant Plex did not yet know what format the file was in. After I manually added that item to the trakt collection, I re-ran the script and it managed to go past that episode, but failed the next one. After checking the episode it was failing, it also had not yet had the metadata scan completed.
You will know better than me, but I suspect the script is hanging trying to grab the media information like the resolution and audio from Plex as it adds this data when adding it to collection. However in the instance the metadata scan has not yet completed, the script will hang trying to add to collection since the data does not exist in Plex.
I don't see this being a common issue at all, it was related to a separate problem that was preventing those specific media items to not be able to be scanned for metadata as I had left them scanning for several hours and they still wouldnt complete. I do think that was more of a local file issue than anything else and I have not had this issue with other stuff. I have since removed those files from my library and the scan has been able to complete successfully without failing.
I suppose if anything, maybe add some sort of way to have the script skip adding files to collection that are missing metadata or maybe just add them without the data, so that the script doesn't hang and fail and instead can happily sync everything else it can. As I say though I don't particularly think this is a common issue at all.
You will know better than me, but I suspect the script is hanging trying to grab the media information like the resolution and audio from Plex as it adds this data when adding it to collection. However in the instance the metadata scan has not yet completed, the script will hang trying to add to collection since the data does not exist in Plex.
I think if you skip "collection" feature (collection: false
), then it will not try to obtain info about media files
I suppose if anything, maybe add some sort of way to have the script skip adding files to collection that are missing metadata or maybe just add them without the data, so that the script doesn't hang and fail and instead can happily sync everything else it can. As I say though I don't particularly think this is a common issue at all.
this is automatic. if item has no match, then it's not processed, at least the "collection" task will be skipped. you can force manually with "Unmatch".
You will know better than me, but I suspect the script is hanging trying to grab the media information like the resolution and audio from Plex as it adds this data when adding it to collection. However in the instance the metadata scan has not yet completed, the script will hang trying to add to collection since the data does not exist in Plex.
I think if you skip "collection" feature (
collection: false
), then it will not try to obtain info about media files
I know but this also completely turns off the collections feature which I still want to function. I like being able to see what is already in my library in Trakt so I don’t add it to the list and have it download again.
I suppose if anything, maybe add some sort of way to have the script skip adding files to collection that are missing metadata or maybe just add them without the data, so that the script doesn't hang and fail and instead can happily sync everything else it can. As I say though I don't particularly think this is a common issue at all.
this is automatic. if item has no match, then it's not processed, at least the "collection" task will be skipped. you can force manually with "Unmatch".
sure but that’s about matching the content. I’m talking specifically about content that has successfully matched, but the metadata in Plex is missing because Plex has not scanned the metadata of the file yet. So if I go to the media item in Plex and click on get info, it tells me nothing about the files format at all because it hasn’t scanned that data yet. In that scenario, the script breaks so a way for the script to skip these items in this scenario would be ideal. Like I say though I don’t think this is a massively common scenario so I wouldn’t blame you for not wanting to spend time working on that. In most cases people will have plextraktsync scheduled to run so it should complete on the next run. In my case I spent two days trying to fix this issue because the same media item was refusing to retrieve metadata.
so I wouldn’t blame you for not wanting to spend time working on that
the thing is, there's nothing can be done. as it's plex media server internals that's broken.
I know but this also completely turns off the collections feature which I still want to function.
i gave as info, so you can test if that prevents the timeout or not. can you test this?
I’m talking specifically about content that has successfully matched, but the metadata in Plex is missing because Plex has not scanned the metadata of the file yet.
i proposed the unmatch, to see if this could be used as band-aid for timeout problem. can you test this?
Sorry I can’t test this. The items in my library that were missing the metadata now have the metadata and so the script is running through successfully and not timing out. Without being in that situation again I can’t test this and I don’t know of a way to manually put it in that situation. If it happens again and I notice it I’ll try it.
Confirmation
The problem
ERROR HTTPSConnectionPool(host='192-168-10-X.[redacted].plex.direct', port=32400): Read timed out. (read timeout=300)
I have been having this issue since trying to sync yesterday. It only gets so far into syncing my TV show library and fails everytime. It tends to fail on the same item a lot, but sometimes it des pass that item and fails on a different one. Yesterday I actually had it go all the way to 99% before timing out and crashing. I was initially having this issue on a previous version, I believe it was either 0.28.16 or 0.26.18, before updating it to .20 see if it would fix my issue.
I did do a search through existing issues and came across extending the Plex timeout to something longer than the default 30 seconds, which I tried by extending to 300 seconds. Unfortunately, I haven't noticed any improvement at all and it still stalls in the same place. It honestly feels like I'm maybe hitting rate limits or something with how it always locks up in the same place.
I have also tried deleting the cache file and the servers.yml and going through the connection steps again, but it still errors at the same point when running the sync.
I have pasted my logs and config below.
Steps to reproduce the behavior
plextraktsync sync
commandError trace / logs
Expected behavior
script does not time out and runs sync to completion.
Inspect of problematic items
No response
Workarounds
No response
Install method
pipx
Config file contents
Version
0.28.20
Python Version
3.11.2
Plex Server Version
1.40.0.7998-c29d4c0c8
Operating System and Version
Proxmox Container, Debian 12 Standard 12.2-1