Unknown error calling sqlite3_step (11: database disk image is malformed) eu
(1) By Abhishek Dixit (abhidixit004) on 2022-05-04 13:20:01 [link] [source]
AppName[4646:336019] [logging] database corruption at line 80678 of [9ff244ce07] 2022-05-02 15:17:17.759452+0530 AppName[4646:336019] Unknown error calling sqlite3_step (11: database disk image is malformed) eu 2022-05-02 15:17:17.759558+0530 AppName[4646:336019] DB Query: INSERT OR REPLACE INTO AppNameBallotByMail (BallotbyMailID, ElectionCode, ElectionSubCode, ElectionType, IDNumber, MailBallotStatus, PB_Update_Date, SOS_VoterID, PollCode, Precinct, PrecSub, Party_Ind, DateTimeStamp, isPushedToServer) VALUES (1704744, "0322", "00", "P", "2312460", "SENT", "2019-04-04 06:48:18:095", "110***80330", "", "0134", "05", "R", "2022-02-01 09:01:11", 1) 2022-05-02 15:17:17.759706+0530 AppName[4646:336019] Unknown error finalizing or resetting statement (11: database disk image is malformed)
We are using FMDB(https://cocoapods.org/pods/FMDB) for performing CRUD operation. As we are using the multithreading env so using FMDBGlobalQueue i.e serial. Everything was working fine before iOS 15. Now, we stuck here. This error is unexpectedly comes.
(2) By Simon Slavin (slavin) on 2022-05-05 13:41:31 in reply to 1 [source]
There's nothing wrong with your program. Your database is corrupt.
If the data in that database doesn't matter to you, restore a copy of the data from before you got the error. Or just start again from a blank database.
If the data in that database does matter to you …
Copy the database onto a computer, use the SQLite command line tool to open it, and run
PRAGMA integrity_check();
on it. Tell us what happens.
(3) By Abhishek Dixit (abhidixit004) on 2022-05-06 10:09:46 in reply to 2 [link] [source]
We are trying to identify why the DB is getting corrupted. and actually DB is not corrupted, because select query is working fine only the issue with some SQLite DB in case of insertion.
(4) By Warren Young (wyoung) on 2022-05-06 10:26:41 in reply to 3 [link] [source]
actually DB is not corrupted
My car's wheel works fine without lug nuts because it doesn't fall off immediately. I can get whole blocks before it falls off each time, and the fix is easy. What's the problem?
Does "PRAGMA integrity_check()
" agree with your assessment?
(5.1) By Ryan Smith (cuz) on 2022-05-06 10:35:15 edited from 5.0 in reply to 3 [link] [source]
SELECT queries often work just fine on a corrupted DB - the corruption may well be in an object or on pages which doesn't affect some queries.
The only good indication that a DB is NOT corrupted, would be a full pragma_integrity)check() passing.
Could you share the DB by any chance?
If it contains sensitive information, perhaps try to run a .dump to a file and then .import to a new DB from that file. Often this either fixes it or stops at the point where the corruption becomes evident (such as duplicate primary keys).
Any failures during that process would also help us understand more of what is going on with your DB.
(6) By Simon Slavin (slavin) on 2022-05-06 13:55:09 in reply to 3 [link] [source]
The database file contains lots of different data in. Your SELECT query looks only at a very small amount of that information. The command I gave you
PRAGMA integrity_check();
checks lots of data which will be consulted for different SELECT commands, and for INSERT commands, and for other commands.
(7) By anonymous on 2022-05-16 12:00:35 in reply to 6 [link] [source]
I ran my iOS App, and it started giving these messages in the log.
022-05-16 06:56:38.900376-0500 DemoApp[32405:1563286] Unknown error calling sqlite3_step (11: database disk image is malformed) rs
2022-05-16 06:56:38.900546-0500 DemoApp[32405:1563286] Unknown error calling sqlite3_step (11: database disk image is malformed) rs
2022-05-16 06:56:38.900892-0500 DemoApp[32405:1563286] Unknown error calling sqlite3_step (11: database disk image is malformed) rs
2022-05-16 06:56:38.946166-0500 DemoApp[32405:1563286] Unknown error calling sqlite3_step (11: database disk image is malformed) rs
Then I extracted the SQLite database file and ran the command in DB Browser:
PRAGMA integrity_check
And got:
integrity_check ok
Any suggestions?