Taxel / PlexTraktSync

A python script that syncs the movies, shows and ratings between trakt and Plex (without needing a PlexPass or Trakt VIP subscription)

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Unable to find server from Plex account

rohitsathish opened this issue · comments

Confirmation

  • I have read the README.md on the project homepage
  • I have checked if identical issue already exists
  • I have tried downgrading to find version that can be used as a workaround

The problem

plextraktsync sync errors out with a "machine actively refused connection" error. There seems to be an issue with recognizing my Plex server.

plex-login throws the following error despite logging in -
Error running plex_login command: Unable to find server from Plex account

I'm able to generate a token and my Plex login seems to work with the plex-login command but it errors out at the end.
CRITICAL Error running plex_login command: Unable to find server from Plex account

Error trace / logs

ERROR    HTTPSConnectionPool(host='192-168-1-5.6b4969914e134302be4cfe47c0c5e8cc.plex.direct', port=32400): Max retries
         exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at
         0x000001F0B8C095B0>: Failed to establish a new connection: [WinError 10060] A connection attempt failed because
         the connected party did not properly respond after a period of time, or established connection failed because
         connected host has failed to respond'))
WARNING  Trying with url: http://192-168-1-5.6b4969914e134302be4cfe47c0c5e8cc.plex.direct:32400
ERROR    HTTPConnectionPool(host='192.168.1.5', port=32400): Max retries exceeded with url: / (Caused by
         NewConnectionError('<urllib3.connection.HTTPConnection object at 0x000001F0B8C66550>: Failed to establish a new
         connection: [WinError 10060] A connection attempt failed because the connected party did not properly respond
         after a period of time, or established connection failed because connected host has failed to respond'))
ERROR    HTTPSConnectionPool(host='45-118-133-185.6b4969914e134302be4cfe47c0c5e8cc.plex.direct', port=8443): Max retries
         exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPSConnection object at
         0x000001F0B8C66EB0>: Failed to establish a new connection: [WinError 10061] No connection could be made because
         the target machine actively refused it'))
WARNING  Trying with url: http://45-118-133-185.6b4969914e134302be4cfe47c0c5e8cc.plex.direct:8443
ERROR    HTTPConnectionPool(host='45.118.133.185', port=8443): Max retries exceeded with url: / (Caused by
         NewConnectionError('<urllib3.connection.HTTPConnection object at 0x000001F0B8C7C130>: Failed to establish a new
         connection: [WinError 10061] No connection could be made because the target machine actively refused it'))
ERROR    (401) unauthorized; http://localhost:32400/ <html><head><script>window.location =
         window.location.href.match(/(^.+\/)[^\/]*$/)[1] +
         'web/index.html';</script><title>Unauthorized</title></head><body><h1>401 Unauthorized</h1></body></html>
ERROR    HTTPConnectionPool(host='192-168-1-5.6b4969914e134302be4cfe47c0c5e8cc.plex.direct', port=32400): Max retries
         exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at
         0x000001F0B8C7C280>: Failed to establish a new connection: [WinError 10060] A connection attempt failed because
         the connected party did not properly respond after a period of time, or established connection failed because
         connected host has failed to respond'))
ERROR    HTTPConnectionPool(host='45-118-133-185.6b4969914e134302be4cfe47c0c5e8cc.plex.direct', port=8443): Max retries
         exceeded with url: / (Caused by NewConnectionError('<urllib3.connection.HTTPConnection object at
         0x000001F0B8C66AC0>: Failed to establish a new connection: [WinError 10061] No connection could be made because
         the target machine actively refused it'))
ERROR    No more methods to connect. Giving up.

Expected behavior

Syncing trakt and plex.

Steps to reproduce the behavior

  1. Login to plex and trakt
  2. Run plextraktsync sync

Inspect of problematic items

No response

Workarounds

No response

Install method

pipx

Config file contents

No response

Version

0.27.2

Python Version

3.11.0

Operating System and Version

Windows 11

"Unable to find server from Plex account" is from here

it means you didn't pick a server:

  • def pick_server(account: MyPlexAccount):
    servers = account.resources()
    if not servers:
    return None
    if len(servers) == 1:
    return servers[0]
    server_name = prompt_server(servers)
    # Sanity check, even the user can't choose invalid resource
    server = account.resource(server_name)
    if server:
    return server
    return None

you didn't have any servers:

the rest of the code can't fail, because i can't see how you can pick None. did it even ask you to pick a server or gave error immediately?

as for the original error. seems some network issue. can't help here.

also. servers.default.yml is default config. it doesn't contain anything about your config. also don't post it here either. as if you post your token and URL, you granting anyone access to your server.

So couple of months back sync worked correctly and I didn't have any issues. However, recently this error with the missing server keeps popping up.

Reinstalling, downgrading or relogging in don't work either. I'm not sure how to assign the server with any of the existing commands.

Is Plex running in a container ?
Can you show your Plex Settings > Network ?

Also, you can check those pages listing all your known Plex servers :

  • https://plex.tv/api/resources.xml?X-Plex-Token=<Your_Plex_Token>
  • https://plex.tv/api/resources.xml?includeHttps=1&X-Plex-Token=<Your_Plex_Token>

and compare uri of your server to servers.yml content.

Definitely, there aren't any changes in PlexTraktSync that broke your setup. If you believe it is at fault, try downgrading to version and report it here where it is still working.

In the issue report form you have checked this checkbox:

  • I have tried downgrading to find a version that can be used as a workaround

But in
"Workarounds" you responded with "No response", so you really did not try downgrading?

Is Plex running in a container ? Can you show your Plex Settings > Network ?

Also, you can check those pages listing all your known Plex servers :

  • https://plex.tv/api/resources.xml?X-Plex-Token=<Your_Plex_Token>
  • https://plex.tv/api/resources.xml?includeHttps=1&X-Plex-Token=<Your_Plex_Token>

and compare uri of your server to servers.yml content.

This helped. As you said, the two were out of sync, so I updated the urls and token in servers.yml and was able to run sync without issues. Not sure when and how they went out of sync though. Maybe it's because my ISP keeps changing my IP address.

just plex login would had updated the urls