Not Authorized and Preferences.xml is empty

Server Version#: Latest
Player Version#: N/A

Sunday the server worked just fine, Monday morning it went offline. When I log into the localhost I get the not authorized error and you don’t have access to this server.

I have tried editing the Preferences.xml file but it is empty (I am very novice when it comes to Ubuntu/Linux)

Short of uninstalling and reinstalling the server software, what can I do?

@obiwansean

Uninstall won’t do anything.
Purging the whole server instance would be required – BUT, we don’t need to do that.

version “Latest” – needs to be the version (we have 3 – Alpha, Beta, and Public)

When you show Preferences.xml is zero-length there are only a few things which can cause that.

I do need to know more about what you have there to help further

  1. You’re running on Ubuntu? Which version please ?
  2. If Ubuntu, did you install Plex from the Ubuntu app store or did you follow someone’s YouTube/Reddit guide ?
  3. Has any customization of the server been done (configuration)?

I am not sure about the Version as far as Alpha, Beta or Public but It shows Version 4.100.1

  1. I am running ubuntu 20.04.5 LTS
  2. I did not install it through the app store. I followed an online guide to installing through the sudo apt-get command, I also set up an automatic repository update using the linked guide.(https://support.plex.tv/articles/235974187-enable-repository-updating-for-supported-linux-server-distributions/)
  3. I do not believe so, The only thing I have really messed with is the remote access stuff.

When I updated my password 6 months ago because of the breach. The server gave me trouble, I had to renew the token and I had installed the server through the app. This created a second server that did not have my library in it.

I also had to set up Ubuntu to connect to my NAS during the startup, because otherwise, it would never automatically mount the share.

I’ve looked at your account.

I see there are 3 servers.

  1. not seen in a few days
  2. two others not seen in a few years

One of the things I can easily help you with is

  1. Keep all the libraries / sections defined with your server
  2. Attach your server to your account.
  3. Allow you to share your server with your users again.

Does this sound like a plan?

Sounds good to me. The one not seen in a few days is the one that I am having issues with. Atleast one of the others is my original Server on my gaming computer. I dont know about the other.

Sorry for the delay.

What I’d like to do is first make certain your server itself is where I think it is:

Please type the following as root and share the console session output

1.  sudo bash
2.  cd /var/lib/plexmediaserver
3.  ls -la Application\ Support/Plex\ Media\ Server/
4.  dpkg -l | grep -i plexm

Here’s my console session and output.

[chuck@lizum ~.2039]$ sudo bash
root@lizum:/home/chuck# cd /var/lib/plexmediaserver/Library
root@lizum:/var/lib/plexmediaserver/Library# ls -la Application\ Support/Plex\ Media\ Server/
total 36
drwxr-xr-x 11 plex plex  4096 Jan 17 17:41  .
drwxr-xr-x  3 plex plex    31 Oct 18 20:05  ..
drwxr-xr-x  6 plex plex  4096 Oct 18 20:08  Cache
drwxr-xr-x  2 root root    16 Jan 17 17:42  chuck
drwxr-xr-x  3 plex plex    57 Oct 18 20:05  Codecs
drwxr-xr-x  3 plex plex    58 Oct 18 20:07 'Crash Reports'
drwxr-xr-x  3 plex plex    33 Oct 18 20:05  Drivers
-rw-------  1 plex plex    42 Oct 18 20:07  .LocalAdminToken
drwxr-xr-x  3 plex plex  4096 Oct 18 20:07  Logs
drwxr-xr-x  2 plex plex     6 Oct 18 20:05  Plug-ins
drwxr-xr-x  7 plex plex    96 Oct 18 20:07 'Plug-in Support'
-rw-------  1 plex plex   715 Oct 18 20:08  Preferences.xml
-rw-------  1 plex plex 12330 Oct 18 20:07 'Setup Plex.html'
-rw-------  1 plex plex     0 Oct 18 20:05 'Setup Plex.html.tmp.2b6e044e-3dff-49ce-a377-ba54e747bb9a'
drwxr-xr-x  2 plex plex     6 Oct 18 20:05  Updates
root@lizum:/var/lib/plexmediaserver/Library# dpkg -l | grep -i plexm
ii  plexmediaserver                            1.30.0.6486-629d58034               amd64        Plex organizes all of your personal media so you can easily access and enjoy it.
root@lizum:/var/lib/plexmediaserver/Library# 

You should have similar (except for my dates … hahah)

I got to #3 and then I ran into an error.

moody@Plex:~$ sudo bash
[sudo] password for moody:
root@Plex:/home/moody# cd /var/lib/plexmediaserver
root@Plex:/var/lib/plexmediaserver# ls -la Application\ Support/Plex\ Media\ Server/
ls: cannot access ‘Application Support/Plex Media Server/’: No such file or directory
root@Plex:/var/lib/plexmediaserver#

That tells me a lot… Unfortunately.

one more

sudo systemctl status plexmediaserver

moody@Plex:~$ sudo systemctl status plexmediaserver
[sudo] password for moody:
● plexmediaserver.service - Plex Media Server
Loaded: loaded (/lib/systemd/system/plexmediaserver.service; enabled; vend>
Active: active (running) since Wed 2023-02-22 09:49:50 MST; 10h ago
Process: 1192 ExecStartPre=/bin/sh -c /usr/bin/test -d "${PLEX_MEDIA_SERVER>
Main PID: 1202 (Plex Media Serv)
Tasks: 45 (limit: 18844)
Memory: 136.4M
CGroup: /system.slice/plexmediaserver.service
├─1202 /usr/lib/plexmediaserver/Plex Media Server
├─1686 Plex Plug-in [com.plexapp.system] /usr/lib/plexmediaserver/>
└─2055 /usr/lib/plexmediaserver/Plex Tuner Service /usr/lib/plexme>

Feb 22 09:49:50 Plex systemd[1]: Starting Plex Media Server…
Feb 22 09:49:50 Plex systemd[1]: Started Plex Media Server.
lines 1-14/14 (END)

Excellent. here we go;

  1. sudo bash ( start this session as root and keep it open

  2. systemctl stop plexmediaserver

  3. sudo chown -R plex:plex /var/lib/plexmediaserver

  4. systemctl start plexmediaserver

  5. apt -y install curl ( you probably don’t have this installed.. it’s good with Plex )

  6. Now open your browser https://plex.tv/claim

  7. COPY the claim token it gives you (it will be in the browser clipboard)

  8. Return to the BASH command line window

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

It loooks like:   (CASE and quotes are important.) 

# curl -X POST 'http://127.0.0.1:32400/myplex/claim?token=claim-xxxxxxx'

If all is well, it will sit there 20-ish seconds.

then it will respond with a whole bunch of console output which ends with the words </MyPlex>

When that happens. your server is back on your account.

IF this procedure feels too uncomfortable, the other option is:

I wrote this small tool which does the same thing when Plex is stopped.

This is what happened when I did those steps.

oody@Plex:~$ sudo bash
[sudo] password for moody:
root@Plex:/home/moody# systemctl stop plexmediaserver
root@Plex:/home/moody# sudo chown -R plex:plex /var/lib/plexmediaserver
root@Plex:/home/moody# systemctl start plexmediaserver
root@Plex:/home/moody# curl -X POST ‘http://127.0.0.1:32400/myplex/claim?token=xxxxxxxxxxxxxx

Unauthorized

401 Unauthorized

root@Plex:/home/moody#

Ok… time to get ugly.

Sorry about this, we need to get ugly with the server

Go here and download my shell script utility on your Linux machine.

With PMS stopped.

sudo bash
chmod +x  UserCredentialReset.sh
./UserCredentialReset.sh

It will now wait for you to paste in a claim token (https://plex.tv/claim)

It will then do all the work to setup Preferences.xml as it should be on the host.

After it finishes , it’ll confirm your Plex Username and email (so you know it’s valid)

Start PMS

Perfection!! Thank you!

It took awhile for it to connect to Plex Smart Manufacturing Platform | Plex, by Rockwell Automation

At least one device connects, my phone is having issue connecting but hopefully that resolves itself.

When things on the LAN have trouble ,

especially if one is wired and the other is wifi, the AP settings are pretty often the cause.

Either “AP in isolation mode” or the AP creating a different subnet than the wired LAN.

So I really appreciate all the help you gave me. It worked wonderfully for a couple of days.

I have my router set as an AP to my modem, and assigned fixed IP addresses to the server and a couple of other devices. I have never had an issue with subnets being different between devices.

Now, I can access the kids profile only on my xbox one and PS4. but nothing else. When I log into the Localhost interface I get something went wrong screen and If I go in and select my ubuntu server it shows a greyed-out globe and says you are not authorized, you do not have access to this server.

It also wants me to sign in every time I close the web browser before I never had to do that?

I have never had this much trouble with the server. Any suggestions?

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