Unable to create Arks (noid.bdb issue?)

Since recently I’m unable to add Items to my Omeka S. After some debugging this seems related to the Ark module by @Daniel_KM , the line Omeka-S-module-Ark/src/Name/Plugin/Noid.php at 31d6b5fd227978da7f276e7cbefcf006db4388cb · Daniel-KM/Omeka-S-module-Ark · GitHub to be exact: opening the NOID database. There’s no error thrown, nothing in the logs, is justs seems to halt.

The configuration page of the Ark module isn’t loading either.

The BerkeleyDB is present, albeit somewhat big, ./omeka-s-files/arkandnoid/NOID/noid.bdb is about 356MB.

@Daniel_KM Could the database be corrupt? If so, any pointers on how I can fix the database? Is deleting the noid.bdb an option (keep in mind I already have 900K Arks minted with NAAN 60537). Is there a migration path from BerkeleyDB to MariaDB available?

FYI (all latests versions): Omeka S v4.1.1, ARK module v3.5.15, php8.3-dba v8.3.9-1+0~20240708…

Using the db_util I’ve managed to ‘repair’ the noid.bdb file as follows:

$ db_verify noid.bdb 
db_verify: BDB0501 Page 86876: btree or recno page is of inappropriate type 0
db_verify: BDB0502 Page 86876: totally zeroed page
db_verify: BDB1087 Page 86876: Btree level incorrect: got 0, expected 1
db_verify: BDB0501 Page 86875: btree or recno page is of inappropriate type 0
db_verify: BDB0502 Page 86875: totally zeroed page
db_verify: BDB1087 Page 86875: Btree level incorrect: got 0, expected 1
db_verify: noid.bdb: BDB0090 DB_VERIFY_BAD: Database verification failed
BDB5105 Verification of noid.bdb.bak failed.
$ db_recover
$ db_dump -f noid.out noid.dbd
$ mv noid.dbd noid.old
$ db_load -f noid.out noid.dbd
$ db_verify boid.dbd
BDB5105 Verification of noid.bdb succeeded.

However, when saving an Item there’s an error in the log (so did the ‘repair’ above succeed / was this the right way to repair???) which seems tot indicate that $ark = \Noid::mint($noid, $contact) failed:

TypeError: strlen(): Argument #1 ($string) must be of type string, null given in [..]/Ark/src/Name/Plugin/Noid.php:71
Stack trace:
#0 [..]/Ark/src/Name/Plugin/Noid.php(71): strlen()
#1 [..]/Ark/src/ArkManager.php(391): Ark\Name\Plugin\Noid->create()
#2 [..]/Ark/Module.php(324): Ark\ArkManager->createName()
#3 [..]/Ark/Module.php(282): Ark\Module->addArk()

So I still can’t save items with arks like I used to…

The Ark/vendor/daniel-km/noid4php/noid dbinfo command on both my old AND recovered noid.bdb files both show the following:

Admin Values

I hope there’s some way of re-creating the noid.dbd file from the Ark data which is still in the omeka.value table @Daniel_KM ?

As a solution to my “corrupted noid database” I have deleted the noid.dbd file and created a new one (via the module configuration) where I changed the identifier template to be one alphanumeric character (l) longer. This way there won’t be duplicates with the already 900K published ARK identifiers.

I have no idea how the BerkeleyDB got corrupted and am disappointed that is seemed to be beyond repair. I hope the ARK module will make use of MariaDB in the future, noidphp already seems ready. This would mean no dependency on BerkeleyDB, but an already in use MariaDB. Of course this would mean, the module should also provide a migration option (from BerkeleyDB to MariaDB).