luigi311 / JellyPlex-Watched

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

[ERROR]: No users found for server 1 plex #74

Closed elliottmarter closed 1 year ago

elliottmarter commented 1 year ago

I am running your docker template via unraid and get the following error, I've removed personal names etc for obvious reasons.

[INFO]: Dryrun: True
[INFO]: Creating (black/white)lists
[INFO]: Blacklist Library: []
[INFO]: Blacklist Library Type: []
[INFO]: Blacklist Users: []
[INFO]: Whitelist Library: []
[INFO]: Whitelist Library Type: []
[INFO]: Whitelist Users: []
[INFO]: Creating server connections
[INFO]: Creating users list
[INFO]: User list that exist on both servers {}
[INFO]: Filtered user list {}
[ERROR]: No users found for server 1 plex, users found {}, filtered users {}, server 1 users [<MyPlexUser:123456:Guest>, <MyPlexUser:123456:User1>, <MyPlexAccount:123456:User2>]
[ERROR]: Traceback (most recent call last):
  File "/app/src/main.py", line 374, in main
    main_loop()
  File "/app/src/main.py", line 301, in main_loop
    server_1_users, server_2_users = setup_users(
                                     ^^^^^^^^^^^^
  File "/app/src/main.py", line 43, in setup_users
    raise Exception(
Exception: No users found for server 1 plex, users found {}, filtered users {}, server 1 users [<MyPlexUser:123456:Guest>, <MyPlexUser:123456:User1>, <MyPlexUser:123456:User2>]

Not sure why it says No users found for server 1 plex but then proceeds to list all the users anyway?

The above is running the template with just URLs and Tokens added, no user mappings, if I add user mappings as so...

-e 'USER_MAPPING'='{ "plex-user": "jelly-user" }'

It seems to accept the user mapping but I just get the same error message...any ideas?

To confirm also, container is set to DEBUG, see below.

image

Let me know if you need anything else :)

dDiverVS commented 1 year ago

Same issue here, I have some users which use special characters as "á" which might be causing the issue? If you need additional logs or debugging please let me know.

As additional info I am running a docker on top of truenas scale (don't think it should affect but just in case)

luigi311 commented 1 year ago

Hmm not sure why but it looks like its not finding any matching users between your two servers. I adjusted the log message so it will output more information on the users found. Can you guys try the dev branch, should be as simple as changing the container image from latest to dev.

As for special characters i added that á to my test user so it was testá3 and it still worked without any issues. I did notice for locally created users there was no username which makes sense but title was populated which is what i am using. I also did notice on one of my users that their username is different from title so maybe its a mapping issue. The additional logging should help find any mapping issues now.

luigi311 commented 1 year ago

I have swapped over to use usernames in the dev branch and added a fall back to titles for plex managed users so either way the user should be added to atleast the first list in the logged output.

dDiverVS commented 1 year ago

I just tested it and got a very similar output:

[INFO]: Dryrun: True
[INFO]: User Mapping: {'user1': 'user2'}
[INFO]: Creating (black/white)lists
[INFO]: Whitelist Library: []
[INFO]: Whitelist Library Type: []
[INFO]: Whitelist Users: []
[INFO]: Blacklist Library: []
[INFO]: Blacklist Library Type: []
[INFO]: Blacklist Users: []
[INFO]: Creating server connections
[INFO]: Creating users list
[INFO]: User list that exist on both servers {}
[INFO]: Filtered user list {}
[ERROR]: No users found for server 1 plex, users found {}, filtered users {}, server 1 users [<MyPlexUser:16858034:>, <MyPlexUser:59192010:>, <MyPlexUser:10732315:>, <MyPlexUser:221850420:>, <MyPlexUser:569694:>, <MyPlexUser:18076234:>, <MyPlexUser:12504832:>, <MyPlexUser:9713785:>, <MyPlexUser:844050:>, <MyPlexUser:10471649:>, <MyPlexUser:11207704:>, <MyPlexUser:221879394:>, <MyPlexUser:2109032:>, <MyPlexUser:13287074:>, <MyPlexUser:14592808:>, <MyPlexUser:21629124:>, <MyPlexUser:3903859:>, <MyPlexUser:5035595:>, <MyPlexUser:221877337:>, <MyPlexUser:221850589:>, <MyPlexAccount:2484551:>]
[ERROR]: Traceback (most recent call last):
  File "/app/src/main.py", line 374, in main
    main_loop()
  File "/app/src/main.py", line 301, in main_loop
    server_1_users, server_2_users = setup_users(
                                     ^^^^^^^^^^^^
  File "/app/src/main.py", line 43, in setup_users
    raise Exception(
Exception: No users found for server 1 plex, users found {}, filtered users {}, server 1 users [<MyPlexUser:16858034:>, <MyPlexUser:59192010:>, <MyPlexUser:10732315:>, <MyPlexUser:221850420:>, <MyPlexUser:569694:>, <MyPlexUser:18076234:>, <MyPlexUser:12504832:>, <MyPlexUser:9713785:>, <MyPlexUser:844050:>, <MyPlexUser:10471649:>, <MyPlexUser:11207704:>, <MyPlexUser:221879394:>, <MyPlexUser:2109032:>, <MyPlexUser:13287074:>, <MyPlexUser:14592808:>, <MyPlexUser:21629124:>, <MyPlexUser:3903859:>, <MyPlexUser:5035595:>, <MyPlexUser:221877337:>, <MyPlexUser:221850589:>, <MyPlexAccount:2484551:>]

Retrying in 3600.0

I have deleted all user names, if you need more details let me know and I can DM them to you.

Many thanks!

dDiverVS commented 1 year ago

I just realised that the dev branch has not been updated since a month ago: https://hub.docker.com/r/luigi311/jellyplex-watched/tags?page=1&name=dev That explains why the message is identical to the previous one

dDiverVS commented 1 year ago

I tried the dev-slim tag and got following output (I have deleted all users but mine):

[INFO]: Dryrun: True
[INFO]: User Mapping: {'ddiver_': 'ddiver'}
[INFO]: Creating (black/white)lists
[INFO]: Whitelist Library: []
[INFO]: Whitelist Library Type: []
[INFO]: Whitelist Users: []
[INFO]: Blacklist Library: []
[INFO]: Blacklist Library Type: []
[INFO]: Blacklist Users: []
[INFO]: Creating server connections
[INFO]: Creating users list
[INFO]: User list that exist on both servers {'ddiver_': 'ddiver'}
[INFO]: Filtered user list {'ddiver_': 'ddiver'}
No users found for server 1 plex, users: ['ddiver_'], overlapping users {'ddiver_': 'ddiver'}, filtered users {'ddiver_': 'ddiver'}, server 1 users [<MyPlexAccount:2484551:Gabriel-Vélez>]
[ERROR]: No users found for one or both servers
[ERROR]: Traceback (most recent call last):
  File "/app/src/main.py", line 382, in main
    main_loop()
  File "/app/src/main.py", line 309, in main_loop
    server_1_users, server_2_users = setup_users(
                                     ^^^^^^^^^^^^
  File "/app/src/main.py", line 58, in setup_users
    raise Exception("No users found for one or both servers")
Exception: No users found for one or both servers

Retrying in 3600.0
luigi311 commented 1 year ago

yeah sorry about that dev is stale/abandoned after some recent changes so you just have to pick one of the two dev flavors like you did. Can you do a pull and try again? I added in username/title handling in another section that was missing it.

dDiverVS commented 1 year ago

Now it is working, many thanks!!!

[INFO]: Dryrun: True
[INFO]: User Mapping: {'ddiver_': 'ddiver'}
[INFO]: Creating (black/white)lists
[INFO]: Whitelist Library: []
[INFO]: Whitelist Library Type: []
[INFO]: Whitelist Users: []
[INFO]: Blacklist Library: []
[INFO]: Blacklist Library Type: []
[INFO]: Blacklist Users: []
[INFO]: Creating server connections
[INFO]: Creating users list
[INFO]: User list that exist on both servers {'ddiver_': 'ddiver'}
[INFO]: Filtered user list {'ddiver_': 'ddiver'}
[INFO]: Server 1 users: [<MyPlexAccount:2484551:Gabriel-Vélez>]
[INFO]: Server 2 users: {'dDiver': 'e2694844b7db43a3b5c0e85e7a3c58af'}
[INFO]: Creating watched lists
Plex: Generating watched for ddiver_ in library Movies
Plex: Generating watched for ddiver_ in library Anime
Plex: Generating watched for ddiver_ in library TV
Plex: Generating watched for ddiver_ in library Friends
Plex: Generating watched for ddiver_ in library Music
[INFO]: Plex: Got watched for ddiver_ in library Friends
[INFO]: Plex: Got watched for ddiver_ in library Music
[DEBUG]: Plex: Adding 8 Mile to ddiver_ watched list
smurfster commented 1 year ago

yeah sorry about that dev is stale/abandoned after some recent changes so you just have to pick one of the two dev flavors like you did. Can you do a pull and try again? I added in username/title handling in another section that was missing it.

Whats the best branch to use long term?

luigi311 commented 1 year ago

The best branch to use long term would be latest but if you are suffering from this issue you can use the dev branch. I added it back in and is tied to the alpine version if you are curious. I will probably make a few changes and then create a release so latest should have this fix soon.