Lightroom Classic: Error: database disk image is malformed :: SQL: SELECT * FROM Adobe_imageDevelopSettings WHERE id_local = ?;

  • 1
  • Problem
  • Updated 6 months ago
  • (Edited)
What to do when receive this in LR Error: database disk image is malformed :: SQL: SELECT * FROM Adobe_imageDevelopSettings WHERE id_local = ?;
Photo of Sally Smith

Sally Smith

  • 4 Posts
  • 2 Reply Likes

Posted 9 months ago

  • 1
Photo of Fred I.

Fred I.

  • 23 Posts
  • 10 Reply Likes
Sally,

Lightroom uses a relational database (SQLite) to store data about your photos, edits, etc.  The message you are receiving is an error message from the database to Lightroom itself regarding the SQL statement that Lightroom is attempting to execute.

Here are two quick things to try:

1. Simply exit out of Lightroom and start it over and redo whatever action you were doing at the time.
2. While in Lightroom, perform an 'optimize catalog' from the File menu.

If these two things do not work, you could attempt to 'repair' the underlying database but that is a more complicated task.

Fred
Photo of Sally Smith

Sally Smith

  • 4 Posts
  • 2 Reply Likes
Thank you Fred...a bit of background...this has been going on awhile, since an earlier crash, corrupt files, try to repair, can't repair so have gone to previous backups and can open LR but if I go to certain folders, I receive the same error messages.  I have recently purchased a new iMac and restored from back up disk hoping to leave the problems behind...not so lucky.  Any advice is welcomed...my catalog has 45000 or so images.  Thank you
Photo of Fred I.

Fred I.

  • 23 Posts
  • 10 Reply Likes
Sounds like a more involved problem... Do you happen to know if Lightroom 'knows' where all your files are?  By that I mean, with 45K photos, the switch to a new computer (and likely restore of the old computer to the new one)... can Lightroom resolve all the photo locations (in other words, when you view the filmstrip of photos - say, in the develop module - do you see any badges indicating '?' that indicate Lightroom cannot find the source photo?  If so, you can do some work to help Lightroom find the original photos.

That said, at the macro level, when you import a file into Lightroom, it is creating a number of entries in several tables in the underlying database.  If for some reason, the database is corrupted (tables and/or indexes are damaged) then, Lightroom will not be able to correctly 'find' all of your photos (at least from a database perspective).  Then, if you restore your database from some point in time in the pat, anything that you had done post that time, will be unknown to Lightroom and you will need to re-do whatever it is you did.

The good news is that your photos are likely safe... the bad news is that you might need to re-create some work in Lightroom.

Let me know if Lightroom actually knows where all your photos are.
Photo of Sally Smith

Sally Smith

  • 4 Posts
  • 2 Reply Likes
Yes my photos are safe, I'm a bit OCD so I have back up and copies...but I want a good working LR. I was lead to believe that my earlier troubles with "corrupt catalogs" might be due to a drive going bad, because of other crash issues I had that seemed probable, so I bit the bullet and chose a nice new machine.  I also decided I would like to put my catalog and photos on an external drive for a number of reasons.  That said, i'm ready to invest the time and trouble to have a healthy LR catalog on a new disk.  My thought is to export/import folders (as catalogs) to the new LR catalog.  Doing it folder by folder i could test the integrity of each after doing so and then have a much smaller library to work with the problem folders.  Do you think that is a good idea or do you have a better one?  I have done new backups for my new computer, have not erased my old one...I am not a techie, as if you already didn't know, but I do understand a little more than the average Jane.  I really do appreciate your advice.
Photo of Fred I.

Fred I.

  • 23 Posts
  • 10 Reply Likes
If you have used Lightroom to make numerous changes to your 45K photos then, doing as you suggest is a good strategy.

If not, you could just create a new catalog and import all of your photos again.

My workflow is a bit different - each time I photograph an event (sports, meeting, portrait session, etc.), I create a new folder structure and a new catalog for just those images - so at most, I might have 600-2,000 in any given catalog.  That works for me, but if one uses a lot of keywords for their photos and wants to find (for example) all photos of 'trees' or cousin 'Vinnie' then, one large catalog might be the better choice.

Back to the database though... if you are getting a database image is malformed message every time you are in Lightroom... you could try to repair the database outside of Lightroom.  This is an involved process and you will need to do some work from the command line to 'dump' the database and then recreate it.

Here is a link that gives you an overview of what is going on... 
https://sysinfotools.com/blog/fix-error-sqlite-database-disk-image-malformed/

I am not suggesting you do what it says - just giving you an idea of what is going on and one way you might be able to address your issue and/or give you some thoughts on better search terms as you research this issue.
 
Keep in mind, if you do end up repairing the database, there will be 'holes' - the rows in the tables that are causing the issue(s) will not end up in the newly reconstructed database.  This will cause some issues in Lightroom but you should be able to deal with those fairly easily by telling Lightroom where to find the 'missing' originals and then re-editing those photos if needed.
Photo of Sally Smith

Sally Smith

  • 4 Posts
  • 2 Reply Likes
Thank you for those thoughts Fred, I appreciate you sharing your knowledge.  And I meant to say before that yes my photos were showing up in LR--it knew where they were!  I will click on the link and learn what I can...so I will probably ask more questions later.  Thank you
Photo of Puran Kandpal

Puran Kandpal

  • 1 Post
  • 0 Reply Likes
There is one more blog worth to fix this problem, Please take a look on here: http://sqliteviewer.com/blog/database-disk-image-malformed/