Unable to claim server

I tried using Plex today for the first time in a while, but couldn’t see my media server in the web app. To try and fix the issue, I updated Plex using the offical plex apt repo, but still nothing changed. So I figured, let me restart the whole media server setup process again, and uninstalled then reinstalled Plex. I did this three times – first with the same username, then with a newly created account, then with the new account but after uninstalling with dpkg --purge and verifying the plexmediaserver folder in /var/lib was completely removed. Every time in the setup wizard, right after submitting the name for the media server, I’m given the notorious “unauthorized access” error. So now I can see the server in my settings (actually 3, but 2 are not connected since they correspond to prior uninstall-install cycles), but I can’t claim it… A bit better than not seeing the server at all!

I’m using a Debian bullseye remote server, and binding it to localhost through ssh to access the web app. Here’s the relevant part of the logs:

Mar 29, 2024 22:15:38.558 [140278875966264] DEBUG - [Req#162/ViewStateSync/HCl#9e] HTTP requesting GET https://plex.tv/api/v2/server/users/services?auth_token=xxxxxxxxxxxxxxxxxxxx
Mar 29, 2024 22:15:38.676 [140278913956664] DEBUG - [HttpClient/HCl#9e] HTTP/2.0 (0.1s) 403 response from GET https://plex.tv/api/v2/server/users/services?auth_token=xxxxxxxxxxxxxxxxxxxx
Mar 29, 2024 22:15:38.676 [140278903257912] ERROR - [Req#162/ViewStateSync] MyPlex: Error 403 requesting XML from: https://plex.tv/api/v2/server/users/services?auth_token=xxxxxxxxxxxxxxxxxxxx
Mar 29, 2024 22:15:38.676 [140278903257912] DEBUG - [Req#162/ViewStateSync] Failed to get user tokens; aborting

I took a look online and found this support post where ChuckPa, a Team Member, mentions a PKCS 12 certificate at /path/to/Plex Media Server/Cache/cert-v2.p12 that he reset. Could the issue lie there? Is this cert grabbed from some Plex database to verify the server owner, and is this for some god-forsaken reason fixed for an IP address as opposed to a Plex account / user?

Let me know if more info would be helpful, and thanks in advance for the help :).

Edit: I forgot to mention, but I followed this support article before trying the reinstallations. Didn’t work, even after clearing all browser storage. As an aside, after seeing other users getting different results on different browsers, I’ve also removed all browser storage for Plex and localhost before each time I tried the web app wizard after a fresh install.

Can you please make a tar.gz (compressed tar) file of your Logs directory under Plex Media Server and attach it here.

It will tell us what’s not working

Sure, here you are:

logs.tar.gz (92.5 KB)

Thanks for the logs.

  1. The problem in your logs shows that Plex.tv has throttled (stopped listening to) your server’s request to register. To fix this, we only need to wait. (about an hour but two hours is better).
    – Stop PMS
    – Wait

  2. Before restarting PMS, it would make sense to delete “Preferences.xml” so it can begin again as new.

  3. To register it, because it’s remote, we need to use SSH tunnel. Doing it this way, everything happens as if you’re local (the server is there in your home/flat with you)

*** On your local host: ( I presume Linux/MacOS here. Advise if windows)

  1. ssh -L 8888:127.0.0.1:32400 Address.of.remote.server
    – This will open a SSH session with an attached tunnel
    – Log into the remote host and let the entire session sit idle

  2. Start PMS

  3. Let it get started – DO NOT open a browser window yet.

  4. Install curl (sudo apt install curl)

  5. In a separate browser tab, open https://plex.tv/claim
    – It will give you a claim-xxxxx token
    – COPY that. It will be copied to your browser.
    – ( Warning. This token is valid for 5 minutes only. If you need a new one, go get it)

  6. Now go to the ssh tunnel session,

curl -X POST 'http://127.0.0.1:32400/myplex/claim?token=PASTE_THE_TOKEN_HERE'
  1. It will sit there for few seconds then respond with a stream of XML flags. These are the features your server has licensed to it.

  2. Now, in another browser window, open http://127.0.0.1:8888/web

  3. Your server should respond to you and you’ll be able to complete the setup

Okay so, I followed these steps, but they didn’t work. I am, however, getting slightly different behaviour in that the http://localhost/web page takes me to a “Not authorized” page immediately instead of the web app homepage (from where yesterday I could navigate to settings, attempt claiming, and then be redirected to the “Not authorized” page).

I suppose it’s good to mention that I stopped and started the plexmediaserver daemon with systemctl – is that correct for following your steps, or is there another way to stop and start PMS on linux? Furthermore, I started and stopped twice. The first time was through a normal, non-tunneled / binded ssh connection, and decided not to go through with accessing the server web app to do setup since I didn’t follow the instructions exactly as specified and start the server from the tunneled ssh session. Then waited a few hours, and went the full way through the instructions you posted, exactly as specified.

I’ll retry these steps with reinstallation instead of restarting (waiting until tomorrow with it uninstalled). Before I do that though, I’ve archived the new batch of logs and included them here. Let me know if you find anything, and I’ll report back here on what happens after reinstallation tomorrow!

logs.tar.gz (153.2 KB)

Ok, time to get a :hammer:

Download this.
Put it on the remote system

AS ROOT, Run it.

It will ask for the Plex Claim Token

Get one and paste it

Hit return

If everything works ok, it will claim and confirm with your username and email address

So I’m seeing from the github page PMS should be stopped, and Preferences.xml should exist. Just to confirm with you, does that mean I should first reinstall PMS, stop the service with systemctl (since installation automatically starts it), then run your script?

Yes,

Reinstall PMS

then sudo systemctl stop plexmediaserver

it will be in the stopped state and ready for you

Okay so, I tried this yesterday multiple times for both of my accounts until I couldn’t sign in to Plex anymore since there were too many requests. The behaviour from yesterday was that in the server’s web app, there was no PMS showing up in the home page or Settings/General for me to claim or have an unauthorized error message. However, the server did show up under Settings/Authorized Devices. On the global web app, the server showed up in all but the Settings/General location, and failed to connect due to an insecure connection to my server’s PMS. There was no wizard to set up the server, and instead it was by default named after my server’s distribution (Debian-Bullseye-version-#)

I tried again today, with the intention of asking how to ensure a secure connection, and now the server is showing up in the home page, but nowhere else other than authorized devices. On the home page, I get the “Not authorized” error message.

I deleted my old account yesterday, since it was annoying to deal with session cookies related to the forums, plex.tv, and my server’s web app. It led to me claiming on an unintended account multiple times. Plus I’d much prefer the server to be associated with this account from now on.

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