PMS continues to automatically stop. Using Synology DSM

Yes,

Given what we see, I’d like to try and go back to that AppData and see just how far we get. ( I am very reluctant to abandon all your existing metadata and view history if it can be avoided unless you direct otherwise )

Great, I’d like to keep that as much as possible

What should I do next?

Ok, here we go :fire:

  1. Stop PMS

  2. Rename AppDataAppData-test

  3. Rename AppData.KEEPAppData (puts things back to normal)

  4. Navigate into AppData/Plex Media Server/Cache

  5. DELETE the Certificate.p12 (or) cert-v2.p12 (you’ll have one or the other.

  6. Reinstall the PMS package

  7. Give it a few minutes to get the database in shape (that database has been sitting idle while we’ve been testing. Watch the Syno’s CPU meter to let you know when PMS is quiescent again.

Now is where it will get tricky. It should come back as the original server name and simply ‘be there’ without issue.

  1. Now we test normal access. http://LAN.IP.of.Syno:32400/web
    It should be right there as it was before.

Let me know where you stand at this point.

I took it through to step 8 but as soon as I click on music library in plex web, it crashes. And this happens instantly when accessing the music library.
If left idle, pms will run.
I’ve uploaded the log file just in case
Logs (4).zip (2.0 MB)

According to the log, it looks like you didn’t delete the WAL file, did you?

The log excerpt below should not show it recovering anything from the WAL file.

Jul 11, 2022 21:07:10.705 [0x7f233b4c7b38] INFO - Plex Media Server v1.26.2.5797-5bd057d2b - Synology DS218+ x86_64 - build: linux-x86_64 synology-dsm7 - GMT -07:00
Jul 11, 2022 21:07:10.705 [0x7f233b4c7b38] INFO - Linux version: DSM 7.1.42661-2, language: en-US
Jul 11, 2022 21:07:10.705 [0x7f233b4c7b38] INFO - Processor: 2-core Intel(R) Celeron(R) CPU J3355 @ 2.00GHz
Jul 11, 2022 21:07:10.705 [0x7f233b4c7b38] INFO - Compiler is - Clang 11.0.1 (https://plex.tv 9b997da8e5b47bdb4a9425b3a3b290be393b4b1f)
Jul 11, 2022 21:07:10.705 [0x7f233b4c7b38] INFO - /volume1/@appstore/PlexMediaServer/Plex Media Server
Jul 11, 2022 21:07:10.564 [0x7f233ebc8ad0] DEBUG - BPQ: [Idle] → [Starting]
Jul 11, 2022 21:07:10.645 [0x7f233ebc8ad0] DEBUG - FeatureManager: Using cached data for features list
Jul 11, 2022 21:07:10.678 [0x7f233ebc8ad0] DEBUG - Opening 20 database sessions to library (com.plexapp.plugins.library), SQLite 3.35.5, threadsafe=1
Jul 11, 2022 21:07:10.811 [0x7f233ebc8ad0] INFO - SQLITE3:0x80000001, 283, recovered 224 frames from WAL file /var/packages/PlexMediaServer/shares/PlexMediaServer/AppData/Plex Media Server/Plug-in Support/Databases/com.plexapp.plugins.library.db-wal
Jul 11, 2022 21:07:11.064 [0x7f233ebc8ad0] DEBUG - Running migrations. (EPG 0)

This will cause corruption to be sprayed right back into the DB causing the subsequent crash

Yes cert-v2.p12 was definitely deleted

I wasn’t asking about the p12 file.

I was asking about the WAL file which should have been deleted before copying the backup DB into primary position.

The reason we delete the WAL and SHM files is because they contain partial data which is newer than the backup is aware of.

Upon integration, they inject incomplete values or overwrite other values incorrectly.
This sets it up for almost immediate failure.

Gotcha, At what stage should the WAL file be deleted? At the same time as the p12?

Let me go through your logs again and recreate the events chain so I’m certain of the sequence for this.

I don’t want to trash your data.

thanks

Thanks for giving me the time to deep-dive your logs.

Given what I’m seeing, I think the best next step, with the certificate out of the way, is to repair the DB.

I can assist you with this offline or give you a step-by-step as to what to do.

Please let me know how you’d like to proceed.

I’m happy either way
What would you need in order to do it yourself offline?

Hi again, just checking in on what the next step is

Cheers

Sorry for the delay; very busy for me.

The procedure is:

  1. Stop PMS

  2. Open FileStation

  3. Navigate PlexMediaServer/AppData/PlexMediaServer/Plug-in Support/Databases

  4. Look at the database backups you have for com.plexapp.plugins.library.db

  5. If any of them knowingly predate the problem, that’s the one to use. If not certain, select the oldest one.

  6. COPY the database backup file you’ve selected to any other location you want.

  7. RENAME the copy to be com.plexapp.plugins.library.db

  8. COPY it back to the Databases directory and OVERWRITE the one which is there.

  9. DELETE com.plexapp.plugins.library.db-shm if it still exists (it should not)

  10. DELETE com.plexapp.plugins.library.db-wal if it sill exists (it should not)

  11. Start PMS.

  12. WAIT until the CPU is completely idle in the Syno health widget
    We’re waiting to give PMS time to update this older DB to be current with this version of PMS.

  13. When it’s idle again, Scan Files (so it can look for new/changed media files)

  14. When complete, you should have everything back as it was.

  15. Lastly, don’t forget to delete the copy of the DB you had in the other location before it causes confusion.

If this does not restore it, the database will need to be rebuilt.
We can transfer your watch history from the old DB to the new so don’t Nuke it

I’m a little confused over steps 4 thru 7

I only have one file with the name com.plexapp.plugins.library.db in PlexMediaServer/AppData/PlexMediaServer/Plug-in Support/Databases

and then copying it to another location then renaming it to it’s current name ?

attached is a screen grab of that directory

Thanks

those dates are showing the back up dates. Chuck is saying to use the most recent one that you know was working. If you do not know which one that is, then use your oldest one, i.e. the one that is 6-09-22.

1 Like

@whatisrouter

Sort the display by filename, not date. it will be easier

The -YYYY-MM-DD is the date the backup was made.

You want the “newest” backup which you know doesn’t have the problem.
If you can’t remember / discern which then choose the oldest backup you have.

:hand_with_index_finger_and_thumb_crossed: :hand_with_index_finger_and_thumb_crossed: :hand_with_index_finger_and_thumb_crossed:
I hope I’m not writing too soon but it seems to be working without a crash
I’ll give it 24 hrs and report back but in the meantime thanks so much for all your help!

Everything is working a charm
Thank you again so much
I owe you a beer

1 Like

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