Unable to correct Lightroom CC Corrupted catalog

Janet Eschenlauer

New Member
Joined
May 28, 2017
Messages
16
Lightroom Experience
Advanced
Lightroom Version
Recently I found that my Lightroom catalog is corrupted. When I unzip and open a backup file I find that it is corrupted as well. I have gone back to backups up to 2 weeks old and they all say they are corrupted. I uninstalled and reinstalled Lightroom. Is there something related to Lightroom on my computer the is causing this to happen? I have not found any forums that address this problem.
 

JohanElzenga

Lightroom Guru
Staff member
Moderator
Lightroom Guru
Joined
Jul 2, 2015
Messages
8,261
Location
Netherlands
Lightroom Experience
Power User
Lightroom Version
Classic 7
You could try if something causes this by creating a new catalog. If that too gets corrupted, then indeed something may interfere. An incompatible plugin could be the culprit. If the new catalog is fine, then maybe your catalog got corrupted a longer time ago than you realized.
 

clee01l

Senior Member
Staff member
Moderator
Lightroom Guru
Joined
Jun 20, 2009
Messages
14,100
Location
Bellaire, TX USA
Lightroom Experience
Power User
Lightroom Version
Classic 7
Welcome to the forum. This is a dilemma. LR catalogs don't often get corrupted and when they do it is usually because the computer crashes or some other process managed to damage the catalog file while it was open and in an unstable state. This instability could have persisted through several backups so that these too are corrupt. Is LR offering to attempt to repair the catalog when you try to open it?
Can you send one or more of the catalog files (the most recent backup and maybe original) to me using the website wetransfer.com? The email address to send to is customer(dot)lee(at)att(dot)net
 

Janet Eschenlauer

New Member
Joined
May 28, 2017
Messages
16
Lightroom Experience
Advanced
Lightroom Version
A new catalog is not corrupted. So, I guess that the corruption occurred some time ago. The old catalog had collections in it. When I put files in the new catalog the collections are lost. Is that to be expected?
 

Janet Eschenlauer

New Member
Joined
May 28, 2017
Messages
16
Lightroom Experience
Advanced
Lightroom Version
Cletus Lee, I'll try to send a catalog file. Would it be all right to send a zip backup or should I unzip it and sent the catalog?
 

clee01l

Senior Member
Staff member
Moderator
Lightroom Guru
Joined
Jun 20, 2009
Messages
14,100
Location
Bellaire, TX USA
Lightroom Experience
Power User
Lightroom Version
Classic 7
A new catalog is not corrupted. So, I guess that the corruption occurred some time ago. The old catalog had collections in it. When I put files in the new catalog the collections are lost. Is that to be expected?
Collections live in the catalog database file. Like Develop adjustments they don't transfer. However you can re created the collections. Recreating the develop adjustments is more tedious. One of the things that I want to do if I get your catalog (should I be unable to open it) is to recreate the database file that is the catalog. I can do this with some database tools assuming that I can open the corrupt catalog file with the data base tools. It might be possible to extract the good records and leave the bad records.
 

clee01l

Senior Member
Staff member
Moderator
Lightroom Guru
Joined
Jun 20, 2009
Messages
14,100
Location
Bellaire, TX USA
Lightroom Experience
Power User
Lightroom Version
Classic 7
Cletus, I tried to send the files requested, but the email address that you provided did not work. The link for the oldest backup zip is 2016_MasterLRcat.lrcat.zip and 1 more file
I was able to open "2017_MasterLRcat.lrcat" and "2016_MasterLRcat.lrcat" with no difficulties. Are you running the latest update to LR, LRCC2015.10.1? Delete or rename your Preferences file to force LR to create a new one. Then try opening your master catalog file. We will get this resolved.
 

Janet Eschenlauer

New Member
Joined
May 28, 2017
Messages
16
Lightroom Experience
Advanced
Lightroom Version
Yes, I am running the latest update to LR LRCC2015.10.1
Where js the LR Preferences file? I have created a new catalog that is working fine. All I have to do is import all the photos. Maybe that is the way to go.
 

Janet Eschenlauer

New Member
Joined
May 28, 2017
Messages
16
Lightroom Experience
Advanced
Lightroom Version
By the way. I can open "2017_MasterLRcat.lrcat", but cannot make a backup. When I try to do that I get the message that the file is corrupted.
 

clee01l

Senior Member
Staff member
Moderator
Lightroom Guru
Joined
Jun 20, 2009
Messages
14,100
Location
Bellaire, TX USA
Lightroom Experience
Power User
Lightroom Version
Classic 7
Preferences is located at "/Users/{UserID}/Library/Preferences/com.adobe.Lightroom6.plist"

I tried backing up the file on exit and Had no problem there either.
Reset preferences as suggested and However, I did encounter the corrupt catalog problem when I tried to Optimise the catalog. Stay tuned...
 

clee01l

Senior Member
Staff member
Moderator
Lightroom Guru
Joined
Jun 20, 2009
Messages
14,100
Location
Bellaire, TX USA
Lightroom Experience
Power User
Lightroom Version
Classic 7
Well, I was unable to do any of my database magic on the file. And it is most unusual that the file will open in LR but can not be optimized either in the LR Edit menu or on close before backup. Victoria Bampton has a contact at Adobe that is more knowledgable about the database structure than I and has been successful on other corrupt catalogs. I've asked her to take a look and pass the file along. Also, I think Adobe would be most curious to understand why your catalog file is corrupt and LR will still open it for regular processing but not to backup the file.
 
Last edited:

Wernfried

Active Member
Joined
Jan 31, 2017
Messages
154
Lightroom Experience
Intermediate
Lightroom Version
Classic 7
Don't get into panic, you will recover your catalog!

I was able to find error and also fix it. Seems to be related to an internal SQLite bug, see How To Corrupt An SQLite Database File, 8.4. Database pages leak from the free page list

That is the error I get:
Code:
c:\Temp>sqlite3 2017_MasterLRcat.lrcat
SQLite version 3.12.0 2016-03-29 10:14:15
Enter ".help" for usage hints.
sqlite> pragma integrity_check;
*** in database main ***
On tree page 39489 cell 7: 1 of 2 pages missing from overflow list starting at 39499
On tree page 39489 cell 6: 1 of 2 pages missing from overflow list starting at 39497
Page 39496 is never used
Page 39498 is never used
sqlite> .quit

c:\Temp>
Dump SQLite DB and create new DB from it:
Code:
c:\Temp>sqlite3 2017_MasterLRcat.lrcat .dump | sqlite3 2017_MasterLRcat_new.lrcat
Check new catalog for errors:
Code:
c:\Temp>sqlite3 2017_MasterLRcat_new.lrcat
SQLite version 3.12.0 2016-03-29 10:14:15
Enter ".help" for usage hints.
sqlite> pragma integrity_check;
ok
sqlite> .quit

c:\Temp>

You can download SQLite command-line shell from here SQLite Download Page

However, I recommend you first try to get your problem solved with Adobe support. Consider this solution as second option.

Best Regards
 

Victoria Bampton

Lightroom Queen
Staff member
Administrator
Moderator
Lightroom Guru
Joined
Sep 29, 2007
Messages
20,831
Location
Southampton, UK
Lightroom Experience
Power User
Lightroom Version
CC Cloud
Victoria Bampton has a contact at Adobe that is more knowledgable about the database structure than I and has been successful on other corrupt catalogs. I've asked her to take a look and pass the file along.
It's on its way to the engineer and I'll let you know when I hear back.
 

clee01l

Senior Member
Staff member
Moderator
Lightroom Guru
Joined
Jun 20, 2009
Messages
14,100
Location
Bellaire, TX USA
Lightroom Experience
Power User
Lightroom Version
Classic 7
Dump SQLite DB and create new DB from it:
Thanks Wernfried. I had dumped the DB file and decided abandon my efforts and to turn it over to Adobe before I tried recreating the DB from the dump. Knowing that the usable data was available via the dump, I felt certain that everything important would be recoverable. Though I'm not certain what state of panic the OP might be in.
 

Janet Eschenlauer

New Member
Joined
May 28, 2017
Messages
16
Lightroom Experience
Advanced
Lightroom Version
Cletus and Victoria, I do appreciate your help, but am not sure I have the skills to follow your instructions. So, I have created a new catalog and am importing my photos. So far, whenever I finish importing a couple of folders , I can quit LR and backup the catalog without trouble. Luckily, I am not a professional and do not need the collections I created. They seem to be the only thing (besides time) that I have lost.
Thank you for your help,
Janet
 

Wernfried

Active Member
Joined
Jan 31, 2017
Messages
154
Lightroom Experience
Intermediate
Lightroom Version
Classic 7
Ok, make it simple. Download your repaired catalog from here: 2017_MasterLRcat.zip
Try to open it. If it does not work, go for manual creation.

Best Regards
Wernfried
 

Janet Eschenlauer

New Member
Joined
May 28, 2017
Messages
16
Lightroom Experience
Advanced
Lightroom Version
The repaired catalog opened and backed up as promised. Some feature such as the label colors and view have changed, but I think I can fix that. There are also some photos that evidently have been relocated and I'll have to fix that too. I think I'll be OK from here on. Thank you very much for all this help. I have lots of praise for Laura Shoe who suggested that I join the forum.
Best regards to all,
Janet
 

clee01l

Senior Member
Staff member
Moderator
Lightroom Guru
Joined
Jun 20, 2009
Messages
14,100
Location
Bellaire, TX USA
Lightroom Experience
Power User
Lightroom Version
Classic 7
Cletus and Victoria, I do appreciate your help, but am not sure I have the skills to follow your instructions. So, I have created a new catalog and am importing my photos
Victoria has sent your damaged catalog to Adobe t see if it can be repaired. There is a good chance that it can. I suggest not doing anything until we/you hear back from the Adobe engineer.
 

Janet Eschenlauer

New Member
Joined
May 28, 2017
Messages
16
Lightroom Experience
Advanced
Lightroom Version
Hi Cletus, Victoria had Wernfried send a repaired catalog. I was able to open it and back it up again, so it truly seems to be repaired. It did not include some of the changes I had made in photo data, but had all the collections in order. The main problem I have with it now is that I cannot get the choices of label color to show in the menu below the grid view of the library. Thanks again for staying with my catalog problem.
 

Victoria Bampton

Lightroom Queen
Staff member
Administrator
Moderator
Lightroom Guru
Joined
Sep 29, 2007
Messages
20,831
Location
Southampton, UK
Lightroom Experience
Power User
Lightroom Version
CC Cloud
Wernfried wasn't the engineer - just a helpful forum member - but I'm glad he was able to help. I'm still waiting to hear back from Paul the engineer.

If you look in the Metadata panel, do your label names show up there? If so, you just need to change the label set to match.
 

Wernfried

Active Member
Joined
Jan 31, 2017
Messages
154
Lightroom Experience
Intermediate
Lightroom Version
Classic 7
Well, I am a software engineer - but not working for Adobe. I use SQLite database even in some of my applications.
 

Janet Eschenlauer

New Member
Joined
May 28, 2017
Messages
16
Lightroom Experience
Advanced
Lightroom Version
Victoria and Wernfried,
I think all is well with my catalog. I cannot remember the date of the backup file that I sent because I kept going to earlier backups to see if one was not corrupt and I may have thrown away the newer backups. I lost some work done before the catalog would not work, but not much. I also have figured out how to see this label colors in the Filters bar.
Thank you for your help.
 

Victoria Bampton

Lightroom Queen
Staff member
Administrator
Moderator
Lightroom Guru
Joined
Sep 29, 2007
Messages
20,831
Location
Southampton, UK
Lightroom Experience
Power User
Lightroom Version
CC Cloud
Top