• 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): « Previous 1 2

     
    • 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
    #11
    2025-05-05, 05:10 AM (This post was last modified: 2025-05-05, 05:11 AM by sneakie. Edited 1 time in total.)
    (2025-03-23, 05:56 PM)TheDreadPirate Wrote:
    (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?

    The fix worked temporarily. 

    but I decided to remake the whole thing and hope I could find the culprit by process of elimination or if I could just get rid of the issue permanently, however neither worked I removed all plugins except merge versions and it still ended up malforming eventually(1-2weeks).

    The only things that are exactly the same is the server its run on same unraid version, docker version, docker app and no crashes/power outages.

    I also thought that maybe having a torrent software downloading/seeding directly from the database could be the culprit but I'm not sure and couldnt really find any information regarding it, do you have any idea of how likely that could be?

    linked here https://privatebin.net/?005eed779766b066...prRBpsyh5z is the first log (a few days ago) where the malformation shows up, let me know if you need anything else or if there is anything you can see from the log.
    pw to bin: lol123

    I can add anything needed when I wake up in a few hours.

    Again, sorry for late reply, I realized this is months old now. Cheers for all the help.
    sneakie
    Offline

    Junior Member

    Posts: 8
    Threads: 1
    Joined: 2025 Feb
    Reputation: 0
    Country:Sweden
    #12
    2025-05-06, 02:54 AM
    Ok. After another sleepless night I believe I managed to find a solution that works and lead to the malformed issue going away at least temporarily for me.

    This will be a bit longer post, but ill explain it in a way that a complete beginner can do it, hope that's alright.

    First off, this fix only rarely works if https://sqlite.org/recovery.html is to be trusted, so I cant say if this is a permanent fix or just temporarily or it will fix any/all malformed datadisk issues on jellyfin, it will also only be relevant if you use windows, I do not have any experience with any other OS's to help enough sorry.

    1. If you do not have SQLITE get it from https://sqlite.org/download.html, find the Precompiled Binaries for Windows and go for the "A bundle of command-line tools for managing SQLite database files, I got this because I couldn't get it to work through CM/Powershell because I'm dense.
    2. Unzip the the archive into whatever folder you want, I put it in a folder on the desktop
    3. Safely backup the Library.db/Jellyfin.db -- (the corrupted ones yes)
    4. Copy safely the Library.db/Jellyfin.db to the desktop folder -- can be found in your jellyfin folders.
    5. open sqlite3.exe in the desktop folder, type ".open jellyfin.db" or "library.db" and run the command "pragma integrity_check;" -- when you have figured out which one or if both are giving errors do the following steps for each(don't overwrite existing files etc).
    6. start sqlite3.exe again, type ".open library.db" -- (or jellyfin.db, if you're doing jellyfin.db just change the names to make it less messy)
    7. write ".output library_recover.sql" and then ".recover"  --  This will take a while and will result in a new file being created in the folder called library_recover.sql, you will know it has finished when a new empty line appears again.
    8. Reopen sqlite3.exe, type ".open library_new.db" followed by ".read library_recover.sql"  -- Your .open command created a new file in the folder called library_new.db and then .read essentially rebuilt the database based on the information from the .sql file, is the best way I can explain it.
    9. write ".open library_new.db" and do point 4, if you are not getting any errors it might be fixed, now do this again for the jellyfin.db(if it was giving errors) otherwise shutdown your server and try adding this new db and see if it starts without any errors.

    When you've done this for both files (if needed) dont forget to rename them correctly and make sure you are saving the right files etc.

    This worked for me hope it will work for someone else or help, Cheers, Thanks to everyone in this thread helping out.  Thumbs-up
    Pages (2): « Previous 1 2

    « 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