Catalog corruption!

Discussions, questions, comments and suggestions regarding Capture One PRO, Capture One PRO(For Sony), Capture One DB and Capture One Express(For Sony) 9.x

Re: Catalog corruption!

Postby NN635680879799322049UL » Sun Apr 09, 2017 5:11 pm

Very fancy for those familiar with SQL. If you backup very frequently, like as often as you make changes, you can easily restore functionality by copying the last cocatalogdb from the latest backup to replace the corrupted one in the cocatalog package.

Jerry C
Posts: 124
Joined: Sun May 24, 2015 7:12 pm

Re: PLEASE HELP!! Catalog corruption. Desperate for a fix

Postby NNN636580498262416654 » Fri Mar 30, 2018 10:44 pm

Aaron M wrote:Thanks, Bernd. I actually happen to cross paths with a programmer online yesterday who was able to run the corrupt catalog file through some of his software, which fixed whatever was causing the issue. Amazing. All my work is there just like how I left off. Probably took him 2 minutes to fix it, and saved me from having to redo the last 5 days worth of work.

On the other hand, Phase One Capture One technical support was utterly useless. I sent them a message explaining what happened along with the catalog file, and asked if there is any way this can be repaired, and they responded with just "you should backup your catalog", without addressing my question or offering any further support. I do backup my catalog once per week as the program suggest by default, but that doesn't account for the last 5 days of work when a catalog file goes bad. Lesson learned that it should be backed up every day.

But even a days worth of work can be a lot to lose. Instead, perhaps Phase One should build more reliable software, or at least something built in to automatically safeguard their users from losing the relatively simple, yet time consuming adjustments made to raw files when their buggy software fails.

As I said, I've been using Lightroom for 8 years and never had a file go bad. I didn't think it was really necessary to have to build a backup catalog every single day, which seems like overkill. I know a lot of photographers, and none of them do it that often.

Clearly, the database of information was still there in the "corrupt" catalog file. It was probably just a matter of a couple lines of code that were off, but for some reason, Capture One's catalog verify/repair tool isn't sophisticated enough to retrieve any of the data.

Point is - if this same glitch happens to anyone else, you can expect Phase One's tech support to leave you high and dry, but there are other people out there who may be able to help.

Hi Aaron,

I have encountered a very similar situation and need to deliver photos this Sunday. Do you have an idea how I could get in touch with a programmer, and what was done to the catalog file? Please help me out! Thanks in advance!
Posts: 2
Joined: Sat Mar 31, 2018 12:37 am

Re: Catalog corruption!

Postby NNN636580498262416654 » Fri Mar 30, 2018 11:10 pm

Daniel Evans wrote:I have just gone through my own catalog corruption, and managed to solve it. In my case, on macOS Sierra, I opened up my "Main" Catalog in Capture One Pro (Sony). Upon opening the catalog, the application froze, I had the spinning beachball of death, and after waiting several minutes, I decided it must have simply hung, so I force-quit and relaunched it. Upon relaunching, I got the following error:

"Database connection FAILED. The requested document type is not recognized. The provided database is of an unknown type"

By using the Finder (Windows explorer for Windows users) I was able to locate my catalog, in the location I originally saved it when I created it. I then right clicked and selected "Show package contents" (On windows, I think the Catalog files are all in a folder in the location you saved your catalog in to start with). This showed me the catalog files. Inside, there were the following files:
-The catalog file itself, which is the name I gave it with ".cocatalogdb" appended to the end.
-Two folders, "Adjustments" and "Cache"
-A file called "writelock"
-A file with the same name as the catalog file, with -journal on the end

The folders and catalog file are normal.

The "writelock" file is normal, if you are looking in this location when the catalog is currently open in Capture One that is. If you do not have Capture One open and there is a "writelock" file, it means the catalog did not close down properly last time it closed, and Capture One didn't delete this file like it should because of that. What this file does, is to lock out anyone else trying to open the catalog at the same time as you, say for instance another user. If if two people tried to edit the catalog at the same time, this could result in corruption, so the way Capture One handles this is to show an error message and not let you open the catalog if there is a "writelock" file in the catalog folder. The "writelock" file should be deleted whenever the catalog successfully closes, so that the next user to open the catalog is able to do so. If the "writelock" file is not deleted, then although nobody actually has the catalog open, Capture One will think somebody does, and will not let you open it. So the fix for this is, if you have a "writelock" file and the catalog is not currently open anywhere else, move the "writelock" file to the trash.

The other problem file is the file named the same as the library file, with "-journal" appended. Eg, for my catalog named "Main", this file was called "Main.cocatalogdb-journal". This is where the main problem in my case was stemming from. This file is generated when a "transaction" is being processed with the main catalog file (which is an SQL database, and this -journal is a function of SQL databases called "hot journaling"). A "transaction" is effectively Capture One trying to update something in the database. It may be many things. From what I understand, this "-journal" file serves as a "rollback" or "backup" for whatever data is being changed in the database, in case something goes wrong with the transaction. It is only created when Capture One tries to change something in the database, exists as long as the database is being written to, and then is deleted when the database has been successfully updated. If, like me, you have this file present when your catalog is not open in Capture One, it means when the catalog last closed, it was in the middle of a "transaction". Now, when you try and open your catalog in Capture One, it will give you errors, because the database was halfway through writing when it was last shut down, and is now effectively corrupt. The "-journal" file is our saviour now, as it holds the critical information to "rollback" the half completed "transaction" information in the catalog. The key is to get these transactions rolled back using the info from the "-journal" file. This is where I would expect Capture One to be able to repair it's own catalog, as all the information is there. For some reason though, Capture One hasn't been built to be able to rollback transaction errors using the "-journal" file, so we must use a different SQL application to open the database. In my case, I used an open-source application called "DB Browser for SQLite". I believe they have a version for Windows, as well as the MacOS version I used. It can be downloaded at the following link:

Steps to repair database using "DB Browser for SQLite"
1.) Copy your whole catalog to a new location, to serve as a backup. This means the file you right clicked and clicked "Show Package Contents" on in the steps above, NOT the much smaller sized ".cocatalogdb" file inside the this location.
2.) Make a new empty folder on your desktop, what you call it doesn't matter.
3.) Once the catalog has finished copying, right click on the original catalog (not the copied one, the copied one is just a backup) and select "Show Package Contents".
3.) Move the "(your catalog name).cocatalogdb" and the "(your catalog name).cocatalogdb-journal" files to the empty folder on the desktop you made in step 2
4.) Launch "DB Browser for SQLite", then in the menu bar, select "File", "Open Database".
5.) Select the catalog file in the folder on the desktop, and click open.
6.) The catalog database will now open. Once it has opened, you can close "DB Browser for SQLite". The magic has already happened, just by opening the catalog file with this program!
7.) If you look in the folder on the desktop, you should now find that the "(your catalog name).cocatalogdb-journal" file has disappeared. There should only be one file in the folder now, "(your catalog name).cocatalogdb". If this is the case, you have been successful so far.
8.) Now, right click on the original catalog and select "Show Package Contents" once more
9.) Inside the catalog, move the "(your catalog name).cocatalogdb" and "(your catalog name).cocatalogdb-journal" files to the trash (also the "writelock" file if there is one).
10.) Lastly, move the "(your catalog name).cocatalogdb" file from the folder on the desktop into the catalog (where you just trashed the files from).
11.) You should now be able to successfully open the catalog. If you do so, BACKUP THE CATALOG and make good habits to back up often! Congratulations on saving your ass! :)

Hope this helps somebody, I am personally so relieved to have fixed my catalog, I will now always back up religiously :)

Hi Daniel,

I'm glad you have been able to resolve this issue. Unfortunately I am having trouble at step 5, the SQL software is asking for a password for SQLCipher Encrpytion. I cant do anything after that unless I put the right code. I am using Capture One 10 and have no backup unfortunately. So far every step I followed came up to be the same as your steps, like the write lock and the journal file.. but the encryption part is themessed up part.

Please let me know if you have any ideas. Im in dire need to finish this by sunday. I have already restarted working on the whole thing (5000 photos taken in a 4 day indian wedding)
Posts: 2
Joined: Sat Mar 31, 2018 12:37 am

Re: Catalog corruption!

Postby NN635629347110134711UL » Thu Jul 19, 2018 5:33 pm

Hi Aaron

I have the exact same problem with you right now and I need help. I have been working on the session for 3 days and all the files and folders are gone.
Can you give me contact of the programmer who helped you please?

Thank you!
Posts: 2
Joined: Thu Mar 26, 2015 3:45 am


Return to Capture One 9.x Software

Who is online

Users browsing this forum: No registered users and 2 guests