Would it be possible to get some help with -[Req#a34/Database optimization/com.plexapp.plugins.libra

@SilverSurfer-JM

  1. You cannot sign into Synology as root.
  2. You can sudo bash or use su -s /bin/bash root once you sign in as admin or your username.

ALL

PLEASE READ THE INSTRUCTIONS

You clearly see sudo bash (this is ā€˜root’ privilege)

In light of this trend, I’m going to look at (reluctantly) start enforcing ā€˜root’ requirement on selected platforms.

2 Likes

@ChuckPa With respect I have no problem reading the instructions. You seem to assume we havent. As I told you the other day on the other thread I followed that exactly, using sudo bash to raise privilege.
This still leaves the db in an incorrectly permissioned state.

would you like me to screen record for you to show we are not being stupid?

I followed those instructions exactly!

Is there anything else I can try to fix my DB problem not optimizing? Is that tied to the root issue? Can I pull the playlists, collections, and thumbnails and start over? (would prefer not starting over without those). I don’t know what to do next.

the assumption is we cant follow the instructions. There is an underlying issue, dont try to pull anything as this wont help.

I ran the script about 4 times - using sudo bash (just to be clear Chuck). Each time same result, PMS wouldnt start. Each time I restored my backup to get things running again.

I’m sorry I’m not sounding like / being my usual jovial & supportive self. I’m still exhausted and not doing the best (health crisis 2 weeks ago). Dr says I have about 12 more weeks of this until I’m reasonably back to before it happened.

Also, I’ve been dealing with some users today who might have spent too much time in the sun?? :thinking:
-or-
I’m just being a :troll: and should go back to bed for a long nap :rofl:

As for the tool, it can only do so much when it comes to repairing the DB.
It can fix the SQLite file structure problems.
– DB is slow (fragmentation)
– DB indexes are broken (searches fail)
– DB Tables damaged (Cannot add media / create new library sections)
– DB malformed (PMS logs show malformed and refuses to start)

It can’t fix any problems with the data in the actual records.
If the PMS data in a particular row is junk, only PMS knows that. SQLite won’t know.

Currently, the tool can pull watch history from another (the old) database.

I’m trying to figure out how Playlists work so I can pull that data as well.

Maybe what’s happening here is ā€œExpectations -versus- Capabilityā€ ?
Would that make sense?

Regarding Playlists –

I did just ask.

We think ā€œWebToolsā€ (written by ukdtom / Dane22 ) can do the playlist work for you.
His tool goes deeper into the actual records of the PMS database.

@ChuckPa I am very sorry to hear that my friend and I do appreciate the explanation.
I wish you a speedy recovery.

I work in IT myself and understand the frustrations that can come from support and people not always following instructions.

As far as this goes, the script is doing the repair, vacuum etc perfectly. It gives no errors, completes succesfully. For me, the problem is it leaves the db in a permissioned state where you cannot start it from DSM. Even if you run the script under sudo bash.

100% understood! Now!!

I hope I’m not coming across as ungrateful. I am super thankful for the help you have given.

I just refreshed all the metadata on the libraries again. It is taking way longer this time. I thought i hit all of the libraries but maybe not?

I’ll let that run and try optimizing again.

yes to all of this.

I’m fixing this now.

I’m going to enforce ā€œUID = 0ā€ requirement on Synology and QNAP platforms.

The problem comes from:

  1. PMS runs as non-privileged user ā€˜PlexMediaServer’
  2. The username being used (having been given access to the PlexMediaServer shared folder) – WRITES the new file using the wrong username.
  3. It IMPORTS the new database file with the wrong UID/GID
  4. The final step, which sets ownership back to PlexMediaServer:PlexMediaServer fails. (silently – which I’ll also fix) because it doesn’t have permission to ā€˜change owner’ back to PlexMediaServer (it’s not ā€˜super user’)
  5. House of cards crashes here. :frowning:

Ref: Require root UID on selective platforms Ā· Issue #76 Ā· ChuckPa/PlexDBRepair Ā· GitHub

1 Like

you explained my issues perfectly! When you have time after all that, will this fix the problem I have or will i want to restore from a backup DB?

Thank you again!

Mike

@mdreed72

Mike,
Depending on how long it’s been, you might have viable backups available to select from.
Sometimes you don’t. (if it’s been weeks , then likely NO)

You can definitely give it a try.

Just to be 100% safe, I’d make a ZIP of the ā€œDatabasesā€ directory before you start.
(if you get in trouble, I’ll help you restore but at least we’ll still have something to go back to)

Sounds like a plan~

Do you have to issue an update or am I free to wait for this to finish refreshing metadata. See if it works.

If not, Ill backup the DB. I’ll uninstall and reinstall. Which options should i use? Completely wipe, Sign-out and abandoned the server but keep files., or the keep files for future install?

I can reinstall, put in the update to what im on now ( Version 1.32.3.7089), if option 1, i can swap in the db lib and blob matching files.

Do I repair the DB with the tool again?

I backed up before i started yesterday and then again this morning. I also have the recent backups in my hyper vault backup .

I know how to move the DB’s in login support. I haven’t tried to get the thumbnails or art before. Is that possible?

Thank you for the help!!!
Mike

Hi Chuck!

I hope you had a nice weekend!

Here is where I am - I tried PlexDBRepair 1.0.7. Plex started up afterwards! It said it was successful repairing and indexing the DB. I refreshed all the files and it didn’t work again. I get the same error code that is in the title of the original post.

I started taking out the folders one by one to see if I could get it to optimize. It always failed.

I deleted the server and started fresh! I saved all the DB’s. (I moved that whole file out before I deleted the shared folder.

I have only loaded some exercise videos and music. It optimized after adding the exercise videos. I am hopeful it will again as I add each library.

I am fine losing the thumbnails but would like to get my playlists back into PMS. I have them as either .txt or .m3u. Or, in the DB files. The DB would be best because there are some video playlists I would get back as well but those are easier to re-create.

Here are my questions - What if not all the songs on the imported playlist are not in my DB?
Is there something newer than this -?
Or, is there something in PMS that i am missing? Try searching ā€œimporting playlistsā€ into support articles here. There’s nothing there.

When you have time, I need help with that part please!

Do you have an updated Logs ZIP file for me please?
(Using old logs on a fresh install isn’t valid)

You need to be very careful about moving / tossing files around – UNLESS – you’re talking about removing sections and then later recreating them.

Please do remember, my tool works on the DB structure (physical file). Being a shell script tool, it can’t validate the data in the database records.

This old log segment:

May 30, 2023 23:23:56.082 [547919270112] DEBUG - [HttpClient/HCl#87] HTTP/1.1 (0.0s) 200 response from GET http://192.168.1.43:9080 (reused)
May 30, 2023 23:24:19.733 [547854635232] DEBUG - [Req#a34/Database optimization/com.plexapp.plugins.library.db] Database optimization: complete.
May 30, 2023 23:24:19.789 [547854635232] INFO - [Req#a34/Database optimization/com.plexapp.plugins.library.db] SQLITE3:0x7f995e7100, 17, statement aborts at 58: [select * from metadata_items limit 1] database schema has changed
May 30, 2023 23:24:19.798 [547854635232] INFO - [Req#a34/Database optimization/com.plexapp.plugins.library.db] SQLITE3:0x7f995e7100, 17, statement aborts at 58: [select * from metadata_items limit 1] database schema has changed
May 30, 2023 23:24:19.810 [547854635232] INFO - [Req#a34/Database optimization/com.plexapp.plugins.library.db] SQLITE3:0x7f995e7100, 17, statement aborts at 58: [select * from metadata_items limit 1] database schema has changed
May 30, 2023 23:24:19.821 [547854635232] INFO - [Req#a34/Database optimization/com.plexapp.plugins.library.db] SQLITE3:0x7f995e7100, 17, statement aborts at 58: [select * from metadata_items limit 1] database schema has changed
May 30, 2023 23:24:19.832 [547854635232] INFO - [Req#a34/Database optimization/com.plexapp.plugins.library.db] SQLITE3:0x7f995e7100, 17, statement aborts at 58: [select * from metadata_items limit 1] database schema has changed
May 30, 2023 23:24:19.844 [547854635232] INFO - [Req#a34/Database optimization/com.plexapp.plugins.library.db] SQLITE3:0x7f995e7100, 17, statement aborts at 58: [select * from metadata_items limit 1] database schema has changed
May 30, 2023 23:24:19.852 [547854635232] INFO - [Req#a34/Database optimization/com.plexapp.plugins.library.db] SQLITE3:0x7f995e7100, 17, statement aborts at 58: [select * from metadata_items limit 1] database schema has changed
May 30, 2023 23:24:19.859 [547854635232] INFO - [Req#a34/Database optimization/com.plexapp.plugins.library.db] SQLITE3:0x7f995e7100, 17, statement aborts at 58: [select * from metadata_items limit 1] database schema has changed
May 30, 2023 23:24:19.867 [547854635232] INFO - [Req#a34/Database optimization/com.plexapp.plugins.library.db] SQLITE3:0x7f995e7100, 17, statement aborts at 58: [select * from metadata_items limit 1] database schema has changed
May 30, 2023 23:24:19.874 [547854635232] INFO - [Req#a34/Database optimization/com.plexapp.plugins.library.db] SQLITE3:0x7f995e7100, 17, statement aborts at 58: [select * from metadata_items limit 1] database schema has changed
May 30, 2023 23:24:19.882 [547854635232] INFO - [Req#a34/Database optimization/com.plexapp.plugins.library.db] SQLITE3:0x7f995e7100, 17, statement aborts at 58: [select * from metadata_items limit 1] database schema has changed
May 30, 2023 23:24:19.889 [547854635232] INFO - [Req#a34/Database optimization/com.plexapp.plugins.library.db] SQLITE3:0x7f995e7100, 17, statement aborts at 58: [select * from metadata_items limit 1] database schema has changed
May 30, 2023 23:24:19.897 [547854635232] INFO - [Req#a34/Database optimization/com.plexapp.plugins.library.db] SQLITE3:0x7f995e7100, 17, statement aborts at 58: [select * from metadata_items limit 1] database schema has changed
May 30, 2023 23:24:19.905 [547854635232] INFO - [Req#a34/Database optimization/com.plexapp.plugins.library.db] SQLITE3:0x7f995e7100, 17, statement aborts at 58: [select * from metadata_items limit 1] database schema has changed
May 30, 2023 23:24:19.913 [547854635232] INFO - [Req#a34/Database optimization/com.plexapp.plugins.library.db] SQLITE3:0x7f995e7100, 17, statement aborts at 58: [select * from metadata_items limit 1] database schema has changed
May 30, 2023 23:24:19.920 [547854635232] INFO - [Req#a34/Database optimization/com.plexapp.plugins.library.db] SQLITE3:0x7f995e7100, 17, statement aborts at 58: [select * from metadata_items limit 1] database schema has changed
May 30, 2023 23:24:19.928 [547854635232] INFO - [Req#a34/Database optimization/com.plexapp.plugins.library.db] SQLITE3:0x7f995e7100, 17, statement aborts at 58: [select * from metadata_items limit 1] database schema has changed
May 30, 2023 23:24:19.935 [547854635232] INFO - [Req#a34/Database optimization/com.plexapp.plugins.library.db] SQLITE3:0x7f995e7100, 17, statement aborts at 58: [select * from metadata_items limit 1] database schema has changed
May 30, 2023 23:24:19.943 [547854635232] INFO - [Req#a34/Database optimization/com.plexapp.plugins.library.db] SQLITE3:0x7f995e7100, 17, statement aborts at 58: [select * from metadata_items limit 1] database schema has changed
May 30, 2023 23:24:20.191 [547854635232] DEBUG - [Req#a34/Database optimization/com.plexapp.plugins.library.db] Activity: Ended activity e81baa87-7d20-42fe-ac6d-fe27ebab7f15.
May 30, 2023 23:24:36.069 [547894714592] DEBUG - [NSB/SSDP] Parsing SSDP schema for http://192.168.1.43:9080

Is telling me that PMS was accessed too quickly after installing an update.

It’s important to remember that
– Database schema changes (which Engineering does issue from time to time)
– which show as the ā€˜Maintenance’ XML page
– Must finish without interruption (which includes not shutting down/restarting PMS)

Seeing these records:

May 30, 2023 23:23:56.082 [547919270112] DEBUG - [HttpClient/HCl#87] HTTP/1.1 (0.0s) 200 response from GET http://192.168.1.43:9080 (reused)
May 30, 2023 23:24:19.733 [547854635232] DEBUG - [Req#a34/Database optimization/com.plexapp.plugins.library.db] Database optimization: complete.
May 30, 2023 23:24:19.789 [547854635232] INFO - [Req#a34/Database optimization/com.plexapp.plugins.library.db] SQLITE3:0x7f995e7100, 17, statement aborts at 58: [select * from metadata_items limit 1] database schema has changed
May 30, 2023 23:24:19.798 [547854635232] INFO - [Req#a34/Database optimization/com.plexapp.plugins.library.db] SQLITE3:0x7f995e7100, 17, statement aborts at 58: [select * from metadata_items limit 1] database schema has changed
May 30, 2023 23:24:19.810 [547854635232] INFO - [Req#a34/Database optimization/com.plexapp.plugins.library.db] SQLITE3:0x7f995e7100, 17, statement aborts at 58: [select * from metadata_items limit 1] database schema has changed
May 30, 2023 23:24:19.821 [547854635232] INFO - [Req#a34/Database optimization/com.plexapp.plugins.library.db] SQLITE3:0x7f995e7100, 17, statement aborts at 58: [select * from metadata_items limit 1] database schema has changed
May 30, 2023 23:24:19.832 [547854635232] INFO - [Req#a34/Database optimization/com.plexapp.plugins.library.db] SQLITE3:0x7f995e7100, 17, statement aborts at 58: [select * from metadata_items limit 1] database schema has changed
May 30, 2023 23:24:19.844 [547854635232] INFO - [Req#a34/Database optimization/com.plexapp.plugins.library.db] SQLITE3:0x7f995e7100, 17, statement aborts at 58: [select * from metadata_items limit 1] database schema has changed
May 30, 2023 23:24:19.852 [547854635232] INFO - [Req#a34/Database optimization/com.plexapp.plugins.library.db] SQLITE3:0x7f995e7100, 17, statement aborts at 58: [select * from metadata_items limit 1] database schema has changed
May 30, 2023 23:24:19.859 [547854635232] INFO - [Req#a34/Database optimization/com.plexapp.plugins.library.db] SQLITE3:0x7f995e7100, 17, statement aborts at 58: [select * from metadata_items limit 1] database schema has changed
May 30, 2023 23:24:19.867 [547854635232] INFO - [Req#a34/Database optimization/com.plexapp.plugins.library.db] SQLITE3:0x7f995e7100, 17, statement aborts at 58: [select * from metadata_items limit 1] database schema has changed
May 30, 2023 23:24:19.874 [547854635232] INFO - [Req#a34/Database optimization/com.plexapp.plugins.library.db] SQLITE3:0x7f995e7100, 17, statement aborts at 58: [select * from metadata_items limit 1] database schema has changed
May 30, 2023 23:24:19.882 [547854635232] INFO - [Req#a34/Database optimization/com.plexapp.plugins.library.db] SQLITE3:0x7f995e7100, 17, statement aborts at 58: [select * from metadata_items limit 1] database schema has changed
May 30, 2023 23:24:19.889 [547854635232] INFO - [Req#a34/Database optimization/com.plexapp.plugins.library.db] SQLITE3:0x7f995e7100, 17, statement aborts at 58: [select * from metadata_items limit 1] database schema has changed
May 30, 2023 23:24:19.897 [547854635232] INFO - [Req#a34/Database optimization/com.plexapp.plugins.library.db] SQLITE3:0x7f995e7100, 17, statement aborts at 58: [select * from metadata_items limit 1] database schema has changed
May 30, 2023 23:24:19.905 [547854635232] INFO - [Req#a34/Database optimization/com.plexapp.plugins.library.db] SQLITE3:0x7f995e7100, 17, statement aborts at 58: [select * from metadata_items limit 1] database schema has changed
May 30, 2023 23:24:19.913 [547854635232] INFO - [Req#a34/Database optimization/com.plexapp.plugins.library.db] SQLITE3:0x7f995e7100, 17, statement aborts at 58: [select * from metadata_items limit 1] database schema has changed
May 30, 2023 23:24:19.920 [547854635232] INFO - [Req#a34/Database optimization/com.plexapp.plugins.library.db] SQLITE3:0x7f995e7100, 17, statement aborts at 58: [select * from metadata_items limit 1] database schema has changed
May 30, 2023 23:24:19.928 [547854635232] INFO - [Req#a34/Database optimization/com.plexapp.plugins.library.db] SQLITE3:0x7f995e7100, 17, statement aborts at 58: [select * from metadata_items limit 1] database schema has changed
May 30, 2023 23:24:19.935 [547854635232] INFO - [Req#a34/Database optimization/com.plexapp.plugins.library.db] SQLITE3:0x7f995e7100, 17, statement aborts at 58: [select * from metadata_items limit 1] database schema has changed
May 30, 2023 23:24:19.943 [547854635232] INFO - [Req#a34/Database optimization/com.plexapp.plugins.library.db] SQLITE3:0x7f995e7100, 17, statement aborts at 58: [select * from metadata_items limit 1] database schema has changed
May 30, 2023 23:24:20.191 [547854635232] DEBUG - [Req#a34/Database optimization/com.plexapp.plugins.library.db] Activity: Ended activity e81baa87-7d20-42fe-ac6d-fe27ebab7f15.
May 30, 2023 23:24:36.069 [547894714592] DEBUG - [NSB/SSDP] Parsing SSDP schema for http://192.168.1.43:9080

way down here in the log file tells me the schema upgrade was interrupted before it completed. The result was a partially upgraded database.

The Syno ARMv8 CPUs aren’t too bad but they aren’t speed demons either :slight_smile:

I am certainly aware now of things that I was not before :rofl:

When that light is off, I thought I was free to move stuff and stop the server. I will look at the console in the future.
Screenshot 2023-06-05 at 1.09.34 PM

Its slow

It says the file is too big. It’s 10Mb

Got a google drive or someplace temp?

You post, I’ll pull, you then delete