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:
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.
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.
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.