Unhappy database - always opens read-only - lots of inconsistencies

One of my many (encrypted) DT databases started spontaneously generating errors when I try to open it.

No system failures have taken place, no crashes, loss of power, etc. The .sparseimage opens fine, and filesystem level permissions are set correctly.

A “verify and repair” results in:
Found 20833 inconsistencies, 0 invalid filenames, 0 missing and 0 orphaned files.

However, I’m not sure what those inconsistencies are. Once this appears, the database is open, but, read-only (pencil with line through it next to database name in the main viewer).

I’ve tried the tips in the built-in Help, but this particular database just seems unhappy.

To work around the problem, I created another encrypted database and copied groups from the old database to the new one - eventually, one group behaved oddly during this process, silently failing with no errors in the Log or Activity panels. For example, if the group had 2000 items in it, and I dragged it with option held down to the new DB, the items did not copy. For all other groups, this worked fine.

I then went to the per-item level, grabbing about 100 to 200 items in a go, and copied them (option dragged) to the new group in the new database. No errors were reported, and all visible items made it to the new database.

I’ve repeatedly verified the new database and made sure it seems fine, and I’m happy enough with this workaround, but, I’m wondering if there’s anything I can do about the “broken” database.

I did try to “Rebuild” it on one of the attempts to deal with the issue, but, nothing seemed to change, and no feedback appeared – I also do not know how long that process takes.

The database, on disk, is 10GB (as defined when I created the encrypted database), but it’s only utilising about 4.3GB in Database Properties.

Appreciate any thoughts from those who may have encountered something like this before!

Is there enough space left on the encrypted sparse image? You could also try this:

  1. Change the extension of the encrypted database from .dtSparse to .sparseimage
  2. Mount the sparse image in the Finder by double-clicking on it and entering the encryption key
  3. Copy the .dtBase2 database from the mounted volume to the desktop
  4. Now launch DEVONthink and open only the just copied database and try to rebuild it (see File > Rebuild Database…)

Is rebuilding successful?

Are you indexing or importing files into the database?

Thank you both, @cgrunenberg and @BLUEFROG for pointing out some areas to look at.

I believe that it was a combination of the issues you both called out.

I suspect that at some point in the past I indexed rather than imported files - this was an old email archive, and I have a vague memory of using Mail.app to export folders to a directory on my system, and using DT to index that data.

That may well account for the inconsistencies error of late.

Simultaneously, I added more data into the database, and even though 10GB was the size of the sparse image, and DT said I was using 4.3GB in Database Properties, when I opened the .sparseimage (no need to rename, it was already called that), and copied the .dtBase2 file to a local drive, it was closer to 9.4 GB.

Regardless, by copying the data elsewhere, I was able to Rebuild it, pass all verification, and eventually put it back on a new 20GB disk image. Various opens/closes later, all good.

Thank you both very much!


That’'s just the size of the indexed/imported files but the database includes also search index, metadata and backups.