luigi311 / JellyPlex-Watched

Sync watched between jellyfin and plex locally
GNU General Public License v3.0
392 stars 19 forks source link

[BUG] Getting 401 unauthorized and users aren't syncing. #106

Closed devanteweary closed 8 months ago

devanteweary commented 11 months ago

Hello! Thank you for this program. Working well for me.

However, I have the following issues with other users on my server:

I have myself, Josh, and Kels on both Jellyfin and Plex.

My personal (Devante) watch states seem to update correctly. However, Josh and Kels won't.

Looking at the logs, it seems Plex is not allowing me access to... something.

I've added one user to my Plex Home (Kelvyra) and kept one user as a Managed Access user (Joshy). Both get the same error.

Could I be missing something else? Thank you for any insight!


Setup


Part of the error that I'm getting:

[ERROR]: Plex: Failed to update watched for josh.fa2 in library Movies, Error: (401) unauthorized; http://192.168.1.200:32400/:/progress?key=12586&identifier=com.plexapp.plugins.library&time=1585163&state=stopped

📄 jellyplex.log

➡ My Docker Container ⬅ docker run -d --name='jellyplex-watched' --net='docker_network' -e TZ="America/Los_Angeles" -e HOST_OS="Unraid" -e HOST_HOSTNAME="Devante-NAS" -e HOST_CONTAINERNAME="jellyplex-watched" -e 'DRYRUN'='False' -e 'DEBUG'='True' -e 'DEBUG_LEVEL'='INFO' -e 'SLEEP_DURATION'='300' -e 'LOGFILE'='/logs/log.log' -e 'USER_MAPPING'='{"DevanteWeary": "Devante", "josh.fa2": "Joshy","Kelvyra": "Kelvyra"}' -e 'LIBRARY_MAPPING'='' -e 'BLACKLIST_LIBRARY'='' -e 'WHITELIST_LIBRARY'='' -e 'BLACKLIST_LIBRARY_TYPE'='' -e 'WHITELIST_LIBRARY_TYPE'='' -e 'BLACKLIST_USERS'='' -e 'WHITELIST_USERS'='' -e 'SYNC_FROM_PLEX_TO_JELLYFIN '='True' -e 'SYNC_FROM_JELLYFIN_TO_PLEX '='True' -e 'SYNC_FROM_PLEX_TO_PLEX '='True' -e 'SYNC_FROM_JELLYFIN_TO_JELLYFIN '='True' -e 'PLEX_BASEURL'='http://192.168.1.200:32400' -e 'PLEX_TOKEN'='TOKEN ENTERED' -e 'PLEX_USERNAME'='' -e 'PLEX_PASSWORD'='' -e 'PLEX_SERVERNAME'='' -e 'SSL_BYPASS'='True' -e 'JELLYFIN_BASEURL'='http://192.168.1.200:8096' -e 'JELLYFIN_TOKEN'='TOKEN ENTERED' -e 'PUID'='99' -e 'PGID'='100' -e 'UMASK'='022' -l net.unraid.docker.managed=dockerman -v '/mnt/user/appdata/jellyplex-watched/logs':'/logs':'rw' --log-driver=syslog --log-opt tag={{.Name}} --log-opt syslog-address=udp://192.168.1.200:1514 'luigi311/jellyplex-watched:latest'

.x[ Devante ]x.

luigi311 commented 11 months ago

Is the plex token you entered from the administrator of the server?

devanteweary commented 11 months ago

Is the plex token you entered from the administrator of the server?

Yes sir!

I tried both the token obtained from the external web player and then tried from the internal web player logged in as the admin/owner account.

AlienXAXS commented 11 months ago

Hi, I am also getting this error, it only seems to happen on Partially watched content though as other content that's marked as watched fully seems to be working as intended...

I wonder if this started to happen since I updated PMS to 1.32.6.7557, i may try a downgrade and let you know if time permits.

devanteweary commented 11 months ago

Hi, I am also getting this error, it only seems to happen on Partially watched content though as other content that's marked as watched fully seems to be working as intended...

I wonder if this started to happen since I updated PMS to 1.32.6.7557, i may try a downgrade and let you know if time permits.

Hey @AlienXAXS, I just tried downgrading to 1.32.5.7516 and the issue was still there so don't worry about trying!

luigi311 commented 11 months ago

Looks like plex had an api change for some stuff at some point. Can you guys try the dev tag

devanteweary commented 11 months ago

Looks like plex had an api change for some stuff at some point. Can you guys try the dev tag

Hey @luigi311 !

So I'm trying to dev tag and get the same issue with both external and internal tokens. I also tried adding my local subnet and the subnet of the docker network to allowed local networks in Plex itself.

Same problem though. :<

By the way, if you want remote access for any troubleshooting, I don't mind and have a VM set up just for that.

devanteweary commented 11 months ago

Hey @luigi311 just wanted to update that I tried the latest version that just came out today and unfortunately the issue persists.

devanteweary commented 8 months ago

Hey @luigi311 , wanted to update on this issue. I started messing with it again today and basically got no further but noticed it always gave the 401 error on the same movies/shows for the same 2 users... here's a screenshot and it has basically been the same for months. I think even the same exact shows/movies.

Screenshot 2023-12-08 100002

luigi311 commented 8 months ago

Thats interesting, I still havent been able to replicate this on any of my setups so i might need to take you up on your offer of remote access. Can you email me at git@luigi311.com with your information so i can see if i can run it and troubleshoot it on my side?

luigi311 commented 8 months ago

@AlienXAXS I think i got the issue fixed, it seems to be working for devanteweary now with the dev image, can you give that a try and see if it works correctly on your side.

luigi311 commented 8 months ago

This has been fixed in 0190788658723bd09cecf0747fe5e157cc2fbf07