#Plex Collection Sync

1 messages · Page 1 of 1 (latest)

frozen turtle
#

I'm having issues with syncing Plex collections. When I choose the option to sync I get an error: Failed to get collections from Plex

Background on what I have been doing. I have Kometa sync up a bunch of collections to Plex. These are used to create Tags that I use in smart collections to build some channels (ex. Trending Movies). Recently I was creating some new collections where I noticed it wasn't working. New items and labels sync so it only appears to be collections. I am not sure when it started doing this.

I am using Unraid running the latest ersatztv:develop-vaapi and the Plex version is 1.41.1.9057.

Any suggestions on where I should start looking into fixing this?

frozen turtle
#

I posted this to the community page but if anyone else is having this issue. This is what I did to work around it for now:

Looks like this is caused by a change to the Plex Media Server. When using plex version 1.41.0.8994 and above the collection sync is broken.

I rolled back PMS to version 1.41.0.8992 and do the Plex Collection sync. Tags will show up with no error.

After the Collections synced, I made created and deleted some new collections in Plex. Updated the PMS to the latest version 9220. Doing the collection sync gives the error. But the previous tags are still attached to the Items.

Rolled back the PMS did the collection sync and tags were updated.

Tested on a larger library and the previous Smart Collections I were using are fixed. There was a couple smart collections that didn't completely update but a clearing of the search index got those going.

This work around works with Movies, TV and Other Videos.

pliant marsh
#

thanks for the bump, ill test this on my plex server soon

pliant marsh
#

i can repro with a newly created collection

#

#features-and-changes message

frozen turtle
#

Amazing. Thanks. I'll check out later today

frozen turtle
#

Confirmed it is working. Appreciate you looking into this.

elder holly
frozen turtle
#

Just tested myself. I added a random movie to a collection in plex called "Nature Docs". Did a collection sync and a quick library sync. I didn't get the error in Ersatz.

Tested out by searching for tag:"Nature Docs" pulled up 17 movies instead of the 18 I have in Plex. I went to he movie page in Ersatz. It has the updated tag. Clicking on the link only showed 17 in the search instead of 18. Ended up restarting Ersatz and the search was right after that.

I tried a couple more movies and it worked. Randomly one one it didn't remove immediately but the restart fixed it. I assume it's probably some search reindex thing as it only happened 1 time out of 10.

I am on Ersatz 0.8.8-17a77694-docker-vaapi and Plex version 1.41.3.9314 both in Docker on Unraid

elder holly
#

I’m not sure how to troubleshoot this further

pliant marsh
#

Paste your full etv version from below the left menu

elder holly
#

This is a paste from the log. I notice every time I try scanning for collections that warning about a config comes before it.

pliant marsh
#

Paste your full etv version from below the left menu

elder holly
#

0.8.8-beta-docker-nvidia

pliant marsh
#

your version does not have the fix

#

switch your tag from latest-nvidia to develop-nvidia

elder holly
#

Will do, I’ll let you know the results

#

It worked perfectly, I didn’t even think to change to the development version.

mellow bough
#

I’m running into this now also on plex 1.4.31.9314. Running the newest etv 25.1.0-docker-nvidia

The etv logs show failed to get collections from plex, with a stack trace starting with value cannot be null (parameter ‘source’)

I’d paste the full trace now, except im on mobile momentarily. Can come back to provide that.

I noticed the GitHub release notes mention that if collection scanning is broken, I may need to update plex, but it’s already the latest available.

Any thoughts or requests for data I may provide?

pliant marsh
#

slightly different error than above, perhaps they changed their api again. i'll test with my plex server

pliant marsh
#

can't repro, might need someone to make some specific curl requests against their plex server so i can see the responses

mellow bough
#

I'm happy to do whatever you need

#

cURL fluent. 🙂

#

to trigger it, in ETV's web gui, I navigate to Media->Libraries and click the refresh icon beside External Collections (Plex)

#

a packet capture on the etv container to plex shows:

#
Host: localhost:32400
Accept: text/xml

HTTP/1.1 200 OK
X-Plex-Protocol: 1.0
Content-Type: text/xml;charset=utf-8
Content-Length: 237
X-Plex-Container-Start: 0
X-Plex-Container-Total-Size: 0
Connection: Keep-Alive
Keep-Alive: timeout=20
Cache-Control: no-cache
Date: Wed, 15 Jan 2025 20:53:48 GMT

<?xml version="1.0" encoding="UTF-8"?>
<MediaContainer size="0" totalSize="0" offset="0" allowSync="0" identifier="com.plexapp.plugins.library" mediaTagPrefix="/system/bundle/media/flags/" mediaTagVersion="1734477983">
</MediaContainer>```
#

then the same request goes out again, but this time in json instead of xml

#

(let me know if youd like me to paste that version)

#

and the etv logs show:

System.ArgumentNullException: Value cannot be null. (Parameter 'source')
   at System.Linq.ThrowHelper.ThrowArgumentNullException(ExceptionArgument argument)
   at System.Linq.Enumerable.Select[TSource,TResult](IEnumerable`1 source, Func`2 selector)
   at LanguageExt.List.map[T,R](IEnumerable`1 list, Func`2 map)
   at ListExtensions.Map[T,R](IEnumerable`1 list, Func`2 map)
   at ErsatzTV.Infrastructure.Plex.PlexServerApiClient.<>c__DisplayClass14_0.<GetAllCollections>b__3(List`1 list) in /source/ErsatzTV.Infrastructure/Plex/PlexServerApiClient.cs:line 317
   at LanguageExt.TaskExtensions.Map[T,U](Task`1 self, Func`2 map)
   at ErsatzTV.Infrastructure.Plex.PlexServerApiClient.GetPagedLibraryContents[TItem](PlexConnection connection, Func`2 countItems, Func`5 getItems)+MoveNext() in /source/ErsatzTV.Infrastructure/Plex/PlexServerApiClient.cs:line 363
   at ErsatzTV.Infrastructure.Plex.PlexServerApiClient.GetPagedLibraryContents[TItem](PlexConnection connection, Func`2 countItems, Func`5 getItems)+System.Threading.Tasks.Sources.IValueTaskSource<System.Boolean>.GetResult()
   at ErsatzTV.Scanner.Core.Plex.PlexCollectionScanner.ScanCollections(PlexConnection connection, PlexServerAuthToken token, CancellationToken cancellationToken) in /source/ErsatzTV.Scanner/Core/Plex/PlexCollectionScanner.cs:line 42
   at ErsatzTV.Scanner.Core.Plex.PlexCollectionScanner.ScanCollections(PlexConnection connection, PlexServerAuthToken token, CancellationToken cancellationToken) in /source/ErsatzTV.Scanner/Core/Plex/PlexCollectionScanner.cs:line 42```
pliant marsh
#

nice, thank you. i guess i didn't test with no collections

#

totalSize="0"

#

hmm. dont really want to delete my plex collections. i might push a possible fix for testing

pliant marsh
#

there's a new develop build available that i think/hope will fix that error with plex collections

#

would need to switch from latest-nvidia to develop-nvidia

#

this should only happen when the plex server has no collections, so there isn't really any impact to it failing

mellow bough
#

OK - I'll give it a try now. Honestly, I never really knew that plex had 'collections' or that etv would import them automatically. Probably makes managing etv collections a little simpler! I just have all my movies in "Movies".

#

I tried develop-nvidia, still having the error. FWIW etv reports this version string: 0.8.8-f0a5d89f-docker-nvidia - I wasnt expecting to see 0.8.8 there..

pliant marsh
#

are you sure you pulled develop-nvidia?

#

the hash after the version is the commit, and f0a5d89f is from 12-27, not the recent commit from 1-15

mellow bough
#

I did, but i was running it before, i wonder if it used a cached version or something. let me double check.

#

That did it - i flushed the old image out and forced it to re pull, and i see the correct version now. No more error!

I did have to re-map my Live TV DVR + EPG channels again, which only took a second.. Guide shows up now, however trying to play any of the channels results in this, in the log:

[13:03:16 INF] Starting ts stream for channel 104
[13:03:16 INF] Starting HLS session for channel 104
[13:03:16 WRN] Unexpected pixel format null may have playback issues
[vost#0:0/copy @ 0x321c480] Error submitting a packet to the muxer: Broken pipe
[out#0/mpegts @ 0x32edd00] Error muxing a packet
[out#0/mpegts @ 0x32edd00] Error writing trailer: Broken pipe
[out#0/mpegts @ 0x32edd00] Error closing file: Broken pipe

#

Now, i am currently traveling and in a hotel, so if there's a chance this could be some sort of firewall doing this, that would explain it. But, its not clear enough to me from the logs if that could be related.