algorand / algorand/go-algorand
algod fails to restart with separate HotDataDir/ColdDataDir: "destination file .../stateproof.sqlite already exists, not overwriting"
- 主要言語
- Go
- スター
- 1.4k
- フォーク
- 537
- 平均マージ
- 1日 6時間
- マージ済み PR(30日)
- 17
説明
### Subject of the issue
I started an archival node with a config like so:
```
{
"Archival": true,
"ColdDataDir": "/var/lib/algorand-cold",
"HotDataDir": "/var/lib/algorand",
}
```
After adding `EndpointAddress` to the config and restarting, the node errors out trying to move the state proof DB from cold to hot:
`couldn't initialize the node: error moving stateproof DB files from ColdDataDir /var/lib/algorand-cold/mainnet-v1.0 to HotDataDir /var/lib/algorand/mainnet-v1.0: destination file /var/lib/algorand/mainnet-v1.0/stateproof.sqlite already exists, not overwriting`
### Your environment
algod v5.0.1 stable
Ubuntu 26.04.1 x86_64
### Steps to reproduce
1. Set `HotDataDir` and `ColdDataDir` to different directories. Leave `StateproofDir` and `CrashDBDir` unset.
2. Start algod. It starts, and creates `stateproof.sqlite` and `crash.sqlite` in the hot genesis dir.
3. Stop algod.
4. Start algod again. It exits with the error above.
### Expected behaviour
Node starts
### Actual behaviour
Node does not start
### Logs
Logs
```
{"Context":"Agreement","Hash":"","ObjectPeriod":0,"ObjectRound":0,"ObjectStep":0,"Period":0,"Round":1716414,"Sender":"","Step":0,"Type":"RoundInterrupted","Weight":0,"WeightTotal":0,"file":"demux.go","function":"github.com/algorand/go-algorand/agreement.(*demux).next","level":"info","line":310,"msg":"agreement: round 1716414 ended early due to concurrent write; next round is 1716415","time":"2026-09-12T22:12:21.534829+02:00"}
{"Context":"Agreement","Hash":"","ObjectPeriod":0,"ObjectRound":0,"ObjectStep":0,"Period":0,"Round":1716415,"Sender":"","Step":0,"Type":"RoundInterrupted","Weight":0,"WeightTotal":0,"file":"demux.go","function":"github.com/algorand/go-algorand/agreement.(*demux).next","level":"info","line":310,"msg":"agreement: round 1716415 ended early due to concurrent write; next round is 1716416","time":"2026-09-12T22:12:21.538715+02:00"}
{"Context":"Agreement","Hash":"","ObjectPeriod":0,"ObjectRound":0,"ObjectStep":0,"Period":0,"Round":1716416,"Sender":"","Step":0,"Type":"RoundInterrupted","Weight":0,"WeightTotal":0,"file":"demux.go","function":"github.com/algorand/go-algorand/agreement.(*demux).next","level":"info","line":310,"msg":"agreement: round 1716416 ended early due to concurrent write; next round is 1716417","time":"2026-09-12T22:12:21.547048+02:00"}
{"Context":"Agreement","Hash":"","ObjectPeriod":0,"ObjectRound":0,"ObjectStep":0,"Period":0,"Round":1716417,"Sender":"","Step":0,"Type":"RoundInterrupted","Weight":0,"WeightTotal":0,"file":"demux.go","function":"github.com/algorand/go-algorand/agreement.(*demux).next","level":"info","line":310,"msg":"agreement: round 1716417 ended early due to concurrent write; next round is 1716418","time":"2026-09-12T22:12:21.552645+02:00"}
{"instanceName":"","level":"info","msg":"/ApplicationState/Shutdown","session":"","time":"2026-09-12T22:12:21.553653+02:00","v":"5.0.1"}
{"Context":"sync","file":"service.go","function":"github.com/algorand/go-algorand/catchup.(*Service).fetchAndWrite","level":"info","line":384,"msg":"fetchAndWrite(1716426): Aborted while waiting for lookback block to ledger","name":"","time":"2026-09-12T22:12:21.564064+02:00"}
{"Context":"sync","file":"service.go","function":"github.com/algorand/go-algorand/catchup.(*Service).fetchAndWrite","level":"info","line":384,"msg":"fetchAndWrite(1716428): Aborted while waiting for lookback block to ledger","name":"","time":"2026-09-12T22:12:21.564149+02:00"}
{"Context":"sync","file":"service.go","function":"github.com/algorand/go-algorand/catchup.(*Service).fetchAndWrite","level":"info","line":384,"msg":"fetchAndWrite(1716427): Aborted while waiting for lookback block to ledger","name":"","time":"2026-09-12T22:12:21.564553+02:00"}
{"Context":"sync","file":"service.go","function":"github.com/algorand/go-algorand/catchup.(*Service).fetchAndWrite","level":"info","line":384,"msg":"fetchAndWrite(1716432): Aborted while waiting for lookback block to ledger","name":"","time":"2026-09-12T22:12:21.564623+02:00"}
{"Context":"sync","file":"service.go","function":"github.com/algorand/go-algorand/catchup.(*Service).fetchAndWrite","level":"info","line":384,"msg":"fetchAndWrite(1716433): Aborted while waiting for lookback block to ledger","name":"","time":"2026-09-12T22:12:21.564633+02:00"}
{"Context":"sync","file":"service.go","function":"github.com/algorand/go-algorand/catchup.(*Service).fetchAndWrite","level":"info","line":384,"msg":"fetchAndWrite(1716434): Aborted while waiting for lookback block to ledger","name":"","time":"2026-09-12T22:12:21.565324+02:00"}
{"Context":"sync","details":{"StartRound":0,"EndRound":1716419,"Time":8506201680955,"InitSync":true},"file":"telemetry.go","function":"github.com/algorand/go-algorand/logging.(*telemetryState).logTelemetry","instanceName":"","level":"info","line":230,"msg":"/ApplicationState/CatchupStop","name":"","session":"","time":"2026-09-12T22:12:21.567284+02:00","v":"5.0.1"}
{"Context":"sync","file":"service.go","function":"github.com/algorand/go-algorand/catchup.(*Service).sync","level":"info","line":779,"msg":"Catchup Service: finished catching up, now at round 1716419 (previously 0). Total time catching up 2h21m46.201680955s (exit: catchup service stopping: context canceled).","name":"","time":"2026-09-12T22:12:21.567433+02:00"}
{"file":"server.go","function":"github.com/algorand/go-algorand/daemon/algod.(*Server).Initialize","level":"info","line":225,"msg":"++++++++++++++++++++++++++++++++++++++++","time":"2026-09-12T22:12:34.852714+02:00"}
{"file":"server.go","function":"github.com/algorand/go-algorand/daemon/algod.(*Server).Initialize","level":"info","line":226,"msg":"Logging Starting","time":"2026-09-12T22:12:34.852846+02:00"}
{"file":"server.go","function":"github.com/algorand/go-algorand/daemon/algod.(*Server).Initialize","level":"info","line":233,"msg":"Telemetry Disabled","time":"2026-09-12T22:12:34.852875+02:00"}
{"file":"server.go","function":"github.com/algorand/go-algorand/daemon/algod.(*Server).Initialize","level":"info","line":235,"msg":"++++++++++++++++++++++++++++++++++++++++","time":"2026-09-12T22:12:34.852903+02:00"}
{"file":"main.go","function":"main.run","level":"error","line":381,"msg":"[Stack] goroutine 1 [running]:\nruntime/debug.Stack()\n\truntime/debug/stack.go:26 +0x5e\ngithub.com/algorand/go-algorand/logging.logger.Error({0xc0005460e0?, 0xc000088058?}, {0xc0005cac50, 0x1, 0x1})\n\tgithub.com/algorand/go-algorand/logging/log.go:225 +0x4f\nmain.run()\n\tgithub.com/algorand/go-algorand/cmd/algod/main.go:381 +0x26f7\nmain.main()\n\tgithub.com/algorand/go-algorand/cmd/algod/main.go:71 +0x52\n","time":"2026-09-12T22:12:34.853582+02:00"}
{"file":"main.go","function":"main.run","level":"error","line":381,"msg":"couldn't initialize the node: error moving stateproof DB files from ColdDataDir /var/lib/algorand-cold/mainnet-v1.0 to HotDataDir /var/lib/algorand/mainnet-v1.0: destination file /var/lib/algorand/mainnet-v1.0/stateproof.sqlite already exists, not overwriting","time":"2026-09-12T22:12:34.853726+02:00"}
```
### Workaround
Explicitly defining stateproof dir in config bypasses the issue:
```
{
"Archival": true,
"ColdDataDir": "/var/lib/algorand-cold",
"HotDataDir": "/var/lib/algorand",
"StateproofDir": "/var/lib/algorand",
"CrashDBDir": "/var/lib/algorand",
}
```
コントリビューションガイド
評価
この issue はまだ評価されていません。