# Error Re-claiming Server via UserCredentialReset

**URL:** <https://forums.plex.tv/t/error-re-claiming-server-via-usercredentialreset/865839>\
**Category:** Plex Media Server\
**Tags:** server-linux\
**Created:** [January 10, 2024, 2:37pm UTC](https://forums.plex.tv/t/error-re-claiming-server-via-usercredentialreset/865839 "2024-01-10T14:37:55Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![Blockguster](https://avatars.discourse-cdn.com/v4/letter/b/c5a1d2/32.png) [@Blockguster](https://forums.plex.tv/u/Blockguster)\
**Post date:** [January 10, 2024, 2:37pm UTC](https://forums.plex.tv/t/error-re-claiming-server-via-usercredentialreset/865839/1 "2024-01-10T14:37:55Z")

</div>

This morning, my plex media was showing up for all users EXCEPT the admin. I googled [THIS](https://support.plex.tv/articles/204281528-why-am-i-locked-out-of-server-settings-and-how-do-i-get-in/) solution which users had said help solve the issue.

So I shut down PMS and then (foolishly) deleted the PlexOnlineHome, PlexOnlineMail, PlexOnlineToken and PlexOnlineUsername entries from the Preferences.xml file (I’m running PMS on Ubuntu) without backup. When I fired PMS back up, went to localhost, and clicked “claim server” on my server… the wheel spins, then the “claim server” button just reappears.

I am hoping @ChuckPa 's UserCredentialReset tool can save me, but upon running the script, I get the following message:

```auto
./UserCredentialReset.sh: line 1: synoshare: command not found
awk: warning: escape sequence `\[' treated as plain `['
awk: warning: escape sequence `\]' treated as plain `]'
./UserCredentialReset.sh: line 1: getcfg: command not found
./UserCredentialReset.sh: line 1: cd: /etc/systemd/system/plexmediaserver.service.d: No such file or directory
stat: cannot statx '""': No such file or directory
stat: cannot statx '""': No such file or directory
./UserCredentialReset.sh: line 1: \,: command not found
./UserCredentialReset.sh: line 1: \,: command not found
./UserCredentialReset.sh: line 1: \,: command not found
cat: '""': No such file or directory
sed: -e expression #1, char 39: unknown option to `s'
sed: -e expression #1, char 33: unknown option to `s'
sed: -e expression #1, char 63: unknown option to `s'
./UserCredentialReset.sh: line 1: payload:allShortcutsEnabled:false: command not found

```

Anyone have any insight to re-claiming my server?

---

<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:** [January 10, 2024, 4:37pm UTC](https://forums.plex.tv/t/error-re-claiming-server-via-usercredentialreset/865839/2 "2024-01-10T16:37:12Z")

</div>

@Blockguster

Did you use a Windows text editor / a Windows computer ??

Which Linux distro and version are you using?

---

<div class="post-metadata">

**Author:** ![Blockguster](https://avatars.discourse-cdn.com/v4/letter/b/c5a1d2/32.png) [@Blockguster](https://forums.plex.tv/u/Blockguster)\
**Post date:** [January 10, 2024, 5:26pm UTC](https://forums.plex.tv/t/error-re-claiming-server-via-usercredentialreset/865839/3 "2024-01-10T17:26:04Z")

</div>

I did not. Downloaded the script direct to the server (running Ubuntu 22).

---

<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:** [January 10, 2024, 5:53pm UTC](https://forums.plex.tv/t/error-re-claiming-server-via-usercredentialreset/865839/4 "2024-01-10T17:53:35Z")

</div>

> [@Blockguster](#):
>
> `./UserCredentialReset.sh: line 1: synoshare: command not found`

The file is clearly corrupted if line 1 references `synoshare`

```auto
[chuck@lizum UserCredentialReset.2003]$ ls -la
total 24
drwxrwxr-x 3 chuck chuck 83 Jan 3 23:36 ./
drwxr-xr-x 10 chuck chuck 282 Aug 9 22:08 ../
drwxrwxr-x 7 chuck chuck 204 Jan 10 00:53 .git/
-rw-r--r-- 1 chuck chuck 974 Dec 24 2022 LICENSE.md
-rw-r--r-- 1 chuck chuck 6644 Jan 10 00:53 README.md
-rwxr-xr-x 1 chuck chuck 10786 Jan 2 21:12 UserCredentialReset.sh*
[chuck@lizum UserCredentialReset.2004]$ vi UserCredentialReset.sh 
[chuck@lizum UserCredentialReset.2005]$ sudo ./UserCredentialReset.sh 
 
          Plex Media Server user credential reset and reclaim tool (Ubuntu 20.04.6 LTS)
 
This utility will reset the server's credentials.
It will next reclaim the server for you using a Plex Claim token you provide from https://plex.tv/claim
 
ERROR: PMS is running. Please stop PMS and try again
[chuck@lizum UserCredentialReset.2006]$ 

```

Here is a tar file.  
[UserCredentialReset.tar](https://forums.plex.tv/uploads/short-url/qWIU89YUzUTCqWDKg2NGZF0iTFN.tar) (20 KB)

---

<div class="post-metadata">

**Author:** ![Blockguster](https://avatars.discourse-cdn.com/v4/letter/b/c5a1d2/32.png) [@Blockguster](https://forums.plex.tv/u/Blockguster)\
**Post date:** [January 10, 2024, 7:50pm UTC](https://forums.plex.tv/t/error-re-claiming-server-via-usercredentialreset/865839/5 "2024-01-10T19:50:31Z")

</div>

Thank you. Sure enough, the tar file version worked.  
However, when running the script, I get the following:

```auto
ERROR: Could not get credentials from plex.tv (Error: 60)

```

---

<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:** [January 10, 2024, 7:57pm UTC](https://forums.plex.tv/t/error-re-claiming-server-via-usercredentialreset/865839/6 "2024-01-10T19:57:21Z")

</div>

Ah, you have your own certificate -OR- date/time is out of sync with the internet time daemons.

In most cases, it’s because the clock is out of sync.

Out-of-sync clock will stop everything (SSL won’t lock up)

---

<div class="post-metadata">

**Author:** ![Blockguster](https://avatars.discourse-cdn.com/v4/letter/b/c5a1d2/32.png) [@Blockguster](https://forums.plex.tv/u/Blockguster)\
**Post date:** [January 10, 2024, 8:19pm UTC](https://forums.plex.tv/t/error-re-claiming-server-via-usercredentialreset/865839/7 "2024-01-10T20:19:13Z")

</div>

I do have an SSL certificate on the server…  
and my server’s clock appears to be correct (although set to UTC… it is located in EST/EDT)

So is it the SSL that’s causing an issue?

---

<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:** [January 10, 2024, 8:32pm UTC](https://forums.plex.tv/t/error-re-claiming-server-via-usercredentialreset/865839/8 "2024-01-10T20:32:21Z")

</div>

Curl error 60

> cURL error 60 usually means that **there is a problem with the configuration of the SSL on the server you are trying to connect to**. One issue that might be occurring is that the host name used in the request does not match any host name shown on the SSL.

Your host is probably a FQDN and Plex.tv doesn’t have your cert  
(Only PMS locally will but it’s not active right now)

This host is remote?

If remote, and you have SSH access to it, we’ll go to the direct CURL level and let PMS negotiate on its own. (let me know please)

---

<div class="post-metadata">

**Author:** ![Blockguster](https://avatars.discourse-cdn.com/v4/letter/b/c5a1d2/32.png) [@Blockguster](https://forums.plex.tv/u/Blockguster)\
**Post date:** [January 10, 2024, 8:43pm UTC](https://forums.plex.tv/t/error-re-claiming-server-via-usercredentialreset/865839/9 "2024-01-10T20:43:42Z")

</div>

> [@ChuckPa](#):
>
> FQDN

The domain is hosted by GoDaddy. I assume that’s what you are looking for?  
The SSL is issued by NameCheap

---

<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:** [January 10, 2024, 8:44pm UTC](https://forums.plex.tv/t/error-re-claiming-server-via-usercredentialreset/865839/10 "2024-01-10T20:44:01Z")

</div>

Do you have SSH access ?

---

<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:** [January 10, 2024, 8:49pm UTC](https://forums.plex.tv/t/error-re-claiming-server-via-usercredentialreset/865839/11 "2024-01-10T20:49:24Z")

</div>

Assuming you do –

1. SSH to the host

2. sudo bash (get root)

3. cd “/var/lib/plexmediaserver/Library/Application Support/Plex Media Server”  
(or wherever you might have moved it)

4. Using your favorite Linux text editor (nano, vi, etc), Carefully remove the following  
`Name="Value"` pairs  
– PlexOnlineUsername  
– PlexOnlineToken  
– PlexOnlineMail  
– PlexOnlineHome (if it exists)

5. Save the file

6. Start PMS (it will sit there quietly and wait to be claimed in the next step)

7. Open a browser tab to [https://plex.tv/claim](https://plex.tv/claim) and COPY the token it gives you

8. Return to the SSH session.

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

```

1. Hit enter and wait a bit.

2. It will respond with a flurry of XML in about 20-30 seconds.

This confirms the server is reclaimed to you.

NOTE: I will see what I can do with my script to work with FQDN hostnames.

---

<div class="post-metadata">

**Author:** ![Blockguster](https://avatars.discourse-cdn.com/v4/letter/b/c5a1d2/32.png) [@Blockguster](https://forums.plex.tv/u/Blockguster)\
**Post date:** [January 10, 2024, 9:10pm UTC](https://forums.plex.tv/t/error-re-claiming-server-via-usercredentialreset/865839/12 "2024-01-10T21:10:56Z")

</div>

> [@ChuckPa](#):
>
> `curl -X POST 'http://127.0.0.1/myplex/claim?token=PASTE_TOKEN_HERE'`

Ah yes, I understand what you meant haha.  
Yes I can SSH in. here is what I got after following those steps…

```auto
<!DOCTYPE HTML PUBLIC "-//IETF//DTD HTML 2.0//EN">
<html><head>
<title>302 Found</title>
</head><body>
<h1>Found</h1>
<p>The document has moved <a href="https:// **my domain** /myplex/claim?token=claim-ELBT2Ez2dF1aPUJ4oAyi">here</a>.</p>
<hr>
<address>Apache/2.4.52 (Ubuntu) Server at 127.0.0.1 Port 80</address>
</body></html>

```

---

<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:** [January 10, 2024, 9:26pm UTC](https://forums.plex.tv/t/error-re-claiming-server-via-usercredentialreset/865839/13 "2024-01-10T21:26:05Z")

</div>

MY mistake! 🤦‍♂️

the correct url `http://127.0.0.1:32400/myplex/claim?token=PASTE_TOKEN_HERE`

I forgot the port. It went to your apache server instead.

I am very sorry

Please get a fresh claim token and hit the endpoint again.

---

<div class="post-metadata">

**Author:** ![Blockguster](https://avatars.discourse-cdn.com/v4/letter/b/c5a1d2/32.png) [@Blockguster](https://forums.plex.tv/u/Blockguster)\
**Post date:** [January 10, 2024, 9:31pm UTC](https://forums.plex.tv/t/error-re-claiming-server-via-usercredentialreset/865839/14 "2024-01-10T21:31:27Z")

</div>

No worries. Refreshed token, added port and still no dice…

```auto
<html><head><title>Internal Server Error</title></head><body><h1>500 Internal Server Error</h1></body></html>

```

---

<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:** [January 10, 2024, 9:36pm UTC](https://forums.plex.tv/t/error-re-claiming-server-via-usercredentialreset/865839/15 "2024-01-10T21:36:52Z")

</div>

When that happens either:  
a) PMS locked itself down (needs prefs cleaned again)  
b) token expired  
c) token didn’t make it into the -X POST ‘http://…’ (escaped or quoted for the ‘?’)

It wouldn’t hurt to shut it down , make sure it’s clean and redo it again EXCEPT for my gaff on the port number

FQDN’s are fussy. When you have stuff playing with the sockets, I know plex.tv doesn’t like anything interfering with its cert (which is why PMS barks so much)

NOTE: I’m looking at the FQDN problem. I have an idea about having CURL temporarily add your cert for the plex.tv interaction.

I don’t know yet.

Worst case, We take the hostname out of the domain and then claim.

---

<div class="post-metadata">

**Author:** ![Blockguster](https://avatars.discourse-cdn.com/v4/letter/b/c5a1d2/32.png) [@Blockguster](https://forums.plex.tv/u/Blockguster)\
**Post date:** [January 10, 2024, 9:52pm UTC](https://forums.plex.tv/t/error-re-claiming-server-via-usercredentialreset/865839/16 "2024-01-10T21:52:24Z")

</div>

Thanks again for taking the time to help.

I shut down PMS, wiped the necessary key-value pairs, saved, fired up PMS and ran the CURL (with port) with fresh token correctly inserted into the url (no escape or quote for the ?)… It thought about it for 5-10 seconds then shot out the same 500 Internal Server Error message.

Just to be clear, I am supposed to remove not only the value from the .xml but also the key itself, correct?

---

<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:** [January 10, 2024, 9:56pm UTC](https://forums.plex.tv/t/error-re-claiming-server-via-usercredentialreset/865839/17 "2024-01-10T21:56:16Z")

</div>

Yes, you are supposed to remove the `Name="Value"` entire preference pair.

If you had `PlexOnlineToken=""`, you would get an error every time.

I put quotes around the whole URL so I don’t have to escape the `?`

curl -X POST ‘[http://127.0.0.1:32400/myplex/claim?token=PASTE\_TOKEN\_HERE](http://127.0.0.1:32400/myplex/claim?token=PASTE_TOKEN_HERE)’

This protects the entire URL as it goes into curl otherwise the filesystem will try to glob for a filename match (which will fail)

---

<div class="post-metadata">

**Author:** ![Blockguster](https://avatars.discourse-cdn.com/v4/letter/b/c5a1d2/32.png) [@Blockguster](https://forums.plex.tv/u/Blockguster)\
**Post date:** [January 10, 2024, 10:04pm UTC](https://forums.plex.tv/t/error-re-claiming-server-via-usercredentialreset/865839/18 "2024-01-10T22:04:39Z")

</div>

> [@ChuckPa](#):
>
> curl -X POST ‘[http://127.0.0.1:32400/myplex/claim?token=PASTE\_TOKEN\_HERE’](http://127.0.0.1:32400/myplex/claim?token=PASTE_TOKEN_HERE%E2%80%99)

Ok, in that case, I believe I’ve followed your directions to a T. Still getting the 500 error

---

<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:** [January 10, 2024, 10:06pm UTC](https://forums.plex.tv/t/error-re-claiming-server-via-usercredentialreset/865839/19 "2024-01-10T22:06:45Z")

</div>

OK… BFH time…

1. Stop plex
2. Rename Preferences.xml → Preferences.xml-SAVED
3. Get new token (make sure it’s different… they do last for 5 minutes)
4. Start up
5. Give it a second (5-10)
6. Now hit the CURL endpoint

This will create a new server instance BUT it will confirm if it’s the surrounding SSL / FQDN work interfering or not.

We’re looking for it to successfully claim. We’ll deal with the aftermath after claiming.

(did you add your extras before of after PMS was up and running ?)

---

<div class="post-metadata">

**Author:** ![Blockguster](https://avatars.discourse-cdn.com/v4/letter/b/c5a1d2/32.png) [@Blockguster](https://forums.plex.tv/u/Blockguster)\
**Post date:** [January 10, 2024, 10:13pm UTC](https://forums.plex.tv/t/error-re-claiming-server-via-usercredentialreset/865839/20 "2024-01-10T22:13:51Z")

</div>

Alright, followed that with brand spanking new token and still getting the 500. Must be the SSL/FQDN.

Not sure I understand your last question though. Which extras?

[Next page](https://forums.plex.tv/t/error-re-claiming-server-via-usercredentialreset/865839.md?page=2)
