spent-addresses-db folder has no sst files
Bug description
unable restart IRI after it is synced. (1.5.6 has no such problem)
IRI version
latest dev 1.6.1, 1.6.0
Hardware Spec
ubuntu-1804, digital ocean vps or home dell xps
Steps To Reproduce
- bring up private testnet, with IOTA transactions
- wait until IRI synced,
- stop then start IRI
Expected behaviour
IRI able to start and continue to run
Actual behaviour
IRI stopped,
Errors
02/25 02:57:37.972 [main] INFO com.iota.iri.IRI$IRILauncher - Welcome to IRI Testnet 1.6.1-RELEASE
Exception in thread "main" com.iota.iri.service.spentaddresses.SpentAddressesException: spent-addresses-db folder has no sst files
at com.iota.iri.service.snapshot.impl.SnapshotProviderImpl.assertSpentAddressesDbExist(SnapshotProviderImpl.java:246)
at com.iota.iri.service.snapshot.impl.SnapshotProviderImpl.loadLocalSnapshot(SnapshotProviderImpl.java:212)
at com.iota.iri.service.snapshot.impl.SnapshotProviderImpl.loadSnapshots(SnapshotProviderImpl.java:187)
at com.iota.iri.service.snapshot.impl.SnapshotProviderImpl.init(SnapshotProviderImpl.java:102)
at com.iota.iri.Iota.injectDependencies(Iota.java:202)
at com.iota.iri.Iota.
This is a loophole in the protection mechanism against loading local snapshots with not spent-addressses db
I'm hitting this issue as well. There seem to be a period of time which local snapshot files are present on disk, but no spent-address-db SST files are available on disk.
find . -name "snapshot"
./testnet.snapshot.state.bkp ./testnet.snapshot.state ./testnet.snapshot.meta ./testnet.snapshot.meta.bkp
find spent-addresses-db
spent-addresses-db spent-addresses-db/OPTIONS-000006 spent-addresses-db/IDENTITY spent-addresses-db/OPTIONS-000008 spent-addresses-db/MANIFEST-000004 spent-addresses-db/000003.log spent-addresses-db/CURRENT spent-addresses-db/LOCK
It there a way to fix this issue?
A quick workaround that may work is to delete the snapshot files (state and metadata)
If I use docker it's not so simple. I disabled snapshots and waiting a couple hours for resyncing... Why IRI fails on every Exception?
This is a feature to make sure you don't run IRI without the spent-addresses-db
I know that @geminoz encountered this bug on devnet.
The other people who are experiencing this issue are on mainnet?
Currently on mainnet we are serializing the previousSpentFromEpoch file to the db on startup so no sst files should go missing.
The problem on devnet is that there may be lots of spam without actual spents. So after a snapshot the spent-addresses-db can still be empty
We attempt to check whether we have a good spent-addresses-db file when starting a db from Local Snapshot files. So we check whether there are any serialized sst files. However, when we do testing with a private tangle where we may have many milestones and less spam transactions, we may end up with no sst files since RocksDB didn't serialize them and the data is kept in the WAL (Write ahead Log).
would transfer 1 iota trigger the creation of spent-addresses-db/
- We need to read from the DB and not check sst files
- For testnet/private network maybe we should just ignore this rule all together