DB corrupt - can't fix with repair procedure

Server Version#: 1.20.1.3252-a78fef9a9

Hi guys I detect an error on the PlexDB I try the fix in this post ( https://support.plex.tv/articles/201100678-repair-a-corrupt-database/)
But I got a 0kb size DB at the end of the procedure, on the restore I got this error

sqlite3 com.plexapp.plugins.library.db < dump.sql
Error: near line 9300: UNIQUE constraint failed: media_parts.id
Error: near line 9301: UNIQUE constraint failed: media_parts.id
Error: near line 9302: UNIQUE constraint failed: media_parts.id
Error: near line 9303: UNIQUE constraint failed: media_parts.id
Error: near line 9304: UNIQUE constraint failed: media_parts.id
Error: near line 9305: UNIQUE constraint failed: media_parts.id
Error: near line 9306: UNIQUE constraint failed: media_parts.id
Error: near line 9307: UNIQUE constraint failed: media_parts.id
Error: near line 9308: UNIQUE constraint failed: media_parts.id
Error: near line 9309: UNIQUE constraint failed: media_parts.id
Error: near line 9310: UNIQUE constraint failed: media_parts.id
Error: near line 9311: UNIQUE constraint failed: media_parts.id
Error: near line 9312: UNIQUE constraint failed: media_parts.id
Error: near line 9313: UNIQUE constraint failed: media_parts.id
Error: near line 9314: UNIQUE constraint failed: media_parts.id
Error: near line 9315: UNIQUE constraint failed: media_parts.id
Error: near line 9316: UNIQUE constraint failed: media_parts.id
Error: near line 9317: UNIQUE constraint failed: media_parts.id
Error: near line 9318: UNIQUE constraint failed: media_parts.id
Error: near line 9319: UNIQUE constraint failed: media_parts.id
Error: near line 9320: UNIQUE constraint failed: media_parts.id
Error: near line 9321: UNIQUE constraint failed: media_parts.id
Error: near line 9322: UNIQUE constraint failed: media_parts.id
Error: near line 9323: UNIQUE constraint failed: media_parts.id
Error: near line 9324: UNIQUE constraint failed: media_parts.id
Error: near line 9325: UNIQUE constraint failed: media_parts.id
Error: near line 9326: UNIQUE constraint failed: media_parts.id
Error: near line 9327: UNIQUE constraint failed: media_parts.id
Error: near line 9328: UNIQUE constraint failed: media_parts.id
Error: near line 9329: UNIQUE constraint failed: media_parts.id
Error: near line 9330: UNIQUE constraint failed: media_parts.id
Error: near line 9331: UNIQUE constraint failed: media_parts.id
Error: near line 9332: UNIQUE constraint failed: media_parts.id
Error: near line 9333: UNIQUE constraint failed: media_parts.id
Error: near line 9334: UNIQUE constraint failed: media_parts.id
Error: near line 9335: UNIQUE constraint failed: media_parts.id
Error: near line 9336: UNIQUE constraint failed: media_parts.id
Error: near line 9337: UNIQUE constraint failed: media_parts.id
Error: near line 9338: UNIQUE constraint failed: media_parts.id
Error: near line 9339: UNIQUE constraint failed: media_parts.id
Error: near line 9340: UNIQUE constraint failed: media_parts.id
Error: near line 9341: UNIQUE constraint failed: media_parts.id
Error: near line 9342: UNIQUE constraint failed: media_parts.id
Error: near line 9343: UNIQUE constraint failed: media_parts.id
Error: near line 9344: UNIQUE constraint failed: media_parts.id
Error: near line 9345: UNIQUE constraint failed: media_parts.id
Error: near line 9346: UNIQUE constraint failed: media_parts.id
Error: near line 9347: UNIQUE constraint failed: media_parts.id
Error: near line 9348: UNIQUE constraint failed: media_parts.id
Error: near line 9349: UNIQUE constraint failed: media_parts.id
Error: near line 9350: UNIQUE constraint failed: media_parts.id
Error: near line 9351: UNIQUE constraint failed: media_parts.id
Error: near line 9352: UNIQUE constraint failed: media_parts.id
Error: near line 9353: UNIQUE constraint failed: media_parts.id
Error: near line 9354: UNIQUE constraint failed: media_parts.id
Error: near line 9355: UNIQUE constraint failed: media_parts.id
Error: near line 9356: UNIQUE constraint failed: media_parts.id
Error: near line 9357: UNIQUE constraint failed: media_parts.id
Error: near line 9358: UNIQUE constraint failed: media_parts.id
Error: near line 9359: UNIQUE constraint failed: media_parts.id
Error: near line 9360: UNIQUE constraint failed: media_parts.id

On the check I got a similar error here is the output

** in database main ***
On tree page 14237 cell 129: Offset 28192 out of range 136..1020
On tree page 14237 cell 128: Offset 29551 out of range 136..1020
On tree page 14237 cell 127: Offset 25953 out of range 136..1020
On tree page 14237 cell 126: Offset 12115 out of range 136..1020
On tree page 14237 cell 125: Offset 8282 out of range 136..1020
On tree page 14237 cell 124: Offset 25970 out of range 136..1020
On tree page 14237 cell 123: Offset 28263 out of range 136..1020
On tree page 14237 cell 122: Offset 31337 out of range 136..1020
On tree page 14237 cell 121: Offset 19809 out of range 136..1020
On tree page 14237 cell 120: Offset 29487 out of range 136..1020
On tree page 14237 cell 119: Offset 27749 out of range 136..1020
On tree page 14237 cell 118: Offset 29801 out of range 136..1020
On tree page 14237 cell 117: Offset 24942 out of range 136..1020
On tree page 14237 cell 116: Offset 28262 out of range 136..1020
On tree page 14237 cell 115: Offset 8265 out of range 136..1020
On tree page 14237 cell 114: Offset 25971 out of range 136..1020
On tree page 14237 cell 113: Offset 29289 out of range 136..1020
On tree page 14237 cell 112: Offset 21349 out of range 136..1020
On tree page 14237 cell 111: Offset 24879 out of range 136..1020
On tree page 14237 cell 110: Offset 25705 out of range 136..1020
On tree page 14237 cell 109: Offset 19813 out of range 136..1020
On tree page 14237 cell 108: Offset 29487 out of range 136..1020
On tree page 14237 cell 107: Offset 28005 out of range 136..1020
On tree page 14237 cell 106: Offset 27765 out of range 136..1020
On tree page 14237 cell 105: Offset 22127 out of range 136..1020
On tree page 14237 cell 104: Offset 12847 out of range 136..1020
On tree page 14237 cell 103: Offset 13367 out of range 136..1020
On tree page 14237 cell 102: Offset 25185 out of range 136..1020
On tree page 14237 cell 101: Offset 12645 out of range 136..1020
On tree page 14237 cell 100: Offset 14435 out of range 136..1020
On tree page 14237 cell 99: Offset 13158 out of range 136..1020
On tree page 14237 cell 98: Offset 12852 out of range 136..1020
On tree page 14237 cell 97: Offset 25187 out of range 136..1020
On tree page 14237 cell 96: Offset 14393 out of range 136..1020
On tree page 14237 cell 95: Offset 12342 out of range 136..1020
On tree page 14237 cell 94: Offset 26169 out of range 136..1020
On tree page 14237 cell 93: Offset 26163 out of range 136..1020
On tree page 14237 cell 92: Offset 13367 out of range 136..1020
On tree page 14237 cell 91: Offset 14137 out of range 136..1020
On tree page 14237 cell 90: Offset 13667 out of range 136..1020
On tree page 14237 cell 89: Offset 25954 out of range 136..1020
On tree page 14237 cell 88: Offset 14649 out of range 136..1020
On tree page 14237 cell 87: Offset 14438 out of range 136..1020
On tree page 14237 cell 86: Offset 12901 out of range 136..1020
On tree page 14237 cell 85: Offset 14128 out of range 136..1020
On tree page 14237 cell 84: Offset 24931 out of range 136..1020
On tree page 14237 cell 83: Offset 14385 out of range 136..1020
On tree page 14237 cell 82: Offset 14642 out of range 136..1020
On tree page 14237 cell 81: Offset 14640 out of range 136..1020
On tree page 14237 cell 80: Offset 13106 out of range 136..1020
On tree page 14237 cell 79: Offset 12852 out of range 136..1020
On tree page 14237 cell 78: Offset 12599 out of range 136..1020
On tree page 14237 cell 77: Offset 14648 out of range 136..1020
On tree page 14237 cell 76: Offset 35123 out of range 136..1020
On tree page 14237 cell 75: Offset 19738 out of range 136..1020
On tree page 14237 cell 74: Offset 30063 out of range 136..1020
On tree page 14237 cell 73: Offset 131 out of range 136..1020
On tree page 14237 cell 72: Offset 13107 out of range 136..1020
On tree page 14237 cell 71: Offset 1027 out of range 136..1020
On tree page 14237 cell 70: Offset 8448 out of range 136..1020
On tree page 14237 cell 69: Offset 11649 out of range 136..1020
On tree page 14237 cell 67: Offset 2 out of range 136..1020
On tree page 14237 cell 66: Offset 19728 out of range 136..1020
On tree page 14237 cell 65: Offset 33246 out of range 136..1020
On tree page 14237 cell 64: Offset 33591 out of range 136..1020
On tree page 14237 cell 63: Offset 0 out of range 136..1020
On tree page 14237 cell 62: Offset 0 out of range 136..1020
On tree page 14237 cell 61: Offset 0 out of range 136..1020
On tree page 14237 cell 60: Offset 0 out of range 136..1020
On tree page 14237 cell 59: Offset 0 out of range 136..1020
On tree page 14237 cell 58: Offset 0 out of range 136..1020
On tree page 14237 cell 57: Offset 0 out of range 136..1020
On tree page 14237 cell 56: Offset 0 out of range 136..1020
On tree page 14237 cell 55: Offset 0 out of range 136..1020
On tree page 14237 cell 54: Offset 0 out of range 136..1020
On tree page 14237 cell 53: Offset 0 out of range 136..1020
On tree page 14237 cell 52: Offset 0 out of range 136..1020
On tree page 14237 cell 51: Offset 0 out of range 136..1020
On tree page 14237 cell 50: Offset 0 out of range 136..1020
On tree page 14237 cell 49: Offset 0 out of range 136..1020
On tree page 14237 cell 48: Offset 0 out of range 136..1020
On tree page 14237 cell 47: Offset 0 out of range 136..1020
On tree page 14237 cell 46: Offset 0 out of range 136..1020
On tree page 14237 cell 45: Offset 0 out of range 136..1020
On tree page 14237 cell 44: Offset 0 out of range 136..1020
On tree page 14237 cell 43: Offset 0 out of range 136..1020
On tree page 14237 cell 42: Offset 0 out of range 136..1020
On tree page 14237 cell 41: Offset 0 out of range 136..1020
On tree page 14237 cell 40: Offset 0 out of range 136..1020
On tree page 14237 cell 39: Offset 0 out of range 136..1020
On tree page 14237 cell 38: Offset 0 out of range 136..1020
On tree page 14237 cell 37: Offset 0 out of range 136..1020
On tree page 14237 cell 36: Offset 0 out of range 136..1020
On tree page 14237 cell 35: Offset 0 out of range 136..1020
On tree page 14237 cell 34: Offset 0 out of range 136..1020
On tree page 14237 cell 33: Offset 0 out of range 136..1020
On tree page 14237 cell 32: Offset 0 out of range 136..1020
On tree page 14237 cell 31: Offset 0 out of range 136..1020
On tree page 14237 cell 30: Offset 0 out of range 136..1020
On tree page 14237 cell 29: Offset 0 out of range 136..1020

I try this
First all the procedure was executed with Plex down
then after restore the db to the previous state I try:
Empty the trash
Remove all the previews
force a full DB scan
Delete some empty libraries
and try again (down Plex first )
but I got the same error
I would like to fix this with out delete and scan again all my datable (to avoid to lose the track on tv shows)
There is any way to fix this ?
This is a dump of my db logsPlex Media Server Databases_2018-07-11_15-15-16.zip (22 Bytes) Plex Media Server Logs_2020-09-11_17-23-59.zip (825.1 KB)

You’ve three options:

  1. Attempt to repair
  2. Restore from backup (and hope the backup is not corrupt as well)
  3. Delete & start over.

If you delete the database, your media will not be touched. You will have to rebuild all your libraries and re-share them with any friends/users.

See the support articles below for directions:

That looks like a fairly catastrophic database error. Repair may not be possible.

Do you know what caused this in the first place?

Do you have Plex-created backups available here?
“/Users/[username]/Library/Application Support/Plex Media Server/Plug-in Support/Databases”

If you can’t see the Library folder, in the Finder, Go menu, Go to Folder..., and type ~/Library.

Thanks Volts for your Reply
I think option 3 is for me , the Backup seems to have the same problem :sob:
So I will start all over again f###@#|@|@|
Thanks a lot

Ugh! That’s OK, you can watch everything again. :slight_smile:

Thats is see the glass half full :slight_smile:
I just start with a fraction of the media … 30TB to go :frowning:

This support article may assist with Watched status, you can mark multiple shows at once.

IMO you are tackling your database issue in the best way possible.

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