Verify & Repair failed on Catalina with encrypted database

Hi all,

This is the first time I encountered serious database issues after years of use, I didn’t found other cases like this so here I am.

Here are what happened:

  1. The Mac complains “The application X is not open anymore” whenever I open any application
  2. I found that the file descriptors seem to be exhausted due to the existing of a large number of cron processes(this occurred on another Catalina device of mine too)
  3. I closed some applications(to save some fds) then opened the terminal and disabled all my cron jobs
  4. I rebooted the Mac through the top-left Apple icon(however I guess there are applications quitted forcibly due to not responding)
  5. After reboot, I opened DT3 and it suggests me to do a Verify & Repair
  6. I kept the V&R running for a night(it didn’t finish nor respond after an hour), in the morning the result is a fail, there are thousands of missing files, 0 orphans as I recall
  7. I tried V&R again, it finished quickly with the same result
  8. I closed all databases then relaunched DT3
  9. V&R again, and it turned out success(the result is the same after I repeat step 8 to 9)

I was expecting a failure on step 9, so I could try to do a restore from a backup as the manual suggested.

My questions are:

  1. Do I have to be worried about anything, is the database really repaired?

The missing files in the log are cleared so I can’t manually verify if the missing files are there.

  1. Since the index and the actual data files are stored separately, if the V&R success there should be no problem, but how does the index files got repaired all by itself?

Environment:

  • macOS 10.15 (19A602)
  • DEVONthink Pro Edition 3.0.1

Sounds like an issue of Catalina and/or the cron jobs. What kind of jobs do you use and how many?

If should be fine if no more errors are reported. You could also rebuild the database, just to ensure that there’s definitely nothing wrong anymore. And of course a good backup strategy is also highly recommended, especially but not only on Catalina.

Actually the index doesn’t repair itself. Are the indexed files located on an external or network volume? Was is mounted and responsive? Or maybe it was just another of the way too many Catalina issues.

Just one, it’s a script to sync the brightness of builtin display and external ones, no file system involved.

So rebuild is that safe since the data files are never touched?

The database in on the internal disk of the Mac, however, it’s an encrypted database which is implemented as a mounted volume.

Rebuilding doesn’t change any data.

There’s an alert that the database is already opened by another instance of DT3 while the rebuilding process is going on and I clicked cancel, then my database becomes empty, after a round of V&R, all my files are now in a single directory named “Orphaned Files”, all the directory structures are gone.

I tried to restore from the latest backup, but “switching to backup of database failed”.

I’m super worried, what should I do?

It’s hard to tell what the initial macOS/cron issue actually corrupted but you could try this:

  1. Change the extension from .dtSparse to .sparseimage
  2. Mount the disk image in the Finder
  3. How much disk space is available on the volume?
  4. Copy the database from the mounted volume to the desktop
  5. Unmount the volume again
  6. Create a copy of the database that was copied to the desktop
  7. Open this copy
  8. Try to restore the backup

Capacity: 5.02 GB
Available: 2.55 GB (46 MB purgeable)

Thank you!
The directory structures seem back, but the icons on the directories are gone, this is interesting why is that?

Well, this window is blinking like crazy, it seems that logs are created at a very high rate.

These are sync issues, where is the sync store located? iCloud?

Both iCloud and a WebDAV server

It’s probably the iCloud sync location, the sync store might be damaged due to the original issues too. I would suggest to clean this sync store (see contextual menu in Preferences > Sync).

Can I restore from the server somehow? The version on the server are intact.

Guess not, the data on the server are doomed.

Only if you’ve disabled the sync right after the first issue.

The “clean” is disabled.

Can I restore the icons as well? is anything other than the icons lost during the process?

Impossible to tell after all these attempts, I would suggest to have a closer look at the database and whether everything’s still there. And a screenshot of the icon issue would be useful.

It’s the customized icon of the directory, they are now back to default like this:
image

It was probably lost during the recovery. I’m not even sure whether the Catalina installation is still fine or whether a complete reinstallation would be better. But first I would highly recommend a good backup strategy of all your data (not only databases).

I have TimeCapsule enabled, but that’s too old

Wow, I recovered the database in the TimeMachine and opened it, guess what? The icons are back on both databases! Can I merge these two databases so I can get a union of the two?