Our forum migration to Discourse is underway and scheduled to last through June 21. During the migration, the forums will be read-only, except for a single temporary forum (contents of which will not be getting transferred). Read our announcement post for more information about the forum migration.
Hey folks, there is a new Podcast category for forums https://forums.plex.tv/categories/podcasts
If you have not already, we suggest setting your Plex username to something else rather than email which is displayed on your posts in forum. You can change the username at https://app.plex.tv/desktop#!/account
Welcome to our forums! Please take a few moments to read through our Community Guidelines (also conveniently linked in the header at the top of each page). There, you'll find guidelines on conduct, tips on getting the help you may be searching for, and more!

Bug: Error when filtering by Content Rating when movie doesn't have a rating

rcorkrcork Members, Plex Pass Posts: 498 Plex Pass

I have some movies that do not have a value in "Content Rating". In the past, i used to be able to go into my Movies library, select the Content Rating filter, and select "None" to see these movies. Not sure when this changed but today i went to filter by Content Rating and got an error that says "Unable to load options". In the logs i see this error

Mar 06, 2018 09:02:26.103 [0x700003f0c000] DEBUG - Request: [192.168.10.10:65362 (Allowed Network)] GET /library/sections/1/contentRating (12 live) TLS GZIP Signed-in Token (rcork) Mar 06, 2018 09:02:26.119 [0x700003f0c000] ERROR - Soci Exception handled: Null value fetched and no indicator defined.

This only happens on a library designated as Movies. I have another library set to "Other Videos" and all those items don't have content ratings and the filter in Plex Web shows "None" when i go to filter by Content Rating.

Best Answer

Answers

  • rcorkrcork Members, Plex Pass Posts: 498 Plex Pass

    Digging a little more into this, i can easily reproduce the issue:
    1. Edit a movie that has a content rating and delete the rating by clicking in the field, hitting backspace to delete the data and hit enter when the field is clear. The padlock item will show the field is locked. Then hit save
    2. Try to filter by Content Rating and you get "Unable to load options"
    3. Open up the same movie, edit, and deselect the padlock to unlock the field but leave it blank
    4. Now when you filter by Content Rating, it will work and you will have an option for "None".

    From this point you can lock and unlock the field and the filter will still work as expected.

  • meckhertmeckhert Members, Plex Pass Posts: 6 Plex Pass

    Having the same issue.

  • meckhertmeckhert Members, Plex Pass Posts: 6 Plex Pass
    edited March 8

    For anyone else that had this issue, I was able to fix it manually with the sqlite3 CLI. Using linux:

    1. Stop plexmediaserver, e.g. sudo systemctl stop plexmediaserver
    2. CD to database directory, e.g. cd /var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-in Support/Databases
    3. Make a backup of your database in case you mess something up: sudo cp com.plexapp.plugins.library.db com.plexapp.plugins.library.db.bak
    4. Open database in sqlite3 CLI: sudo syqlite3 com.plexapp.plugins.library.db
    5. Run a query to check to see if there are any NULL content ratings: SELECT count(*) from metadata_items WHERE content_rating IS NULL;
    6. If you got a number bigger than 0 in previous step, you can attempt to fix by running the following command: UPDATE metadata_items SET content_rating="" WHERE content_rating IS NULL;
    7. Check to see that the update worked: SELECT count(*) from metadata_items WHERE content_rating IS NULL;
    8. Quit sqlite: .quit
    9. Start plexmediaserver: sudo systemctl start plexmediaserver

    If everything worked, you should be able to go to your movie library and when you select content rating filter, it should not show you the "Unable to load options" message.

    Good luck. Oh, and Go Bruins :wink:

  • Dom CDom C Plex Employee Members, Plex Employee, Plex Pass, Plex Ninja Posts: 1,232 Plex Employee

    That doesn't sound right. I've asked our server team - what version of PMS are you on?

  • rcorkrcork Members, Plex Pass Posts: 498 Plex Pass

    @Dom C said:
    That doesn't sound right. I've asked our server team - what version of PMS are you on?

    PMS 1.12.1.4871
    PlexWeb 3.39.4

  • tylerforesthausertylerforesthauser Members, Plex Pass Posts: 2 Plex Pass
    edited April 10

    @meckhert said:
    For anyone else that had this issue, I was able to fix it manually with the sqlite3 CLI. Using linux:

    1. Stop plexmediaserver, e.g. sudo systemctl stop plexmediaserver
    2. CD to database directory, e.g. cd /var/lib/plexmediaserver/Library/Application Support/Plex Media Server/Plug-in Support/Databases
    3. Make a backup of your database in case you mess something up: sudo cp com.plexapp.plugins.library.db com.plexapp.plugins.library.db.bak
    4. Open database in sqlite3 CLI: sudo syqlite3 com.plexapp.plugins.library.db
    5. Run a query to check to see if there are any NULL content ratings: SELECT count(*) from metadata_items WHERE content_rating IS NULL;
    6. If you got a number bigger than 0 in previous step, you can attempt to fix by running the following command: UPDATE metadata_items SET content_rating="" WHERE content_rating IS NULL;
    7. Check to see that the update worked: SELECT count(*) from metadata_items WHERE content_rating IS NULL;
    8. Quit sqlite: .quit
    9. Start plexmediaserver: sudo systemctl start plexmediaserver

    If everything worked, you should be able to go to your movie library and when you select content rating filter, it should not show you the "Unable to load options" message.

    Good luck. Oh, and Go Bruins :wink:

    This is the answer I was looking for. Too bad I first refreshed all my metadata after painstakingly setting all the ratings for my 1000+ movies manually. :/ But that's my fault.

Sign In or Register to comment.