I'm using v.22 of the bitcoin core client on an old Windows box. I have the data directory set to use my NAS and have used it successfully in this configuration for several years.
The debug.log contains the following:
-------------------------------------------------------------------------------------
2022-08-24T19:06:30Z Opening LevelDB in F:\Bitcoin\blocks\index
2022-08-24T19:06:30Z Fatal LevelDB error: IO error: F:\Bitcoin\blocks\index/CURRENT: Access is denied.\x0d
2022-08-24T19:06:30Z You can use -debug=leveldb to get more complete diagnostic messages
2022-08-24T19:06:30Z Fatal LevelDB error: IO error: F:\Bitcoin\blocks\index/CURRENT: Access is denied.\x0d
2022-08-24T19:06:30Z : Error opening block database.
-------------------------------------------------------------------------------------
I have tried deleting the CURRENT file but that caused some other kind of early abnormal termination of the bitcoin client program so I replaced it. I also tried rolling the data directory back in time a couple months using an incremental backup from my NAS, to no avail: I get the same error afterwards. I also tried the -reindex option but that also errors out with the same message. I see the following in debug.log after trying with the -reindex option:
-------------------------------------------------------------------------------------
2022-08-24T19:25:01Z init message: Loading block index…
2022-08-24T19:25:01Z Switching active chainstate to Chainstate [ibd] @ height -1 (null)
2022-08-24T19:25:01Z Opening LevelDB in F:\Bitcoin\blocks\index
2022-08-24T19:25:01Z Fatal LevelDB error: Corruption: 53 missing files; e.g.: F:\Bitcoin\blocks\index/001702.ldb
2022-08-24T19:25:01Z You can use -debug=leveldb to get more complete diagnostic messages
2022-08-24T19:25:01Z Fatal LevelDB error: Corruption: 53 missing files; e.g.: F:\Bitcoin\blocks\index/001702.ldb
2022-08-24T19:25:01Z : Error opening block database.
Please restart with -reindex or -reindex-chainstate to recover.
2022-08-24T19:25:08Z init message: Loading block index…
2022-08-24T19:25:08Z should not be overwriting a chainstate
2022-08-24T19:25:08Z Error: Error opening block database
2022-08-24T19:25:09Z Shutdown: In progress...
2022-08-24T19:25:09Z scheduler thread exit
2022-08-24T19:25:09Z Shutdown: done
-------------------------------------------------------------------------------------
Can anyone suggest a way that might let me recover from this error? For whatever reason, I'm pretty sure it will take my hardware days or more likely, months, to re-download the blockchain. That's why I keep it on the NAS with multiple generations of backups.