Enmap error: database

Could someone help me fix this issue?

SqliteError: database disk image is malformed
I keep getting this in my console and i could just delete the enmap files but i need that data. So could someone help me?

Can try to recover the data … first step before this is to copy the database files elsewhere.

The following assumes your database file is .data/enmap.db, and assumes you have enough storage space to have an additional two copies of the database. If not enough space, you can do this on your local computer.

Tools > Full page console

$ cd .data
$ sqlite3 enmap.db
sqlite> .mode insert
sqlite> .output dump_all.sql
sqlite> .dump
sqlite> .exit

Then hopefully there is a new file called dump_all.sql, which is a text file. You can edit the file, and for example, remove transactions or rollbacks.

Then to turn the sql file back into a new sqlite database:

$ sqlite3 newdb.db
sqlite3> .read dump_all.sql
sqlite3> .exit

If no errors, you can rename the files:

$ mv enmap.db enmap.broken.db
$ mv newdb.db enmap.db

Credit to author of some of these steps


Alternatively, see if you can load the data with DB Browser for SQLite .

Edit - changed file extensions to .db

1 Like

Hey @TeaCup, if @mishavee’s guidance doesn’t help we can restore a backup of your project to an earlier version before you database got corrupted. This will overwrite the current version of your project so we should only undertake it if we have no other choice.

If you’d like to pursue that, please let us know the project name and an estimate of when the database was last in a good state. We’ll then give you a list of backup times you can choose from and we’ll go from there.

Sorry for the bother!

@cori Please do so the project name is bumper & the last time it wasn’t corrupt was about aa week ago. Thank you. https://bumper.glitch.me/

Hello @TeaCup the earliest backup we have is from 2019-08-21 13:49:04.000 UTC. Is that too long ago (we have several others from more recent timestamps)?

That time is fine, i can fix some of the servers that the bot recently joined. @cori

I have rewind to 8/21/19 and the database is still corrupt.

Hey @TeaCup it looks like perhaps you remixed this project and did some renaming and deleting. I can still restore the backup to your original project if you’d like, but it would overwrite that project and not the one you’re currently working on.

Please let me know how you’d like to proceed.

Sure, i was doing something to see if i could get it back up and going.

So you’d still like us to restore the backup we were discussing? If so we can undelete the project for you, verify that the backup we discussed is still available, and then restore it.

Yes please do that, it will save me a lot of time of fixing if yall could fix it. If not it’s okay.

Ok, I’ve restored the oldest backup we currently have of https://glitch.com/~bumper-deleted (which isn’t really deleted any more,. we just couldn’t rename it to the original name). This one’s from 2019-08-21 19:25:37.000 UTC.

Please check it out and let us know if it helps or if you’d prefer to try another one.

The project is still showing Sqlite malformed, Thank you for trying to help me. I’m jus going to do what i was doing, which was just delete the enamps then remake it and tell all the server owners that Bumpers database was reset.

I’m sorry for the bother, @TeaCup. Let me recap to make sure we’re on the same page:

  • the oldest backup we have doesn’t resolve the corruption in your database file
  • you want to start from scratch at this point

I’d expect simply deleting your sqlite files would get you back to a valid (if blank) starting place - is that what you’re planning on doing, and is there any other way we can help?

Ive already restarted from scratch, thanks for the help though.

1 Like