Server Version#: 1.25.3.5409
I have Backup database every three days turned on under Scheduled tasks. But it looks like the com.plexapp.plugins.library.db has not been backed up since November 23, 2021 on my server.
com.plexapp.plugins.library.blobs.db
com.plexapp.plugins.library.blobs.db-2022-01-07
com.plexapp.plugins.library.blobs.db-2022-01-10
com.plexapp.plugins.library.blobs.db-2022-01-13
com.plexapp.plugins.library.blobs.db-2022-01-16
com.plexapp.plugins.library.blobs.db-shm
com.plexapp.plugins.library.blobs.db-wal
com.plexapp.plugins.library.db
com.plexapp.plugins.library.db-2021-11-14
com.plexapp.plugins.library.db-2021-11-17
com.plexapp.plugins.library.db-2021-11-20
com.plexapp.plugins.library.db-2021-11-23
Is something else misconfigured on my system or is this a known issue?
What does ls -la show? Seeing just the names doesn’t tell us much
The obvious question – Is the server running when Scheduled Tasks are set to run?
Yes, the server is running.
drwxr-xr-x 3 plex plex 4096 Jan 16 10:51 .
drwxr-xr-x 7 plex plex 4096 Dec 8 2019 ..
-rw-r--r-- 1 plex plex 121671680 Dec 20 2019 com.plexapp.dlna.db
-rw-r--r-- 1 plex plex 262144 Dec 22 2019 com.plexapp.dlna.db-shm
-rw-r--r-- 1 plex plex 122384632 Dec 20 2019 com.plexapp.dlna.db-wal
-rw-r--r-- 1 plex plex 336944128 Jan 15 21:16 com.plexapp.plugins.library.blobs.db
-rw-r--r-- 1 plex plex 332335104 Jan 7 02:00 com.plexapp.plugins.library.blobs.db-2022-01-07
-rw-r--r-- 1 plex plex 333258752 Jan 10 02:03 com.plexapp.plugins.library.blobs.db-2022-01-10
-rw-r--r-- 1 plex plex 333824000 Jan 13 02:01 com.plexapp.plugins.library.blobs.db-2022-01-13
-rw-r--r-- 1 plex plex 336944128 Jan 16 02:03 com.plexapp.plugins.library.blobs.db-2022-01-16
-rw-r--r-- 1 plex plex 32768 Jan 15 21:48 com.plexapp.plugins.library.blobs.db-shm
-rw-r--r-- 1 plex plex 0 Jan 15 21:33 com.plexapp.plugins.library.blobs.db-wal
-rw-r--r-- 1 plex plex 108763136 Jan 16 13:15 com.plexapp.plugins.library.db
-rw-r--r-- 1 plex plex 101081088 Nov 14 02:04 com.plexapp.plugins.library.db-2021-11-14
-rw-r--r-- 1 plex plex 101978112 Nov 17 02:04 com.plexapp.plugins.library.db-2021-11-17
-rw-r--r-- 1 plex plex 102957056 Nov 20 02:04 com.plexapp.plugins.library.db-2021-11-20
-rw-r--r-- 1 plex plex 103782400 Nov 23 02:04 com.plexapp.plugins.library.db-2021-11-23
-rw-r--r-- 1 plex plex 104969216 Nov 20 12:14 com.plexapp.plugins.library.db.original
-rw-r--r-- 1 plex plex 65536 Jan 16 13:54 com.plexapp.plugins.library.db-shm
-rw-r--r-- 1 plex plex 6624440 Jan 16 13:54 com.plexapp.plugins.library.db-wal
ChuckPa
January 16, 2022, 10:11pm
4
Thank you… I see it now.
I will test / reproduce locally and write it up when I do.
I would also ask you toggle ( turn off & save , then turn ON and save again ) your backup settings just to be safe so it can’t be challenged.
Could the DB backup problem be due to the .db file corruption?
$ sudo "/usr/lib/plexmediaserver/Plex SQLite" com.plexapp.plugins.library.db "PRAGMA integrity_check"
*** in database main ***
Page 32920: btreeInitPage() returns error code 11
Page 32919: btreeInitPage() returns error code 11
Page 32918: btreeInitPage() returns error code 11
Page 32917: btreeInitPage() returns error code 11
Page 7054: btreeInitPage() returns error code 11
Page 64312: btreeInitPage() returns error code 11
Page 64311: btreeInitPage() returns error code 11
Page 64310: btreeInitPage() returns error code 11
Page 64309: btreeInitPage() returns error code 11
Page 64308: btreeInitPage() returns error code 11
Page 64307: btreeInitPage() returns error code 11
Page 64306: btreeInitPage() returns error code 11
Page 64305: btreeInitPage() returns error code 11
Page 78424: btreeInitPage() returns error code 11
Page 78423: btreeInitPage() returns error code 11
Page 78422: btreeInitPage() returns error code 11
Page 78421: btreeInitPage() returns error code 11
Page 78420: btreeInitPage() returns error code 11
Page 78419: btreeInitPage() returns error code 11
Page 78418: btreeInitPage() returns error code 11
Page 78417: btreeInitPage() returns error code 11
Error: database disk image is malformed
I tried following the instructions , but it didn’t seem to help:
$ sudo "/usr/lib/plexmediaserver/Plex SQLite" com.plexapp.plugins.library.db ".output recover.out" ".recover"
$ sudo "/usr/lib/plexmediaserver/Plex SQLite" com.plexapp.plugins.library.db "PRAGMA integrity_check"
*** in database main ***
Page 32920: btreeInitPage() returns error code 11
...
ChuckPa
January 16, 2022, 11:10pm
6
Very much so that could stop it.
I would recover / export to SQL text form then rebuild it by importing.
I tried doing ".output dump.sql" ".dump" command, but the dump.sql file has this at the end:
ROLLBACK; -- due to errors
So importing from it produces a .db file of 0 length.
ChuckPa
January 16, 2022, 11:36pm
8
can you edit the file and delete the ROLLBACK; ?
or use sed ?
Removing it didn’t do anything different, but if I replace it with COMMIT; then the dump.sql is imported fine. But I have no way of verifying whether it’s actually fine. I ended up copying one of the old .db files (from Nov 23) over the main one in order to get it working, at least for now, but I suspect this corruption issue will rear its ugly head again.
ChuckPa
January 16, 2022, 11:57pm
10
True… you’ll have to wait until next backup time to see if it’s ok.
Well, I didn’t have to wait that long. Just a couple of hours later, I ran the PRAGMA check again:
$ sudo "/usr/lib/plexmediaserver/Plex SQLite" com.plexapp.plugins.library.db "PRAGMA integrity_check"
*** in database main ***
Page 15516: btreeInitPage() returns error code 11
Page 15515: btreeInitPage() returns error code 11
Page 15514: btreeInitPage() returns error code 11
Page 15513: btreeInitPage() returns error code 11
Page 12269: btreeInitPage() returns error code 11
On tree page 2589 cell 1: Child page depth differs
On tree page 2589 cell 0: Child page depth differs
Page 12272: btreeInitPage() returns error code 11
Page 12270: btreeInitPage() returns error code 11
Page 12271: btreeInitPage() returns error code 11
Error: database disk image is malformed
Can you help with figuring out what keeps causing the corruption?
@ChuckPa do you know why this keeps happening to my DB?
system
Closed
April 18, 2022, 12:42am
13
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.