This morning, my plex media was showing up for all users EXCEPT the admin. I googled THIS 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:
./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
The file is clearly corrupted if line 1 references synoshare
[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]$
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)
cd “/var/lib/plexmediaserver/Library/Application Support/Plex Media Server”
(or wherever you might have moved it)
Using your favorite Linux text editor (nano, vi, etc), Carefully remove the following Name="Value" pairs
– PlexOnlineUsername
– PlexOnlineToken
– PlexOnlineMail
– PlexOnlineHome (if it exists)
Save the file
Start PMS (it will sit there quietly and wait to be claimed in the next step)
Ah yes, I understand what you meant haha.
Yes I can SSH in. here is what I got after following those steps…
<!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>
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.
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?