Recovering from failed Blobs DB

Alrighty, so unfortunately it looks like it isn’t picking up what is wrong. Below is the DBRepair log:

2024-10-09 03.33.16 - ============================================================
2024-10-09 03.33.16 - Session start: Host is Docker
2024-10-09 03.33.33 - Stop    - PASS
2024-10-09 03.33.47 - Auto    - START
2024-10-09 03.35.12 - Check   - Check com.plexapp.plugins.library.db - PASS
2024-10-09 03.35.13 - Check   - Check com.plexapp.plugins.library.blobs.db - PASS
2024-10-09 03.35.13 - Check   - PASS
2024-10-09 03.37.41 - Repair  - Export databases - PASS
2024-10-09 03.40.31 - Repair  - Import - PASS
2024-10-09 03.41.44 - Repair  - Verify main database - PASS (Size: 817MB/801MB).
2024-10-09 03.41.44 - Repair  - Verify blobs database - PASS (Size: 18MB/19MB).
2024-10-09 03.41.44 - Making repaired databases active
2024-10-09 03.41.44 - Repair  - Move files - PASS
2024-10-09 03.41.44 - Repair  - PASS
2024-10-09 03.41.44 - Repair  - PASS
2024-10-09 03.41.47 - Reindex - MakeBackup com.plexapp.plugins.library.db - PASS
2024-10-09 03.41.47 - Reindex - MakeBackup com.plexapp.plugins.library.blobs.db - PASS
2024-10-09 03.41.47 - Reindex - MakeBackup - PASS
2024-10-09 03.43.16 - Reindex - Reindex: com.plexapp.plugins.library.db - PASS
2024-10-09 03.43.17 - Reindex - Reindex: com.plexapp.plugins.library.blobs.db - PASS
2024-10-09 03.43.17 - Reindex - PASS
2024-10-09 03.43.17 - Reindex - PASS
2024-10-09 03.43.17 - Auto    - COMPLETED
2024-10-09 03.43.54 - Start   - PASS
2024-10-09 03.44.06 - Exit    - Delete temp files.
2024-10-09 03.44.07 - Session end. Wed Oct  9 03:44:07 PDT 2024
2024-10-09 03.44.07 - ============================================================

Both appear to have passed however afterwards Plex did its library scan and the logs would disagree.

Plex Media Server Logs_2024-10-09_05-14-11.zip (4.4 MB)

I’m stumped!

I’m afraid it’s time to do the wipe and start again.

:frowning:

Read the below carefully.
Ask if you have questions / concerns before proceeding.

  1. Stop Plex
  2. COPY com.plexapp.plugins.library.db to someplace safe away from Plex
  3. COPY preferences.xml to someplace safe away from Plex
  4. From the command line, sudo rm -rf /var/lib/plexmediaserver/Library
  5. When complete, Start Plex
  6. Give it 2-3 minutes to complete first-time init
  7. STOP Plex
  8. COPY your saved Preferences.xml back into “Plex Media Server”
  9. CONFIRM Preferences.xml is owned by user plex:plex with 644 permissions
  10. Open your server. It will be there as before except no libraries and some settings will be missing
  11. Library section by Library section – Recreate your server

  1. When all sections completed, we will use DBRepair to import your old watch history (unless you’ve been using cloud sync)
  2. We will Optimize the DB (a full rebuild leaves for a really fragmented / slow DB)

Oh joy :frowning: a few questions before beginning:

  1. Stop plex - would this be stopping the entire docker container, or will that be running and i need to stop plex via the same way when running the DBRepair script through the console commands?
  2. Preferences.xml - That is the one located a few folders up, in the \appdata\PlexMediaServer\Library\Application Support\Plex Media Server folder location?
  3. For step 4, that will be from the UnRaid terminal console? Similar to question 1, will I need to have the Plex container running but not the services by using the stop function of the DBRepair? And if no to that, prior to entering the command line will i need to first enter docker exec -it PlexMediaServer /bin/bash (My lack of linux knowledge is showing!)
  4. I don’t know how to confirm the user owner after copying the Preferences.xml back into its location.
  5. When re-creating the libraries and pointing to their folders do the names need to match what was originally set? I intend to keep them the same but wondering how that will affect needing to re-grant shared access to my friends.
  6. I just checked and " Sync Your Watch State and Ratings" is enabled. If we skip the import using DBRepair, will that affect my friends watch history etc or is that specific to their accounts and not stored in my server? If they lose it, it is what it is, just want to be prepared for the barrage of questions during downtime and beyond.

I thiiiiiiiink that’s all the questions that come to mind currently.

  1. Stop the entire container – nothing running at all.
  2. From outside the container, go to the real file system location (wherever /config maps to) and get Preferences.xml from there
  3. Yes, from the Unraid terminal console
  4. When you ls -la <filename> you will see the owner and group of the file. When you’re in Unraid, I think it’s UID 99 or 999. Look at the other UID/GID values. It will be obvious.
  5. With the Viewstate Sync enabled, PMS will restore your viewstate info
  6. Viewstate sync is a per account setting. If they have theirs enabled then their data is guaranteed. I’m not 100% certain if their data is included with your server. It might be

I don’t appear to be having any luck with the command. I tried both upper and lowercase with no success.
image

EDIT:
I was able to get it via
image

Edit 2: After replacing the Preferences.xml with the original saved one i’m seeing “nobody users” when i should be expecting “plex users” yes?

root@Tower:~# ls -la /mnt/user/appdata/PlexMediaServer/Library/Application\ Support/Plex\ Media\ Server/Preferences.xml 
-rw------- 1 nobody users 1432 Oct 11 06:20 /mnt/user/appdata/PlexMediaServer/Library/Application\ Support/Plex\ Media\ Server/Preferences.xml

I tried chown plex Preferences.xml but only received the message
invalid user “plex”
So i don’t think i know what i’m doing :sweat_smile:

EDIT 3!
I harassed a coworker who walked me through it. Preferences loaded and are the same as before. Libraries have been re-added and are currently scanning and re-populating. Once that’s finished i will go about optimizing the DB. Will that just be done through plex via the Settings> Manage: Troubleshooting> Optimize Database or will I want to use your tool?

So after a week of fiddling, everything seems to be in working order and has repopulated. Just have a few mis matches to correct but aside from that we’re business as usual. Thank you so much for all the help @ChuckPa , you really helped me out of a bind.

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