# DB Repair Failed

**URL:** <https://forums.plex.tv/t/db-repair-failed/844331>\
**Category:** Apps & Creations\
**Tags:** server-synology\
**Created:** [June 13, 2023, 2:45pm UTC](https://forums.plex.tv/t/db-repair-failed/844331 "2023-06-13T14:45:28Z")\
**Posts on this page:** 20\
**Page:** 1

<div class="post-metadata">

**Author:** ![djfriday13](https://avatars.discourse-cdn.com/v4/letter/d/f0a364/32.png) [@djfriday13](https://forums.plex.tv/u/djfriday13)\
**Post date:** [June 13, 2023, 2:45pm UTC](https://forums.plex.tv/t/db-repair-failed/844331/1 "2023-06-13T14:45:28Z")

</div>

@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

---

<div class="post-metadata">

**Author:** ![ChuckPa](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/chuckpa/32/79710_2.png) [@ChuckPa](https://forums.plex.tv/u/ChuckPa)\
**Post date:** [June 13, 2023, 3:13pm UTC](https://forums.plex.tv/t/db-repair-failed/844331/2 "2023-06-13T15:13:56Z")

</div>

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

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

---

<div class="post-metadata">

**Author:** ![djfriday13](https://avatars.discourse-cdn.com/v4/letter/d/f0a364/32.png) [@djfriday13](https://forums.plex.tv/u/djfriday13)\
**Post date:** [June 13, 2023, 3:16pm UTC](https://forums.plex.tv/t/db-repair-failed/844331/3 "2023-06-13T15:16:45Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![ChuckPa](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/chuckpa/32/79710_2.png) [@ChuckPa](https://forums.plex.tv/u/ChuckPa)\
**Post date:** [June 13, 2023, 3:26pm UTC](https://forums.plex.tv/t/db-repair-failed/844331/4 "2023-06-13T15:26:24Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![djfriday13](https://avatars.discourse-cdn.com/v4/letter/d/f0a364/32.png) [@djfriday13](https://forums.plex.tv/u/djfriday13)\
**Post date:** [June 13, 2023, 3:35pm UTC](https://forums.plex.tv/t/db-repair-failed/844331/5 "2023-06-13T15:35:47Z")

</div>

> [@djfriday13](#):
>
> [2023-06-13 10.38.18] Error 127 from Plex SQLite while exporting com.plexapp.plugins.library.db

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.

---

<div class="post-metadata">

**Author:** ![ChuckPa](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/chuckpa/32/79710_2.png) [@ChuckPa](https://forums.plex.tv/u/ChuckPa)\
**Post date:** [June 13, 2023, 4:10pm UTC](https://forums.plex.tv/t/db-repair-failed/844331/6 "2023-06-13T16:10:16Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![djfriday13](https://avatars.discourse-cdn.com/v4/letter/d/f0a364/32.png) [@djfriday13](https://forums.plex.tv/u/djfriday13)\
**Post date:** [June 13, 2023, 4:21pm UTC](https://forums.plex.tv/t/db-repair-failed/844331/7 "2023-06-13T16:21:21Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![djfriday13](https://avatars.discourse-cdn.com/v4/letter/d/f0a364/32.png) [@djfriday13](https://forums.plex.tv/u/djfriday13)\
**Post date:** [June 13, 2023, 4:24pm UTC](https://forums.plex.tv/t/db-repair-failed/844331/8 "2023-06-13T16:24:44Z")

</div>

just reran the scheduled task and found the log file attached.  
[DBRepair.log](https://forums.plex.tv/uploads/short-url/neSjcftibecYYEyK26oqKbCpnMO.log) (3.2 KB)

---

<div class="post-metadata">

**Author:** ![ChuckPa](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/chuckpa/32/79710_2.png) [@ChuckPa](https://forums.plex.tv/u/ChuckPa)\
**Post date:** [June 13, 2023, 4:38pm UTC](https://forums.plex.tv/t/db-repair-failed/844331/9 "2023-06-13T16:38:04Z")

</div>

Has DSM 7 updated since the previous runs?

I also get:

```auto
[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

```

---

<div class="post-metadata">

**Author:** ![djfriday13](https://avatars.discourse-cdn.com/v4/letter/d/f0a364/32.png) [@djfriday13](https://forums.plex.tv/u/djfriday13)\
**Post date:** [June 13, 2023, 4:39pm UTC](https://forums.plex.tv/t/db-repair-failed/844331/10 "2023-06-13T16:39:53Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![ChuckPa](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/chuckpa/32/79710_2.png) [@ChuckPa](https://forums.plex.tv/u/ChuckPa)\
**Post date:** [June 13, 2023, 4:43pm UTC](https://forums.plex.tv/t/db-repair-failed/844331/11 "2023-06-13T16:43:35Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![djfriday13](https://avatars.discourse-cdn.com/v4/letter/d/f0a364/32.png) [@djfriday13](https://forums.plex.tv/u/djfriday13)\
**Post date:** [June 13, 2023, 4:46pm UTC](https://forums.plex.tv/t/db-repair-failed/844331/12 "2023-06-13T16:46:16Z")

</div>

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

> [@Plex DB repair tool not able to run on DSM 7](https://forums.plex.tv/t/plex-db-repair-tool-not-able-to-run-on-dsm-7/844228/39):
>
> what dsm version are you using where the scheduled task ran correctly?

---

<div class="post-metadata">

**Author:** ![ChuckPa](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/chuckpa/32/79710_2.png) [@ChuckPa](https://forums.plex.tv/u/ChuckPa)\
**Post date:** [June 13, 2023, 4:49pm UTC](https://forums.plex.tv/t/db-repair-failed/844331/13 "2023-06-13T16:49:48Z")

</div>

version 7.2-64551 here. I wonder 🤔

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.

---

<div class="post-metadata">

**Author:** ![djfriday13](https://avatars.discourse-cdn.com/v4/letter/d/f0a364/32.png) [@djfriday13](https://forums.plex.tv/u/djfriday13)\
**Post date:** [June 13, 2023, 5:29pm UTC](https://forums.plex.tv/t/db-repair-failed/844331/14 "2023-06-13T17:29:39Z")

</div>

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.

---

<div class="post-metadata">

**Author:** ![ChuckPa](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/chuckpa/32/79710_2.png) [@ChuckPa](https://forums.plex.tv/u/ChuckPa)\
**Post date:** [June 13, 2023, 5:30pm UTC](https://forums.plex.tv/t/db-repair-failed/844331/15 "2023-06-13T17:30:55Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![ChuckPa](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/chuckpa/32/79710_2.png) [@ChuckPa](https://forums.plex.tv/u/ChuckPa)\
**Post date:** [June 13, 2023, 7:11pm UTC](https://forums.plex.tv/t/db-repair-failed/844331/16 "2023-06-13T19:11:27Z")

</div>

For those following:

> Ticket #3358217

---

<div class="post-metadata">

**Author:** ![djfriday13](https://avatars.discourse-cdn.com/v4/letter/d/f0a364/32.png) [@djfriday13](https://forums.plex.tv/u/djfriday13)\
**Post date:** [June 13, 2023, 7:30pm UTC](https://forums.plex.tv/t/db-repair-failed/844331/17 "2023-06-13T19:30:08Z")

</div>

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?

---

<div class="post-metadata">

**Author:** ![ChuckPa](https://sea1.discourse-cdn.com/plex/user_avatar/forums.plex.tv/chuckpa/32/79710_2.png) [@ChuckPa](https://forums.plex.tv/u/ChuckPa)\
**Post date:** [June 13, 2023, 8:04pm UTC](https://forums.plex.tv/t/db-repair-failed/844331/18 "2023-06-13T20:04:26Z")

</div>

That IS the Synology ticket number.

From the ticket:

```auto
[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

---

<div class="post-metadata">

**Author:** ![djfriday13](https://avatars.discourse-cdn.com/v4/letter/d/f0a364/32.png) [@djfriday13](https://forums.plex.tv/u/djfriday13)\
**Post date:** [June 13, 2023, 8:19pm UTC](https://forums.plex.tv/t/db-repair-failed/844331/19 "2023-06-13T20:19:21Z")

</div>

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

---

<div class="post-metadata">

**Author:** ![djfriday13](https://avatars.discourse-cdn.com/v4/letter/d/f0a364/32.png) [@djfriday13](https://forums.plex.tv/u/djfriday13)\
**Post date:** [July 5, 2023, 2:58pm UTC](https://forums.plex.tv/t/db-repair-failed/844331/20 "2023-07-05T14:58:14Z")

</div>

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

[Next page](https://forums.plex.tv/t/db-repair-failed/844331.md?page=2)
