DB Repair Failed

@ChuckPa i ran into an issue with the DB Repair.

Synology 920+
DSM 7.1.1-42962 Update 5
1.32.0.6918-7000

I was experiencing no symptoms but just ran the auto check as a scheduled task to make sure everything was alright. I received the following output which is indicating to me that it is not alright.

Plex Media Server Database Repair Utility (Synology (DSM 7))
Version v1.0.8

[2023-06-13 10.38.13] Stopping PMS.
[2023-06-13 10.38.18] Stopped PMS.

[2023-06-13 10.38.18] Automatic Check,Repair,Index started.
[2023-06-13 10.38.18]
[2023-06-13 10.38.18] Checking the PMS databases
Error relocating /lib/openhook.so: backtrace_symbols: symbol not found
Error relocating /lib/openhook.so: backtrace: symbol not found
Error relocating /lib/openhook.so: __syslog_chk: symbol not found
Error relocating /lib/libapparmor.so.1: __snprintf_chk: symbol not found
Error relocating /lib/libapparmor.so.1: __asprintf_chk: symbol not found
Error relocating /lib/libapparmor.so.1: __fprintf_chk: symbol not found
Error relocating /lib/libapparmor.so.1: __sprintf_chk: symbol not found
[2023-06-13 10.38.18] Check complete. PMS main database is damaged.
Error relocating /lib/openhook.so: backtrace_symbols: symbol not found
Error relocating /lib/openhook.so: backtrace: symbol not found
Error relocating /lib/openhook.so: __syslog_chk: symbol not found
Error relocating /lib/libapparmor.so.1: __snprintf_chk: symbol not found
Error relocating /lib/libapparmor.so.1: __asprintf_chk: symbol not found
Error relocating /lib/libapparmor.so.1: __fprintf_chk: symbol not found
Error relocating /lib/libapparmor.so.1: __sprintf_chk: symbol not found
[2023-06-13 10.38.18] Check complete. PMS blobs database is damaged.
[2023-06-13 10.38.18]
[2023-06-13 10.38.18] Exporting current databases using timestamp: 2023-06-13_10.38.18
[2023-06-13 10.38.18] Exporting Main DB
Error relocating /lib/openhook.so: backtrace_symbols: symbol not found
Error relocating /lib/openhook.so: backtrace: symbol not found
Error relocating /lib/openhook.so: __syslog_chk: symbol not found
Error relocating /lib/libapparmor.so.1: __snprintf_chk: symbol not found
Error relocating /lib/libapparmor.so.1: __asprintf_chk: symbol not found
Error relocating /lib/libapparmor.so.1: __fprintf_chk: symbol not found
Error relocating /lib/libapparmor.so.1: __sprintf_chk: symbol not found
[2023-06-13 10.38.18] Error 127 from Plex SQLite while exporting com.plexapp.plugins.library.db
[2023-06-13 10.38.18] Could not successfully export the main database to repair it. Please try restoring a backup.
[2023-06-13 10.38.18] Repair failed. Automatic mode cannot continue. Please repair with individual commands

[2023-06-13 10.38.18] Starting PMS.
[2023-06-13 10.38.23] Started PMS

That’s DSM being stupid. I ran into that before.

Run it from the command line not from a scheduled task.

does that mean it can’t be run as a scheduled task or that it just may or may not work depending on how stupid dsm is being that day?

Those symbols not being found is because DSM has changed the access to the runtime libraries. I’ve not been able to figure out how to manually set PATH or LD_LIBRARY_PATH

what about this error @ChuckPa ? It ran fine through terminal and said the database was ok. just curious if i should just turn off the scheduled task if it is always going to fail. Thanks.

That’s error “-1”. I’ve never seen that.

If the check is OK then the DB is good.
The error while exporting is either a structure error in the DB or a filesystem error.

Let me see what’s going on with PMS and DSM 7

Grab and share the DBRepair.log please

so when i exited the terminal session it asked if i wanted to clear temp files so i did. Obviously i did not do that when it ran through the scheduled task. Does that mean the log has been deleted? if not, where is it located?

just reran the scheduled task and found the log file attached.
DBRepair.log (3.2 KB)

Has DSM 7 updated since the previous runs?

I also get:

[2023-06-13 12.36.18] Exporting current databases using timestamp: 2023-06-13_12.36.18
[2023-06-13 12.36.18] Exporting Main DB
Error relocating /usr/lib/openhook.so: backtrace: symbol not found
Error relocating /usr/lib/openhook.so: __syslog_chk: symbol not found
Error relocating /usr/lib/openhook.so: backtrace_symbols: symbol not found
Error relocating /usr/lib/libapparmor.so.1: __sprintf_chk: symbol not found
Error relocating /usr/lib/libapparmor.so.1: __snprintf_chk: symbol not found
Error relocating /usr/lib/libapparmor.so.1: __strcpy_chk: symbol not found
Error relocating /usr/lib/libapparmor.so.1: __memset_chk: symbol not found
Error relocating /usr/lib/libapparmor.so.1: __asprintf_chk: symbol not found
Error relocating /usr/lib/libapparmor.so.1: __fprintf_chk: symbol not found
[2023-06-13 12.36.18] Error 127 from Plex SQLite while exporting com.plexapp.plugins.library.db
[2023-06-13 12.36.18] Could not successfully export the main database to repair it.  Please try restoring a backup.
[2023-06-13 12.36.18] Repair failed. Automatic mode cannot continue. Please repair with individual commands

those are all runs today. 1st was scheduled task. Then terminal. Then scheduled task. DSM was not updated in between. Today was the first time the utility was ever run on my machine.

Something changed. I’ve asked the build team if they made any changes.

i just asked what version of DSM 7 was being ran when this person successfully got the scheduled task to run.

version 7.2-64551 here. I wonder :thinking:

Which I’m now updating to -64570

Beginning to think 7.2 should not be run on this box based on their website only offering 7.2 as beta.

i just updated to update 6. ran the task and it has the same errors.

i cannot get 7.2 as its a staged roll out. Looks like you upgrade to the now removed versions that had some issues and there was some patch they made.

it weird because it doesn’t list it has beta when i pulled it up but then it had a reference to 7.2 beta.

either way, seems like dbrepair can’t be run as a scheduled task on newer releases. not a huge deal though as clearly not many people are doing it or it would have popped up sooner.

The problem is apparmour. I’m going to give Syno a call and report it.

For those following:

Ticket #3358217

may be a dumb question but what use is that ticket number? is that a synology ticket number? can we actually see it being worked somewhere?

That IS the Synology ticket number.

From the ticket:

[Symptoms]
  Plex SQLite process unable to run in Task Scheduler on DSM 7.2

[Steps to Reproduce]

  1.  Using  ChuckPa/PlexDBRepair from github (URL below)
  2.  Start script on ssh console
  3.  Stop Plex,  attempt to check databases
  4.  Observe /usr/libibapparmor.so.1  cannot be relocated due to symbol not found.  

They were very anxious about getting as much info as I could provide.
DSM 7.2 is new/ending beta and this type problem is important (especially for their Plex team – yes, they have a Plex team) – to resolve quickly before it becomes more widespread

well that other person replied and is on update 4 so it looks like update 5 and above is where it is broken.

FYI. i dont know when they fixed whatever but my scheduled task for dbrepair work now without those errors.