- You cannot sign into Synology as root.
- You can
sudo bashor usesu -s /bin/bash rootonce you sign in asadminor your username.
Would it be possible to get some help with -[Req#a34/Database optimization/com.plexapp.plugins.libra
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.
@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?? ![]()
-or-
Iām just being a
and should go back to bed for a long nap ![]()
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:
- PMS runs as non-privileged user āPlexMediaServerā
- The username being used (having been given access to the PlexMediaServer shared folder) ā WRITES the new file using the wrong username.
- It IMPORTS the new database file with the wrong UID/GID
- 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ā)
- House of cards crashes here.

Ref: Require root UID on selective platforms Ā· Issue #76 Ā· ChuckPa/PlexDBRepair Ā· GitHub
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
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 ![]()
I am certainly aware now of things that I was not before ![]()
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.

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
