Problem Adding a Library

Server Version#: 1.31.0.6654
Player Version#:
I just installed Plex on my Synology NAS and I am wanting to setup a new library for my movies. Under SynologyNAS libraries I click on Add Library, then Movies as my library type, then click Browse for Media Folder, then select the folder where my Movies are located on the NAS, then click Add, and then when I click Add Library it says that my changes could not be saved and does not add my library.

1 Like

DSM version?

Common cases here:

  1. DNS / network gateway is incorrect (two adapters with both plugged in and PMS using the wrong one)

  2. Something broke permissions in the Plex / PlexMediaServer shared folder

It’s going to be a simple error. Don’t overthink it.

I’m here to add a “me too” to mawaw’s post: it isn’t just him/her.

I’ve used Plex more or less successfully for many years and, for whatever reason, problems have accumulated through the years. (Most notably, media images stopped loading correctly for a while, and when a subsequent PMS came out that fixed the problem, it didn’t fix the broken images. New media I’ve added has been more or less fine since then. q.v. https://www.reddit.com/r/PleX/comments/nt482w/plex_downloading_metadata_correctly_but/)

I decided to uninstall PMS, wipe the Plex directory on my Synology server, and start over from scratch. Drastic, yes, but I was hoping it would straighten things out moving forward.

Like mawaw, when I tried to create a library in PMS 1.31.0.6654 by adding one or more movie folders, I got the same “changes could not be saved” message that he/she did. Obviously nothing had changed with my media files or their permissions from when Plex had accessed them two hours previously.

Since 1.31.0 was not working, I uninstalled it, deleted the Plex directory, and installed the latest “Synology approved” version of the PMS, 1.18.5.2309. That version happily allowed me to create movie libraries. After creating a library, I upgraded to 1.31.0. The library was still there, but the language had switched from English to [null]. If I then tried to add a folder to that library, I again got “changes could not be saved.”

I was nevertheless able to add a new movie library in 1.31.0, but that library, when I reenter it now, also has [null] as its language.

I refreshed the page after some sort of server error, and was offered: “Upgrade your Movie and TV libraries to the new approved metadata agents today!” I asked for the upgrade and got a red rectangle saying “There was a problem updating the library.” (This all happened yesterday, and I just redid all the steps now to confirm it shows the same behavior consistently. Yesterday I installed two movie libraries and today just one, but that made no difference, as you’d expect.)

I know it’s a big ask, but it seems like you (the collective you, employees of Plex) should occasionally try installing the latest version of PMS from scratch to make sure it works, because it sure isn’t working for me. Assuming that my and mawaw’s experiences are not unique, it’ll be hard to get new customers if this is their first experience with Plex. Personally, I thought a fresh install was almost certain to work, for precisely that reason.

1 Like

@rjyanco and @mawaw

Please do the following

  1. Stop Plex

  2. Open FileStation

  3. Navigate to PlexMediaServer/AppData/Plex Media Server

  4. In there, you will find a “Logs” folder

  5. Right-click “Logs” and then → “Compress to Logs.zip”

  6. When it finishes, Download the ZIP to your computer

  7. upload (Attach) the ZIP file with your next reply

@ChuckPa I noticed the same thing when our automated PlexAPI tests broke today with PMS 1.31.0.6654-02189b09f.

https://github.com/pkkid/python-plexapi/actions/runs/4176590460/jobs/7233157380#step:11:54

Specifically, the POST /library/sections API command is returning a status code 400 Bad Request.

When trying to add a library, the error in the Plex Media Server logs is “‘agent’ is missing or invalid, ‘language’ is invalid, new scanner needs to be paired with new agent”.

Plex Media Server Logs_2023-02-14_21-20-39.zip (114.0 KB)

Feb 14, 2023 21:20:33.136 [0x7fc07d9b2b38] INFO - Request: [192.168.0.199:29027 (Allowed Network (Subnet))] POST /library/sections?name=Movies&type=movie&agent=tv.plex.agents.movie&scanner=Plex%20Movie&language=en-US&importFromiTunes=&enableAutoPhotoTags=&location=%2Fvideos%2FTest%20Videos (6 live) #1c5 GZIP
Feb 14, 2023 21:20:33.137 [0x7fc07d9b2b38] ERROR - [Req#1c5] Library: Couldn't create section: 'agent' is missing or invalid
Feb 14, 2023 21:20:33.137 [0x7fc07d9b2b38] ERROR - [Req#1c5] Library: Couldn't create section: 'language' is invalid
Feb 14, 2023 21:20:33.137 [0x7fc07d9b2b38] ERROR - [Req#1c5] Library: Couldn't create section: new scanner needs to be paired with new agent
Feb 14, 2023 21:20:33.138 [0x7fc07f4ffb38] INFO - Completed: [192.168.0.199:29027] 400 POST /library/sections?name=Movies&type=movie&agent=tv.plex.agents.movie&scanner=Plex%20Movie&language=en-US&importFromiTunes=&enableAutoPhotoTags=&location=%2Fvideos%2FTest%20Videos (6 live) GZIP 1ms 492 bytes (pipelined: 3)

However, you can see the parameters are included, and correct, in the request screenshot below.

From a bunch of my own testing today, this only happens with a completely new unclaimed server on PMS 1.31.0.6654-02189b09f without any previous app data. Claiming the server with a PLEX_CLAIM token does not produce this error. Also, a simple restart of PMS “fixes” it and allows you to create a library.

Steps to reproduce:

  1. Create a new unclaimed Docker container.
version: "3"
services:
  plex:
    image: plexinc/pms-docker
    container_name: plex
    network_mode: host
    environment:
      - ALLOWED_NETWORKS=192.168.0.1/24  # to allow access to settings of an unclaimed server
    volumes:
      - /mnt/videos:/videos
  1. Access your server’s local web app settings page (to skip the setup wizard).
http://IP-ADDRESS:32400/web/index.html#!/settings
  1. Go to Manage > Libraries > Add library.
  2. Create a new movies library with the default Plex Movie agent.
  3. Status code 400 Bad Request is returned and the UI shows “Your changes could not be saved”.
  4. Restart (not recreate) the Docker container.
docker restart plex
  1. Repeat steps 2-4, an you will be able to create a library.

I also tested the above with PMS 1.30.2.6563-3d4dc0cce and did not encounter any issues creating a library with a new Docker container.

Wanted to chime in here and say that I get the same “agent” and “language” errors when trying to save any changes to any existing library on a Windows installation. May be related? My logs are in this thread.

Interesting find. I’ll look into this.

Also, a simple restart of PMS “fixes” it and allows you to create a library.

Is this for the case above of a new unclaimed server? If so, I’m thinking this might be a case of the plugins not being initialized proper on server creation.

If a restart of an existing server fixes this issue, that typically points to a busy/stuck database.

Yes, I just restart the new unclaimed docker container and it is able to create a library.

Note: This isn’t unique to Docker. It’s just the easiest way to spin up new instances. For example, it happens on Windows as well: New Install on Windows 10, Trying to add Libraries says "changes could not be saved" : PleX

Thanks, will definitely look into this.

Hi, I am facing the same issue on Synology DSM. I have tried reinstalling plex serveral times and restarted Plex and my NAS many times. But, no good.
I claimed my server the first time around and got the error. I have tried without claiming the server but no luck.
I have downloaded and installed Plex via Package Manager.

This has happened when trying to install Plex after NAS reset.

It worked after a restart. Thanks.

Sorry, couldn’t get to this until the weekend. I know there’s was a new version of the PMS released between my previous message and this one. The same “changes could not be saved” behavior is happening with this new version. But I tried stopping PMS and restarting it, and, as mentioned by someone else, now I can add a library. So I think I’m great moving forward, but you should probably figure out what’s going on.

Logs attached, in hopes that they can help.
Logs.zip (136.4 KB)

Thanks, everyone, for the assistance! I really appreciate it.

Also related, the following also fails in the same way:

  1. Changing the language on an existing library (Edit library > General > Language), or
  2. Creating a new library but selecting a different language from the default.

Again, restarting Plex Media Server allows both actions to work.

I’m not able to reproduce these scenarios. For 1, when does this happen? Since it’s an existing library, it can’t be on initial install. Or do you see this on an initial update too? I was only able to see the initial issue on a new install, not an update.

These two are more difficult to reproduce because I don’t know what actions puts the library in that broken state. I have since restarted Plex Media Server so it is working for now.

For both of the new scenarios, it was on a server (PMS Version 1.31.1.6733) that has existing libraries created and has been running for days. I noticed the error when I tried to change my library language for this post here:

Ok thanks. We are looking and hopefully it’s the same cause. Current guess is a race condition somewhere.

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