# Unable to claim server

**URL:** <https://forums.plex.tv/t/unable-to-claim-server/894285>\
**Category:** Plex Media Server\
**Tags:** server-linux\
**Created:** [November 2, 2024, 10:10pm UTC](https://forums.plex.tv/t/unable-to-claim-server/894285 "2024-11-02T22:10:20Z")\
**Posts on this page:** 9\
**Page:** 1

<div class="post-metadata">

**Author:** ![pawtuxet](https://avatars.discourse-cdn.com/v4/letter/p/bbce88/32.png) [@pawtuxet](https://forums.plex.tv/u/pawtuxet)\
**Post date:** [November 2, 2024, 10:10pm UTC](https://forums.plex.tv/t/unable-to-claim-server/894285/1 "2024-11-02T22:10:20Z")

</div>

Server Version#: 1.41.1.9057  
Player Version#:  
\<If providing [server logs](https://support.plex.tv/articles/200250417-plex-media-server-log-files/) please do NOT turn on verbose logging, only [debug logging](https://support.plex.tv/articles/201643703-reporting-issues-with-plex-media-server/#toc-1) should be enabled\>  
[Plex Media Server Logs\_2024-11-02\_22-35-58.zip](https://forums.plex.tv/uploads/short-url/qLW1m9n8oHoxcNwzhj1IyHOcPfd.zip) (335.0 KB)

Server: Ubuntu 24.04 VM

Hi,  
I’ve been running my Plex media server for years with no issues. However, last Sunday 27/10 I suddenly lost access. I followed a guide that instructed me to remove certain properties from Preferences.xml and reclaim the server by tunneling in so the browser would appear to be accessing from the VM itself - which worked, until today. I tried doing the same again, but unsuccessfully.  
It seems like my server is no longer able to communicate with plex.tv, but I’m not sure what has changed. Any help would be appreciated!

---

<div class="post-metadata">

**Author:** ![ChuckPa](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/chuckpa/32/79710_2.png) [@ChuckPa](https://forums.plex.tv/u/ChuckPa)\
**Post date:** [November 2, 2024, 11:18pm UTC](https://forums.plex.tv/t/unable-to-claim-server/894285/2 "2024-11-02T23:18:23Z")

</div>

From your logs,

```auto
Nov 02, 2024 22:33:46.694 [125915728194360] DEBUG - [Req#a] Plugin: setting environment variable: 'PYTHONPATH=/usr/lib/plexmediaserver/Resources/Python/python27.zip:/usr/lib/plexmediaserver/Resources/Python/lib/python2.7/site-packages'
Nov 02, 2024 22:33:46.695 [125915728194360] DEBUG - [Req#a] Spawned plug-in com.plexapp.agents.imdb with PID 3259
Nov 02, 2024 22:33:46.695 [125915728194360] DEBUG - [Req#a] [com.plexapp.agents.imdb] Sending command: GET /:/prefixes
Nov 02, 2024 22:33:46.782 [125915824663352] WARN - [HttpClient/HCl#6] HTTP error requesting GET https://plex.tv/api/v2/user/privacy?X-Plex-Token=xxxxxxxxxxxxxxxxxxxxficate or SSH remote key was not OK) (SSL: no alternative certificate subject name matches target host name 'plex.tv')

```

There appears to be corruption/damage to the local copy of your certificate.

```auto
sudo bash
systemctl stop plexmediaserver
cd "/var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Cache"
rm cert-v2.p12

```

Also make certain permissions are ok to write/save the certificate when the new one is downloaded (while still in the “Cache” directory)

```auto
sudo chown -R plex:plex .

```

I would look around to confirm permissions for `plex:plex` are correct elsewhere in the files (just to be certain)

---

<div class="post-metadata">

**Author:** ![pawtuxet](https://avatars.discourse-cdn.com/v4/letter/p/bbce88/32.png) [@pawtuxet](https://forums.plex.tv/u/pawtuxet)\
**Post date:** [November 2, 2024, 11:44pm UTC](https://forums.plex.tv/t/unable-to-claim-server/894285/3 "2024-11-02T23:44:00Z")

</div>

Thanks,  
I followed your instructions to remove the certificate, but I don’t seem to have that file at all.

 ![image](https://global.discourse-cdn.com/plex/original/4X/b/3/2/b32e2d044319798492bf7af490368cc4ba0bb23c.png)

I made sure plex:plex was set as owner for the entire Cache hierarchy (and checked that all other folders had the same owner), then tried starting the server to see if it downloaded the certificate, but it didn’t.

---

<div class="post-metadata">

**Author:** ![ChuckPa](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/chuckpa/32/79710_2.png) [@ChuckPa](https://forums.plex.tv/u/ChuckPa)\
**Post date:** [November 3, 2024, 12:49am UTC](https://forums.plex.tv/t/unable-to-claim-server/894285/4 "2024-11-03T00:49:36Z")

</div>

ok… so no cert at all?

```auto
[chuck@lizum Plex Media Server.2002]$ ls Cache/
cert-v2.p12 CloudUsersF.dat Flags.dat relayHostKey.txt va-dri-linux-x86_64/
cl-icds-linux-x86_64/ CloudUsersServices.dat OCSP/ Shaders/
CloudAccessV2.dat CloudUsersSubscriptionsV2.dat PhotoTranscoder/ Transcode/
CloudAccountV2.dat CloudUsersV2.dat Privacy.dat UpdateChannels.dat
[chuck@lizum Plex Media Server.2003]$ 

```

Stop PMS  
using the linux text editor of your choice (as root) open Preferences.xml

Look for `PlexOnlineToken=""` (Null token).

If you find it, delete it (`PlexOnineToken=""` ) and save Preferences.xml  
Restart PMS

Now try to clain it. It should be MUCH more cooperative

---

<div class="post-metadata">

**Author:** ![pawtuxet](https://avatars.discourse-cdn.com/v4/letter/p/bbce88/32.png) [@pawtuxet](https://forums.plex.tv/u/pawtuxet)\
**Post date:** [November 3, 2024, 2:03am UTC](https://forums.plex.tv/t/unable-to-claim-server/894285/5 "2024-11-03T02:03:08Z")

</div>

Sadly, it did not work. After restarting the server, it just put PlexOnlineToken=“” back into the Preferences.xml file.

Earlier, I tried using the UserCredentialReset.sh tool, but it seems to have a similar problem. The section that queries the plex.tv api for the token using curl, fails with Error: 60, which , after a bit of searching, does suggest a certificate problem on my server.

 ![image](https://global.discourse-cdn.com/plex/original/4X/6/5/8/6585d56b5f02eb28a9eeae0a9aee4e87fecb96fd.png)

I grabbed the log after trying to claim the server again, just now.  
[Plex Media Server.log](https://forums.plex.tv/uploads/short-url/cs4UzSfNB4RIIeOs2vHaW0cilIt.log) (178.0 KB)

---

<div class="post-metadata">

**Author:** ![ChuckPa](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/chuckpa/32/79710_2.png) [@ChuckPa](https://forums.plex.tv/u/ChuckPa)\
**Post date:** [November 3, 2024, 2:40am UTC](https://forums.plex.tv/t/unable-to-claim-server/894285/6 "2024-11-03T02:40:44Z")

</div>

Both UserCredentialReset.sh will report error 60 when the host has a FQDN involved.

When you type `hostname`, do you get a FQDN style name (e.g. `name.local` or a simple name?

If you get anything which resembles a FQDN, and that domain isn’t defined in PMS (which is the catch-22 when claiming/installing), it will fail.

The other thing which makes it fail is when date/time (date/time of the host) is not in sync with network time (NTP servers).

My code is a simple `curl POST`

```auto
# Get Credentials
echo "Getting new credentials from Plex.tv"
LoginInfo="$(curl -X POST -s \
                  -H "X-Plex-Client-Identifier: ${ClientId}" \
                  -H "X-Plex-Product: Plex Media Server"\
                  -H "X-Plex-Version: 1.1" \
                  -H "X-Plex-Provides: server" \
                  -H "X-Plex-Platform: Linux" \
                  -H "X-Plex-Platform-Version: $HostType $(uname -r)" \
                  -H "X-Plex-Device-Name: PlexMediaServer" \
                  -H "X-Plex-Device: $HostType" \
                  "https://plex.tv/api/claim/exchange?token=${ClaimToken}")"

# If errors, redo claim sequence
Result=$?
if [$Result -ne 0]; then
  echo "ERROR: Could not get credentials from plex.tv (Error: $Result)"
  exit 1
fi

```

There is one other way to try but you must be ssh’d / on a terminal window on the host.

1. Stop Plex
2. Edit Preferences.xml and delete the Name=“Value” pairs for:  
– PlexOnlineUsername  
– PlexOnlineMail  
– PlexOnlineToken  
– PlexOnlineHome
3. Save the file
4. Start PMS
5. Go get a claim token and copy it
6. Come back to the terminal window

```auto
curl -X POST 'http://127.0.0.1:32400/myplex/claim?token=PASTE_TOKEN_HERE'

```

then hit enter (you only have 5 minutes for the token so don’t waste time

1. After you hit Enter, there will be a delay
2. IF it works correctly, you’ll get a slew of XML ending in `</MyPlex>`

This is confirmation PMS and Plex.tv have negotiated new credentials and updated Preferences.xml

---

<div class="post-metadata">

**Author:** ![pawtuxet](https://avatars.discourse-cdn.com/v4/letter/p/bbce88/32.png) [@pawtuxet](https://forums.plex.tv/u/pawtuxet)\
**Post date:** [November 4, 2024, 12:04am UTC](https://forums.plex.tv/t/unable-to-claim-server/894285/7 "2024-11-04T00:04:41Z")

</div>

The server has a simple name:

```auto
plex@dingo-plexvm:~$ hostname
dingo-plexvm

```

Before writing my initial post, I came across a suggestion that the server time could be an issue, and this whole thing did indeed start the day after switching from daylight savings time. I found that the server was off by one hour and using the wrong timezone, so I switched it to the correct timezone and restarted. It’s now accurate to \<1 second, from what I can tell, but It didn’t seem to make any difference.

```auto
plex@dingo-plexvm:~$ timedatectl status
               Local time: Mon 2024-11-04 00:35:41 CET
           Universal time: Sun 2024-11-03 23:35:41 UTC
                 RTC time: Sun 2024-11-03 23:35:41
                Time zone: Europe/Copenhagen (CET, +0100)
System clock synchronized: yes
              NTP service: active
          RTC in local TZ: no

```

The result of the procedure:  
[Plex Media Server.log](https://forums.plex.tv/uploads/short-url/jagnSQLE7IzccDvHxg4cyJN3Mux.log) (152.9 KB)

```auto
plex@dingo-plexvm:~$ curl -X POST 'http://127.0.0.1:32400/myplex/claim?token=claim-BxdrUJZY4x8t6T9Sd-wP'
<html><head><title>Internal Server Error</title></head><body><h1>500 Internal Server Error</h1></body></html>

```

Possibly it would be easier to reinstall the entire thing and hope that fixes whatever the issue is, but I recently got hw transcoding to work, so I would like to avoid that. 🙂

---

<div class="post-metadata">

**Author:** ![pawtuxet](https://avatars.discourse-cdn.com/v4/letter/p/bbce88/32.png) [@pawtuxet](https://forums.plex.tv/u/pawtuxet)\
**Post date:** [November 5, 2024, 12:58am UTC](https://forums.plex.tv/t/unable-to-claim-server/894285/8 "2024-11-05T00:58:23Z")

</div>

I went ahead and reinstalled the server. Backed it up and started over with basically the same setup, and it now seems back to normal.  
It would’ve been nice to learn what had gone wrong, but I had eventually spent 5x the time it’d take to reinstall, trying to locate the problem. Everything we tried pointed to an issue with certificates, but nothing I tried in that regard made any difference, so I chose the easy way out.

Thanks for the assistance. 🙂

---

<div class="post-metadata">

**Author:** ![system](https://global.discourse-cdn.com/plex/original/3X/2/a/2acb9765406f63293d357b4ec509ec39aa28f2ad.png) [@system](https://forums.plex.tv/u/system)\
**Post date:** [February 3, 2025, 12:58am UTC](https://forums.plex.tv/t/unable-to-claim-server/894285/9 "2025-02-03T00:58:39Z")

</div>

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