• Welcome to the Lightroom Queen Forums! We're a friendly bunch, so please feel free to register and join in the conversation. If you're not familiar with forums, you'll find step by step instructions on how to post your first thread under Help at the bottom of the page. You're also welcome to download our free Lightroom Quick Start eBooks and explore our other FAQ resources.
  • Dark mode now has a single preference for the whole site! It's a simple toggle switch in the bottom right-hand corner of any page. As it uses a cookie to store your preference, you may need to dismiss the cookie banner before you can see it. Any problems, please let us know!

Repair of corrupted catalogs

Status
Not open for further replies.

Tomiron

New Member
Joined
May 28, 2012
Messages
3
Location
Sweden
Lightroom Experience
Advanced
Trying to open a corrupt catalog of mine makes LR freeze forcing me to kill the actual LR-process to proceed. I also need to delete the preference files to start LR again. It is not possible to import any data from the corrupted catalog to a new one. (My latest backup catalog works just fine though, but lacks quite a few hours of work...)

Is there by any chance a way to check integrity or do any other kind of catalogue repair of corrupted catalogs that doesn't open in LR? If I'd been more of a tech-pro I'd might been successful in using sqlite3 or sqlite analyzer to check the database. Now is that not the case..

I'm aware of that holding down the Alt-key (on Win) or Opt-key (on Mac) while simultaneously clicking on the LR icon in the dock cause LR to open but not to open the default catalog. Instead it shows a dialog with a list of available catalogs and an option to create check integrity of each catalog. In my case - this doesn't work. If I choose my corrupted catalog following this procedure this will still cause LR to crash.

Working in LR 4, Win7 64 bit, 4GB RAM, accessing catalog and previews from an external drive, images stored on a multiHD-NAS.
 
Thanks for the tip JohanElzenga. I tried that but it still behaves the same way...

I am clueless how to now find a parrticular photo amongst the >500 000 that I have on the harddrives.
 
Next thing to try is uninstall Lightroom and reinstall it again.
 
OK, just a little feedback on how I (didn't) solve the problem:
After resetting LR, I managed to start it by doubleklicking an old catalog that I had not tried to open after the problem started. Before trying to open the "2015-2017" catalog (that was open when the computer was unexpectedly shut down), I could open all other catalogs, but when i finally came to "2015-2017" the same thing happened. Since trying to open this catalog might had caused LR into the state where it wouldn't open any catalogs, I exited LR and then tried starting from the latest (2 weeks old) "2015-2017" backup, which worked. So, instead of hazzling with repairing a very large catalog file, I decided to just re-do the indexing for the past 2 weeks.

I have been using XMP-sidecars and PNGs so any editing should be recoverable. A question in this regard is if I will have to re-import the edited files to LR in order to see the editing history?
 
Edit history is one of the things that are NOT included in XMP, so no point in re-importing them for that purpose.
 
OK, yes, you are right, I just meant the latest editing status. Do I need to import again for LR to recognize that if I am using XMP and/or PNG?

Thanks, Jens
 
If you're using a backup catalog, then you'll need to import any images added since the backup was originally mad. And if you had imported those images into the original catalog, and edited them, AND saved XMP, then yes the edits should be recovered.
 
Hi All,
I'm having this "not valid" catalog problem, and have gone through the SQLITE process.
On the final step of "-init", it gave me this text below, and the new .lrcat file in the folder is 0 bytes large.
Does anyone know what I did wrong and how to fix it?
Thank you very much in advance!

Error: near line 325698: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325699: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325700: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325701: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325702: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325703: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325704: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325705: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325706: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325707: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325708: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325709: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325710: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325711: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325712: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325713: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325714: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325715: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325716: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325717: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325718: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325719: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325720: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325721: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325722: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325723: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325724: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325725: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325726: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325727: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325728: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325729: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325730: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325731: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325732: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325733: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325734: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325735: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325736: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325737: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325738: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325739: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325740: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325741: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325742: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325743: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325744: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325745: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325746: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325747: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325748: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325749: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325750: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325751: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325752: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325753: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325754: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325755: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325756: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325757: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325758: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325759: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325760: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325761: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325762: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325763: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325764: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325765: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325766: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325767: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325768: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325769: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325770: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325771: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325772: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325773: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325774: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325775: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325776: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325777: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325778: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325779: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325780: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325781: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325782: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325783: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325784: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325785: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325786: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325787: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325788: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325789: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325790: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325791: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325792: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325793: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325794: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325795: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325796: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325797: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325798: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325799: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325800: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325801: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325802: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325803: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325804: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325805: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325806: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325807: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325808: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325809: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325810: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325811: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325812: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325813: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325814: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325815: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325816: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325817: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325818: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325819: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325820: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325821: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325822: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325823: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325824: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325825: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325826: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325827: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325828: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325829: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325830: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325831: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325832: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325833: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325834: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325835: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325836: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325837: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325838: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325839: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325840: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325841: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image

Error: near line 325842: NOT NULL constraint failed: AgLibraryImageSyncedAssetData.image
 
Hi Alex, welcome to the forum! We can't give advice on directly editing the database, because it can cause all sorts of unknown issues. However if you want to send me the problem catalog, I can pass it on to the LR engineer at Adobe to see if he can rescue it for you.

wetransfer.png
 
Hi Alex, welcome to the forum! We can't give advice on directly editing the database, because it can cause all sorts of unknown issues. However if you want to send me the problem catalog, I can pass it on to the LR engineer at Adobe to see if he can rescue it for you.

wetransfer.png
Hi Victoria! Thank you very much for such a prompt reply! Uploading it right away, could you please let me know if you received the link?
 
Got it Alex, and forwarded it on to Paul at Adobe. I'll let you know by email when I hear back.
 
Victoria, I can't express how thankful I am, you and the engineers saved me! The fixed file works, haven't found any corrupt files so far, thank you very very much, Lightroom Queen :love::):thumbsup:

Got it Alex, and forwarded it on to Paul at Adobe. I'll let you know by email when I hear back.
 
Victoria, I can't express how thankful I am, you and the engineers saved me! The fixed file works, haven't found any corrupt files so far, thank you very very much, Lightroom Queen :love::):thumbsup:
Victoria,

The fix must involve some cleanup and repair of the sqlite database file. Would it be possible for Adobe to provide users with some guidelines to fix the most common problems? There are several people in this forum (and I'm not one of them) who could easily fix the database with some guidance from Adobe.

Phil
 
They decided to keep it in-house so they can see any patterns of corruption and prevent/automatically fix them in future releases.
 
I can't believe I've just now discovered this forum! So thankful. I’ve followed Holger Mischke's SQLite tutorial several times but end up stuck. Below is final my result after successfully completing the first steps. There are a few hundred lines below that I didn’t paste but are similar to the last lines. Once the new file is created it is zero bytes. I’d be grateful for any advice!

C:\SQLite>sqlite3 -init tempfile.sql NewFile.lrcat
-- Loading resources from tempfile.sql
Error: near line 122: UNIQUE constraint failed: Adobe_variablesTable.id_local
Error: near line 123: UNIQUE constraint failed: Adobe_variablesTable.id_local
Error: near line 124: UNIQUE constraint failed: Adobe_variablesTable.id_local
Error: near line 125: UNIQUE constraint failed: Adobe_variablesTable.id_local
Error: near line 126: UNIQUE constraint failed: Adobe_variablesTable.id_local
Error: near line 127: UNIQUE constraint failed: Adobe_variablesTable.id_local
Error: near line 128: UNIQUE constraint failed: Adobe_variablesTable.id_local
Error: near line 129: UNIQUE constraint failed: Adobe_variablesTable.id_local
Error: near line 130: UNIQUE constraint failed: Adobe_variablesTable.id_local
Error: near line 150: UNIQUE constraint failed: Adobe_variablesTable.id_local
Error: near line 151: UNIQUE constraint failed: Adobe_variablesTable.id_local
Error: near line 152: UNIQUE constraint failed: Adobe_variablesTable.id_local
Error: near line 153: UNIQUE constraint failed: Adobe_variablesTable.id_local
Error: near line 154: UNIQUE constraint failed: Adobe_variablesTable.id_local
Error: near line 155: UNIQUE constraint failed: Adobe_variablesTable.id_local
Error: near line 156: UNIQUE constraint failed: Adobe_variablesTable.id_local
Error: near line 157: UNIQUE constraint failed: Adobe_variablesTable.id_local
Error: near line 158: UNIQUE constraint failed: Adobe_variablesTable.id_local
Error: near line 159: UNIQUE constraint failed: Adobe_variablesTable.id_local
Error: near line 160: UNIQUE constraint failed: Adobe_variablesTable.id_local
Error: near line 161: UNIQUE constraint failed: Adobe_variablesTable.id_local
Error: near line 162: UNIQUE constraint failed: Adobe_variablesTable.id_local
Error: near line 170: UNIQUE constraint failed: Adobe_variablesTable.id_local
Error: near line 171: UNIQUE constraint failed: Adobe_variablesTable.id_local
Error: near line 172: UNIQUE constraint failed: Adobe_variablesTable.id_local
Error: near line 173: UNIQUE constraint failed: Adobe_variablesTable.id_local
Error: near line 1415102: no such table: sqlite_stat4
Error: near line 1415103: no such table: sqlite_stat4
Error: near line 1415104: no such table: sqlite_stat4
Error: near line 1415105: no such table: sqlite_stat4
 
Last edited:
Hi Adam. We're unable to help troubleshoot SQLite tricks, but if you want to send me the catalog, I'll pass it on to the Adobe engineer to see if it's possible to rescue.
 
Done and returned!
 
What a day. It's in perfect shape as far as I can tell. I am incredibly grateful!
I'm happy that Adam's catalog got fixed. I can only hope that I never need the kind of service Adam received.

Considering all the AI that Adobe has used in LR 7 for the AUTO exposure settings (which work very well for me!), perhaps Adobe can release a repair tool based on AI and their experience with repairing corrupted databases. A database gets corrupted because of some subtle combination of workflow that has not been tested, perhaps a very subtle bug, or perhaps some user action that caused the corruption. Whatever the cause, AI can probably identify the most common patterns and fixes.

Phil Burton
 
perhaps Adobe can release a repair tool based on AI and their experience with repairing corrupted databases

They've actually been doing that for years, not as a separate tool, but as part of the catalog repair process built into Lightroom. That's why we're seeing fewer and fewer cases these days, and why they still want to see the corrupted catalogs. There's more real intelligence involved than artificial, but the principle's the same.
 
That's a great answer. Really.
 
Hi Victoria,

I have a Catalog that got corrupted after I did a force shutdown on my computer and I haven't been able to repair the file.
Do you think you can assist me?

ses2018.lrcat

Thanks!
 
Status
Not open for further replies.
Back
Top