[BUG] - The cardano-node crashes when an immutable file is missing
维护者通常 2 天内回复
还没有人认领这个 Issue。
评估
调研方向
从 trace 中显示的不可变数据库索引路径开始,重点查看 Ouroboros/Consensus/Storage/ImmutableDB/Impl/Index/Primary.hs、Cache.hs 和 Index.hs,并在不可变文件不可用时跟踪 readOffsets。在请求较旧区块的同时,使 db/immutable 下的一个文件无法访问,以复现该问题。完成的标准是节点报告错误并继续运行,而不是崩溃或重复关闭数据库。
由索引模型根据 Issue 内容生成。
描述
External
Area
Other
Summary
When a peer requests an older block, and the immutable file containing that block is not accessible on the local file system, the node crashes.
Steps to reproduce
Steps to reproduce the behavior:
- Move the immutable files from their location
- Wait until such an event occurs (can take a few days)
- See the node crashing and the messages in the logs
Expected behavior
The node should return an error message and continue running.
System info (please complete the following information):
- OS Name: Ubuntu]
- OS Version: e.g. 24.04
- Node version: cardano-node 10.5.3 - linux-aarch64 - ghc-9.6 git rev 6c034ec038d8d276a3595e10e2d38643f09bd1f2
- CLI version: cardano-cli 10.11.0.0 - linux-aarch64 - ghc-9.6 git rev 6c034ec038d8d276a3595e10e2d38643f09bd1f2
The OS, node and cli versions are irrelevant here.
Screenshots and attachments
This is a log file snippet with such a crash:
[relay5:cardano.node.DiffusionInitializationTracer:Critical:7] [2025-12-08 23:38:08.03 UTC] DiffusionErrored ExceptionInHandler 185.19Type = FsResourceDoesNotExist, fsErrorPath = /home/cardano/cardano-node/db/immutable/02258.primary, fsErrorString = "No such file or drom HasCallStack):
prettyCallStack, called at src/System/FS/API/Types.hs:393:23 in fs-api-0.3.0.0-b19f75df8cf0ad4f95eb6d965255bf9a46056a0239d2d1b004e8d
ioToFsError, called at src/System/FS/IO.hs:113:41 in fs-api-0.3.0.0-b19f75df8cf0ad4f95eb6d965255bf9a46056a0239d2d1b004e8d30ef8eba9b2
handleError, called at src/System/FS/IO.hs:109:23 in fs-api-0.3.0.0-b19f75df8cf0ad4f95eb6d965255bf9a46056a0239d2d1b004e8d30ef8eba9b2
rethrowFsError, called at src/System/FS/IO.hs:50:21 in fs-api-0.3.0.0-b19f75df8cf0ad4f95eb6d965255bf9a46056a0239d2d1b004e8d30ef8eba9
hOpen, called at src/System/FS/API.hs:216:43 in fs-api-0.3.0.0-b19f75df8cf0ad4f95eb6d965255bf9a46056a0239d2d1b004e8d30ef8eba9b2:Syst
withFile, called at src/ouroboros-consensus/Ouroboros/Consensus/Storage/ImmutableDB/Impl/Index/Primary.hs:293:5 in ouroboros-consens6eb7c29c52:Ouroboros.Consensus.Storage.ImmutableDB.Impl.Index.Primary
load, called at src/ouroboros-consensus/Ouroboros/Consensus/Storage/ImmutableDB/Impl/Index/Cache.hs:477:21 in ouroboros-consensus-0.29c52:Ouroboros.Consensus.Storage.ImmutableDB.Impl.Index.Cache
readPrimaryIndex, called at src/ouroboros-consensus/Ouroboros/Consensus/Storage/ImmutableDB/Impl/Index/Cache.hs:556:35 in ouroboros-1d659a66eb7c29c52:Ouroboros.Consensus.Storage.ImmutableDB.Impl.Index.Cache
loadPastChunkInfo, called at src/ouroboros-consensus/Ouroboros/Consensus/Storage/ImmutableDB/Impl/Index/Cache.hs:602:26 in ouroborosf1d659a66eb7c29c52:Ouroboros.Consensus.Storage.ImmutableDB.Impl.Index.Cache
getChunkInfo, called at src/ouroboros-consensus/Ouroboros/Consensus/Storage/ImmutableDB/Impl/Index/Cache.hs:671:11 in ouroboros-cons9a66eb7c29c52:Ouroboros.Consensus.Storage.ImmutableDB.Impl.Index.Cache
readOffsets, called at src/ouroboros-consensus/Ouroboros/Consensus/Storage/ImmutableDB/Impl/Index.hs:199:31 in ouroboros-consensus-0c29c52:Ouroboros.Consensus.Storage.ImmutableDB.Impl.Index
readOffsets, called at src/ouroboros-consensus/Ouroboros/Consensus/Storage/ImmutableDB/Impl/Index.hs:53:5 in ouroboros-consensus-0.29c52:Ouroboros.Consensus.Storage.ImmutableDB.Impl.Index
a use of `readOffsets', called at src/ouroboros-consensus/Ouroboros/Consensus/Storage/ImmutableDB/Impl/Index.hs:130:5 in ouroboros-cd659a66eb7c29c52:Ouroboros.Consensus.Storage.ImmutableDB.Impl.Index, fsLimitation = False}))
[relay5:cardano.node.ChainDB:Error:7] [2025-12-08 23:38:08.03 UTC] Immutable DB was already closed. Double closing.
[relay5:cardano.node.ChainDB:Info:7] [2025-12-08 23:38:08.03 UTC] Closed Volatile DB.
[relay5:cardano.node.ChainDB:Info:7] [2025-12-08 23:38:08.03 UTC] Closed db with immutable tip at 5b9fba6656bf5c1f6423d0db814415879118c0ad04086b1a8722e25c240855e033a16603f61d2a2d42265c5fd at slot 173670795
Additional context
The error occurs when the files in the db/immutable folder are not available (for example, another partition is mounted on it - maybe a slower and cheaper storage type, and the partition is not mounted at the time when this error occurs).
- 主要语言
- Haskell
- 星标
- 3.2k
- 派生
- 764
- 平均合并
- 3 天 2 小时
- 30 天内合并 PR
- 22
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
IntersectMBO/cardano-node 的其他 Issue
-
Stale
难度 1/5 1-3 小时 新手友好度 75/100
IntersectMBO/cardano-node#6597 · 1 条评论 ·
维护者通常 2 天内回复
-
难度 2/5 1-3 小时 新手友好度 82/100
IntersectMBO/cardano-node#6522 · 3 条评论 ·
维护者通常 2 天内回复
-
难度 4/5 3-5 天 新手友好度 45/100
IntersectMBO/cardano-node#6755 · 1 条评论 ·
维护者通常 2 天内回复
-
Dijkstra PV12 needs triage type: regression
难度 5/5 一周以上 新手友好度 12/100
IntersectMBO/cardano-node#6748 ·
维护者通常 2 天内回复
-
[cardano-testnet] Enhancements for status command可能已有人在做 @palas 于 9 天前认领。 未关闭
IntersectMBO/cardano-node#6747 · 已指派 1 人 ·
维护者通常 2 天内回复
查看 IntersectMBO/cardano-node 的全部 Issue
相似的 Issue
-
enhancement triage
难度 1/5 1-3 小时 新手友好度 66/100
simplex-chat/simplex-chat#8043 ·
维护者通常 1 天内回复
-
area:zones rules-correctness
难度 2/5 1-3 小时 新手友好度 78/100
-
needs triage type: bug
难度 2/5 1-3 小时 新手友好度 67/100
维护者通常 3 天内回复
-
validateXmirOptions error message is missing the word 'option'可能已有人在做 @opusstudiohq-max 于 1 天前认领。 未关闭
难度 1/5 1 小时以内 新手友好度 90/100
objectionary/phino#2256 ·
维护者通常 1 天内回复
-
30-minutes algorithm any-language codewars dart easy elixir hackerrank hacktoberfest haskell help wanted interview-prep julia leetcode lua open-source r scala students zig
难度 2/5 1-3 小时 新手友好度 68/100
Huerte/algo-solutions-python#163 ·
维护者通常 1 天内回复