I can't add a second Plex server

Server Version#: Latest official Docker version
Player Version#: Not applicable

I have a server running PMS as a Docker container on top of Unraid as my primary production server. I bought a second server as a backup server to backup my storage and also run all my arrs services, among other things, configured and ready to go in case I need to take the prod server offline or something happens to it. PMS is the only app I can’t get working. Plex installs fine, but when I try to connect to it, it gives me an error telling me I don’t have permission to access that server, whether I use a Plex Claim token in the Docker config or not… If I open an InPrivate or Incognito window and try and log in, it wants a Plex Claim token and then recognizes that it is associated with my Plex account, and asks me for my PIN. If I input my PIN, I get the error that I don’t have access to it. If I create another account, use a Plex claim token and sign in as that person, it will let me log in, but not as Admin, and will only allow me to add libraries to my existing prod server. if I try and login under a different account and don’t use a claim token, I still get told I don’t have access to the server. I’ve tried installing the container with and without a Plex Claim token and it always associates any libraries I add with the prod server.

How can I add a second server? I would consider not associating it at all with my account and running it under another account, but I’m a Plex Pass user and would rather not buy a second Plex Pass account if it can be avoided. In addition, it won’t let me access the server I just installed anyways, so even another Plex Pass account won’t work. Jellyfin was no problem to have a secondary instance so it’s something with the Plex online services that seems to be causing the complexity. What is the process for establishing a second physical server with its own separate storage/media? Is there any way to get this working? They backup PMS is even on a different VLAN.

there should not be any restrictions on adding additional servers to your account from the plex side.

Are you in someone elses home?

other problems that might affect claiming is having the server on a different subnet from the browser, but the claim token in docker config should normally work.

i would review @ https://support.plex.tv/articles/203841316-plex-media-server-can-t-sign-in-to-plex-account-or-be-claimed/ and see if any of that applies or helps.

I don’t think I’m in someone else’s home, and I’ve already been through every inch of that article.

Since I tried some of the above-mentioned steps to install a second Plex server, it seems to have messed with my primary server, and now Plex is unusable as it seems to be rescanning and adding metadata for all the shows that were already in the library. It’s as if it saw the second server, decided that was the new server, flushed all the metadata, and started from scratch again, albeit it with maintaining the metadata for watched/umwatched, playlists, etc. It REALLY doesn’t like having a second Plex server around. Is there any software, paid or otherwise, that can be used to ensure a warm standby? Jellyfin would be great, and it’s what I’m using tonight since Plex is impacted by trying to install a secondary this afternoon, but I’d have to change my naming conventions, which isn’t ideal for a backup server.

For the second server, did you copy over any of the Plex Data Folder from the first server or did you start from scratch?

If you copied over the preferences.xml file, then the second server has the same MachineIdentifier and ProcessedMachineIdentifier as the first, which is a problem. Each server must have unique values for both. The server name must be unique as well.

On the second server, stop PMS, rename preferences.xml to preferences.xml.save, then start PMS. The system will create a new preferences.xml.

You’ll have to re-claim the server.

You may see a duplicate server entry in Authorized Devices. If so, delete the one that no longer exists.

Ahh, yes if OP is trying to create ‘duplicate’ or mirrored servers, that won’t work. Each server needs a different id as explained above.

You may want to keep a backup of each server preferences.xml, but keep them separate and properly labeled which goes to which server.

There was no copying of anything Plex related except for media, and since the media is 55TB, it’s not practical to download that again separately, but that shouldn’t have an impact, right?. The machine identifiers are different. I’ve pasted them below.

Studio Snippet 2024-03-27 at 08.21.43

Did you perhaps make a mistake? That’s just one set.

Thanks for the info. You don’t need to post the IDs. Just wanted to confirm they are unique.

The two servers are independent from each other. What happens with one will not affect scanning, etc. on the other.

Was going back over the thread. I missed the different VLAN the first time.

You need to be on the same subnet as the server for claiming to work.

If you are on a different subnet, Plex considers you remote and you have to use a SSH tunnel to claim the server.

See the On a Different Network section of Plex DocsInstallation

No, there are 2 there. One has a black background and the other white.

Except it definitely has. Every time I try to get the second one up & running, all the metadata on my prod PMS is flushed. It’s still scanning from yesterday afternoon.

I have client machines on all VLANs. I’ll test it by connecting from a Windows VM on the same VLAN. Good call out. I just want to let Plex finish rescanning my prod library and bring it down while I test the other so it doesn’t screw up my prod instance again. I’ll report back.

Interesting update. I started seeing errors on my prod PMS about waiting 200ms on a busy SQLlite database, so I restarted the container, and now I can’t open the prod instance and am getting the following error. Keep in mind, absolutely no configuration changes for that server has happened before or after the secondary PMS was attempted. Any idea what’s going on? I really hope I don’t have to start over again with a new PMS on my prod instance.

That is a status message, not an error message.

It usually, but not always, appears when updating to a new version of PMS which has several database changes. Plex needs time to migrate the database. The migration has to finish before starting the rest of the server.

Depending on the size of the database, the speed of the CPU, and the complexity if the database changes, it can take minutes or hours.

Do not stop PMS, reboot the system, etc. The process will simply start over. That also risks causing database corruption.

The screen will not auto-refresh.

If you did not update to a new PMS version, give it 15 minutes then refresh the web page. If still performing maintenance, let it run and check in periodically.

You can tail the Plex Media Server.log file to see if things are progressing.

You can search the same file for ERROR message that mention the database is corrupt or malformed. If you see such messages, you can stop PMS then try to repair or restore the database.

That’s helpful information, thanks. No signs of corruption thank god. Just a lot of warnings about slow queries, which is a little odd considering it set to ‘make my CPU hurt’ and I’m running 2 CPU’s with 36 cores and 256GB RAM. I guess I’ll just use Jellyfin while I let it do it’s thing.

Kinda seems like my prod PMS is stuck in a loop. It’s still scanning and seems to be stuck on one TV show and one film. It’s keeps adding films, but adding ones that have already been added. I only have ~5100 films, does this seem normal? Especially weird that this all started when I started up my backup PMS instance.

Is it just scanning the libraries, or also creating thumbnails?

You might try stopping Plex Media Server, moving that show and movie somewhere not visible to the Plex scanners, then restarting Plex Media Server.

If it still hangs up somewhere, then pull and post the server log files (debug, not verbose).

Settings → Server_Name → General + Show Advanced:

Coincidence.

It’s creating thumbnails, but I see new thumbnails added for films that I’ve already seen thumbnails added.

Also, both times I started the secondary server, it flushed the metadata on my prod PMS and started scanning from scratch. If it happened once, I’d agree with you, but both times the exact same behavior at the exact same time? I don’t think that’s very likely.

I’ll try moving the show and film and see what happens.

I stopped Plex, moved TV show and the films, and it was in maintenance mode “performing a database migration” for about 10 mins. I’m not able to actually go into the TV show, Fargo, as it just keep crapping out (see image). I’m seeing lots of the errors below for various TV shows that I’m not trying to play and wouldn’t need to be transcoded.

Mar 28, 2024 15:21:46.542 [22982886411064] ERROR - Failed to start session.
Mar 28, 2024 15:21:46.542 [22982886411064] ERROR - IntroDetector: Failed to start a transcode session: /data/tv/The Girl in the Woods {tmdb-135187}/Season 01/The Girl in the Woods - S01E01 - The Guardian.mkv

There are new shows that I’ve added today which it doesn’t pick up, even when it finishes scanning movies. I’m missing 110 films and about 150 TV shows too. Jellyfin picks these up even though the files are all in the Plex naming convention so they really should be picked up by Plex I would’ve thought,. Performance is terribly slow as it’s constantly waiting on SQLlite. It’s so bad it’s unusable… Something is just not right. I’ve attached the logs in case you or anyone else can spot anything.
Plex Media Server Logs_2024-03-28_15-57-01.zip (5.6 MB)

I believe that containers always pull any new updates when restarted.

database migrations are done at startup, to make modifications to the database tables.

this was done on the last couple betas, and they can take several minutes depending on server cpu single core/disk speed. you should be able to monitor the server cpu/disk io to see it working when it happens.

this doesn’t have anything to do with the database.

what matters during the database maintenance (and other pms operations) is how fast a single cpu is, it is single threaded, so infinite cores won’t make it faster, newer/higher ghz core will. As well has how fast storage (ssd vs hdd).

if this is an older xeon/amd cpu, you could potentially have a lot cores, that are individually slow, leading to single threaded operations (ie many db operations) being bottlenecked by the base core performance.

you can google your cpu model to find benchmarks comparisons of single core performance vs other cpus.

you can also use task manager/htop or other cpu monitoring to identify when something is maxing out single threads vs other multithreaded loads, to help identify bottlenecks.