• Login
  • Register
  • Login Register
    Login
    Username/Email:
    Password:
    Or login with a social network below
  • Forum
  • Website
  • GitHub
  • Status
  • Translation
  • Features
  • Team
  • Rules
  • Help
  • Feeds
User Links
  • Login
  • Register
  • Login Register
    Login
    Username/Email:
    Password:
    Or login with a social network below

    Useful Links Forum Website GitHub Status Translation Features Team Rules Help Feeds
    Jellyfin Forum Support Troubleshooting SOLVED: Database disk image is Malformed

    Pages (2): 1 2 Next »

     
    • 0 Vote(s) - 0 Average

    SOLVED: Database disk image is Malformed

    SQLite Error 11: 'database disk image is malformed'.
    sneakie
    Offline

    Junior Member

    Posts: 8
    Threads: 1
    Joined: 2025 Feb
    Reputation: 0
    Country:Sweden
    #1
    2025-03-22, 07:20 PM
    Hello!

    Summary of issue:
    My server ends up in a state where the scheduled task to "Scan Media Library" ends up failing over and over again, the server tends to run just fine and nothing seemingly is going wrong with the server, but the task just cant complete.

    Quick info:
    Jellyfin is run on an unraid server, consisting of 5x HDDs via docker.

    Unraid version: 6.12.6
    Jellyfin version: 10.10.6

    Things I've tried/thought of:
    I backup the jellyfin folder on intervals and I just remake it from that backup anytime the error comes up and it disappears but always comes back.

    As I was making this thread I realized disk1 "only" has 423gb out of 16tb available and I wonder if that might be the reason the database malformed? (When I searched the forum that was one of the most common questions asked)
     
    Logs:
    https://privatebin.net/?38aa391d58363bcf#6hALzKmjp3QPkmxEJZigyBPACcp6BM9XBzzLSSdNJ5Vk

    Im pretty new to this, so if I provided the wrong logs please point me in a direction to figure out how to get the ones needed. (also is there some kind of "anonymize" logs addon/website/setting?)

    Basically what I'm wondering is if there is some kind of permanent fix for this or if its just randomly corrupted itself.

    Thanks in advance.
    Go to solution
    TheDreadPirate
    Offline

    Community Moderator

    Posts: 15,374
    Threads: 10
    Joined: 2023 Jun
    Reputation: 460
    Country:United States
    #2
    2025-03-22, 07:29 PM
    What plugins do you have installed? And what file system is the jellyfin app data and database located on?
    Jellyfin 10.10.7 (Docker)
    Ubuntu 24.04.2 LTS w/HWE
    Intel i3 12100
    Intel Arc A380
    OS drive - SK Hynix P41 1TB
    Storage
        4x WD Red Pro 6TB CMR in RAIDZ1
    [Image: GitHub%20Sponsors-grey?logo=github]
    sneakie
    Offline

    Junior Member

    Posts: 8
    Threads: 1
    Joined: 2025 Feb
    Reputation: 0
    Country:Sweden
    #3
    2025-03-22, 07:40 PM (This post was last modified: 2025-03-22, 08:19 PM by sneakie. Edited 1 time in total.)
    Filesystem: XFS
    current active plugins:
    aniDB, AniList, AudioDB, Merge Versions, Musicbrainz, OMDb, Open Subtitles, Studio Images, TMDb and TheTVDB.

    *quick edit*

    Assuming the DB is in the Jellyfin folders with the appdata, they are both on an XFS filesystem and turns out they are not on disk1 as I first thought
    they are actually on a completely separate nvme SSD that has 397/500gb available on it.
    theguymadmax
    Offline

    Community Moderator

    Posts: 1,129
    Threads: 0
    Joined: 2024 Jun
    Reputation: 59
    #4
    2025-03-22, 09:21 PM
    Take a look at this post and see if it helps: https://forum.jellyfin.org/t-solved-malf...8#pid54778
    sneakie
    Offline

    Junior Member

    Posts: 8
    Threads: 1
    Joined: 2025 Feb
    Reputation: 0
    Country:Sweden
    #5
    2025-03-22, 10:27 PM
    This might be a bit of a beginner question, but how do I run the script in this context?

    I mean the "#!/bin/bash
    cat <( sqlite3 "$1" .dump | grep "^ROLLBACK" -v ) <( echo "COMMIT;" ) | sqlite3 "fix_$1""

    I got the sqlite3 commandline utility tool for windows on my main computer, but couldnt figure out how to run the command. Might be a bit slow on the uptake.

    Sorry!
    TheDreadPirate
    Offline

    Community Moderator

    Posts: 15,374
    Threads: 10
    Joined: 2023 Jun
    Reputation: 460
    Country:United States
    #6
    2025-03-23, 01:11 AM
    That command is for Linux. I don't know powershell so I can't convert it to a Windows equivalent command.

    Looking at the stackoverflow link, I think you should be able to run the following commands in Windows.

    Code:
    cd $DATABASE_LOCATION
    echo '.dump'|sqlite3 $DB_NAME|sqlite3 repaired_$DB_NAME
    mv $DB_NAME corrupt_$DB_NAME
    mv repaired_$DB_NAME $DB_NAME

    Replace everything with a $ before the word with the indicated file name.
    Jellyfin 10.10.7 (Docker)
    Ubuntu 24.04.2 LTS w/HWE
    Intel i3 12100
    Intel Arc A380
    OS drive - SK Hynix P41 1TB
    Storage
        4x WD Red Pro 6TB CMR in RAIDZ1
    [Image: GitHub%20Sponsors-grey?logo=github]
    sneakie
    Offline

    Junior Member

    Posts: 8
    Threads: 1
    Joined: 2025 Feb
    Reputation: 0
    Country:Sweden
    #7
    2025-03-23, 01:31 AM (This post was last modified: 2025-03-23, 01:32 AM by sneakie.)
    E:\yaddayadda\yaddayadda2>echo '.dump'|sqlite3 library.db|sqlite3 repaired_library.db
    Parse error near line 1: near "'.dump'": syntax error
    '.dump'
    ^--- error here

    It keeps throwing me this error, so it doesnt work. (for some reason)

    I tried to manually dump the database inside sqlite3 into a new one, but the problem with that is that the new .db never gets filled, it either stays as 0kb or is half the size and when running an integritycheck on this new "db" it says its not a db.
    sneakie
    Offline

    Junior Member

    Posts: 8
    Threads: 1
    Joined: 2025 Feb
    Reputation: 0
    Country:Sweden
    #8
    2025-03-23, 01:44 AM
    Sorry.

    Ive not slept yet so I was a little slow and missed the word "shell" and was using cmd.

    Using powershell I managed to executed "PS E:\*****\databasefolder> echo '.dump'|sqlite3 library.db|sqlite3 repaired_library.db"

    this created repaired_library.db, which is 0KB, so similar result I managed to get while trying to dump it in sqlite3.
    sneakie
    Offline

    Junior Member

    Posts: 8
    Threads: 1
    Joined: 2025 Feb
    Reputation: 0
    Country:Sweden
    #9
    2025-03-23, 02:15 AM (This post was last modified: 2025-03-23, 02:18 AM by sneakie. Edited 1 time in total.)
    Ok. So I managed to create a new DB that resembles the real deal (206000 KB vs 200000 KB) which also passes the pragma integrity check, which leads me to believe it might have worked, though I cant be sure, because I don't think the integrity check is meant to see if a database is healthy, just to check for errors?

    What I did was I changed '.dump' to '.recover' in the powershell command.

    Just for some more information in case this isn't a solution or anyone comes across this:

    When checking both Library.db & Jellyfin.db with pragma integrity check; they both produced these errors:

    Jellyfin.db: row 34 missing from index IX_ActivityLogs_DateCreated
    Library.db: *** in database main ***, Tree 7 page 39598 cell 37: Rowid 232781 out of order, database disk image is malformed

    and after running powershell command above with the alterations, both appear to be error free.
    TheDreadPirate
    Offline

    Community Moderator

    Posts: 15,374
    Threads: 10
    Joined: 2023 Jun
    Reputation: 460
    Country:United States
    #10
    2025-03-23, 05:56 PM
    (2025-03-23, 02:15 AM)sneakie Wrote: Ok. So I managed to create a new DB that resembles the real deal (206000 KB vs 200000 KB) which also passes the pragma integrity check, which leads me to believe it might have worked, though I cant be sure, because I don't think the integrity check is meant to see if a database is healthy, just to check for errors?

    What I did was I changed '.dump' to '.recover' in the powershell command.

    Just for some more information in case this isn't a solution or anyone comes across this:

    When checking both Library.db & Jellyfin.db with pragma integrity check; they both produced these errors:

    Jellyfin.db: row 34 missing from index IX_ActivityLogs_DateCreated
    Library.db: *** in database main ***, Tree 7 page 39598 cell 37: Rowid 232781 out of order, database disk image is malformed

    and after running powershell command above with the alterations, both appear to be error free.

    The Jellyfin startup afterwards without all the database malformed messages?
    Jellyfin 10.10.7 (Docker)
    Ubuntu 24.04.2 LTS w/HWE
    Intel i3 12100
    Intel Arc A380
    OS drive - SK Hynix P41 1TB
    Storage
        4x WD Red Pro 6TB CMR in RAIDZ1
    [Image: GitHub%20Sponsors-grey?logo=github]
    Pages (2): 1 2 Next »

    « Next Oldest | Next Newest »

    Users browsing this thread: 1 Guest(s)


    • View a Printable Version
    • Subscribe to this thread
    Forum Jump:

    Home · Team · Help · Contact
    © Designed by D&D - Powered by MyBB
    L


    Jellyfin

    The Free Software Media System

    Linear Mode
    Threaded Mode