Plex Server Token Max retries exceeded

Server Version#: 1.41.0.8994-1
Player Version#: Irrelevant

Hello,

I have Plex Media Server installed on a headless Archlinux server at home. As I use the server solely for Plex, I have installed a script called Autosuspend that checks the server activity to either keep it running if anyone is watching a movie or show, and power it off when not.

The script check the plex activity by checking the url:

http://127.0.0.1:32400/status/sessions?X-Plex-Token=CurrentTokenHere

However, I am not getting the following error when the script is checking the activity:

Oct 14 14:38:55 server autosuspend[430]: autosuspend.checks.TemporaryCheckError: HTTPConnectionPool(host=‘127.0.0.1’, port=32400): Max retries exceeded with url: /status/sessions?X-Plex-Token=CurrentTokenHere (Caused by NewConnectionError(‘<urllib3.connection.HTTPConnection object at 0x745b0e87b860>: Failed to establish a new connection: [Errno 111] Connection refused’))

I have changed my password (as per a topic found on this forum) but the token remained the same (even after restart Plex) and I am still getting the error.

How can I refresh the token or change the setting for the token to remain valid - My server is not available to outside of my network for security reasons.

You’ll likely need to sign out of your server (then sign back in/reclaim it) to get a new token. Just changing the password is not enough.

https://support.plex.tv/articles/204059436-finding-an-authentication-token-x-plex-token/#toc-2

Thank you for your reply, much appreciated.

I did as follow, update password (again) with the box ticked “Sign out connected devices after password change”.

Unfortunately, I am still getting the same error.

How often are you calling that endpoint? Perhaps letting it settle for a bit (give it a few hours) and then trying again may yield better results. And maybe throttle access (don’t immediately retry repeatedly on failure, provide a cool down timer)?

As far as I know, Plex doesn’t officially document these APIs. So you may have to reverse engineer the timings.

Autosuspend run the checks every five minutes when the machine is on.

It has never been an issue for the past three years. Something must have changed recently for it to become an issue?

One way of forcing this :

  1. Change the password and sign out all devices (which signs the server out)
  2. Stop PMS.
  3. On the server host, with PMS now stopped, run this. (It’ll go to Plex.tv, get new credentials and sync the local server with Plex.tv)

I’ve been thinking and researching a bit on this.

If you get a 429 or 1003 return from curl, you need to back off the endpoint.

429 is a “hard throttle”. You’ll need at least an hour for it to unlock again.
1003 can also cover (unfortunately) a couple conditions relating to authentication. The worst one is ‘stuck certificate’ – which is when you need us to reset it.

Caution is advised with the endpoints. There are a lot of users hitting those endpoints and Plex.tv is very sensitive to DDOS attacks. It will shut you down in a hurry.

Thank you for looking into it.

Is there a better way to then check for the service status, i.e. to know whether a file is playing without causing the issue?

I don’t know the actual code / endpoint but the package Tautulli (JonnyWong16 - Github - Python based) has the details.

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.