# Not Authorized and Preferences.xml is empty

**URL:** <https://forums.plex.tv/t/not-authorized-and-preferences-xml-is-empty/831995>\
**Category:** Plex Media Server\
**Tags:** server-linux\
**Created:** [February 22, 2023, 9:55pm UTC](https://forums.plex.tv/t/not-authorized-and-preferences-xml-is-empty/831995 "2023-02-22T21:55:37Z")\
**Posts on this page:** 16\
**Page:** 1

<div class="post-metadata">

**Author:** ![obiwansean](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/obiwansean/32/21946_2.png) [@obiwansean](https://forums.plex.tv/u/obiwansean)\
**Post date:** [February 22, 2023, 9:55pm UTC](https://forums.plex.tv/t/not-authorized-and-preferences-xml-is-empty/831995/1 "2023-02-22T21:55:37Z")

</div>

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?

---

<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:** [February 22, 2023, 10:18pm UTC](https://forums.plex.tv/t/not-authorized-and-preferences-xml-is-empty/831995/2 "2023-02-22T22:18:03Z")

</div>

@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)?

---

<div class="post-metadata">

**Author:** ![obiwansean](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/obiwansean/32/21946_2.png) [@obiwansean](https://forums.plex.tv/u/obiwansean)\
**Post date:** [February 22, 2023, 11:28pm UTC](https://forums.plex.tv/t/not-authorized-and-preferences-xml-is-empty/831995/3 "2023-02-22T23:28:29Z")

</div>

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/](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.

---

<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:** [February 23, 2023, 1:35am UTC](https://forums.plex.tv/t/not-authorized-and-preferences-xml-is-empty/831995/4 "2023-02-23T01:35:26Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![obiwansean](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/obiwansean/32/21946_2.png) [@obiwansean](https://forums.plex.tv/u/obiwansean)\
**Post date:** [February 23, 2023, 1:48am UTC](https://forums.plex.tv/t/not-authorized-and-preferences-xml-is-empty/831995/5 "2023-02-23T01:48:38Z")

</div>

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.

---

<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:** [February 23, 2023, 2:48am UTC](https://forums.plex.tv/t/not-authorized-and-preferences-xml-is-empty/831995/6 "2023-02-23T02:48:36Z")

</div>

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

```auto
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.

```auto
[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)

---

<div class="post-metadata">

**Author:** ![obiwansean](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/obiwansean/32/21946_2.png) [@obiwansean](https://forums.plex.tv/u/obiwansean)\
**Post date:** [February 23, 2023, 3:00am UTC](https://forums.plex.tv/t/not-authorized-and-preferences-xml-is-empty/831995/7 "2023-02-23T03:00:39Z")

</div>

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#

---

<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:** [February 23, 2023, 3:12am UTC](https://forums.plex.tv/t/not-authorized-and-preferences-xml-is-empty/831995/8 "2023-02-23T03:12:26Z")

</div>

That tells me a lot… Unfortunately.

one more

```auto
sudo systemctl status plexmediaserver

```

---

<div class="post-metadata">

**Author:** ![obiwansean](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/obiwansean/32/21946_2.png) [@obiwansean](https://forums.plex.tv/u/obiwansean)\
**Post date:** [February 23, 2023, 3:19am UTC](https://forums.plex.tv/t/not-authorized-and-preferences-xml-is-empty/831995/9 "2023-02-23T03:19:04Z")

</div>

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)

---

<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:** [February 23, 2023, 3:55am UTC](https://forums.plex.tv/t/not-authorized-and-preferences-xml-is-empty/831995/10 "2023-02-23T03:55:27Z")

</div>

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](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'`

```auto
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.

> **[GitHub - ChuckPa/UserCredentialReset: User Credential Reset utility for Plex](https://github.com/ChuckPa/UserCredentialReset)**
>
> User Credential Reset utility for Plex

---

<div class="post-metadata">

**Author:** ![obiwansean](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/obiwansean/32/21946_2.png) [@obiwansean](https://forums.plex.tv/u/obiwansean)\
**Post date:** [February 23, 2023, 2:19pm UTC](https://forums.plex.tv/t/not-authorized-and-preferences-xml-is-empty/831995/11 "2023-02-23T14:19:17Z")

</div>

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](http://127.0.0.1:32400/myplex/claim?token=xxxxxxxxxxxxxx)’

Unauthorized
# 401 Unauthorized
root@Plex:/home/moody#

---

<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:** [February 23, 2023, 10:51pm UTC](https://forums.plex.tv/t/not-authorized-and-preferences-xml-is-empty/831995/12 "2023-02-23T22:51:41Z")

</div>

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.

> **[GitHub - ChuckPa/UserCredentialReset: User Credential Reset utility for Plex](https://github.com/ChuckPa/UserCredentialReset)**
>
> User Credential Reset utility for Plex. Contribute to ChuckPa/UserCredentialReset development by creating an account on GitHub.

With PMS stopped.

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

```

It will now wait for you to paste in a claim token ([https://plex.tv/claim](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

---

<div class="post-metadata">

**Author:** ![obiwansean](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/obiwansean/32/21946_2.png) [@obiwansean](https://forums.plex.tv/u/obiwansean)\
**Post date:** [February 24, 2023, 12:28am UTC](https://forums.plex.tv/t/not-authorized-and-preferences-xml-is-empty/831995/13 "2023-02-24T00:28:32Z")

</div>

Perfection!! Thank you!

It took awhile for it to connect to [Plex Smart Manufacturing Platform | Plex, by Rockwell Automation](http://Plex.com/tv)…

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

---

<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:** [February 24, 2023, 12:45am UTC](https://forums.plex.tv/t/not-authorized-and-preferences-xml-is-empty/831995/14 "2023-02-24T00:45:36Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![obiwansean](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/obiwansean/32/21946_2.png) [@obiwansean](https://forums.plex.tv/u/obiwansean)\
**Post date:** [March 8, 2023, 11:52pm UTC](https://forums.plex.tv/t/not-authorized-and-preferences-xml-is-empty/831995/15 "2023-03-08T23:52:19Z")

</div>

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?

---

<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:** [June 6, 2023, 11:52pm UTC](https://forums.plex.tv/t/not-authorized-and-preferences-xml-is-empty/831995/16 "2023-06-06T23:52:38Z")

</div>

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