DAPI nil pointer dereference crash when chain RPC is unavailable #422
Problem: DAPI crashes when chain node RPC becomes temporarily unavailable (I/O errors, restarts, network issues)
Root Cause: Missing return statement after error in tryClaimingTaskToAssign() function
** Timeline: **
00:06:26 - Chain node I/O error (trigger)
CONSENSUS FAILURE: error writing batch to DB
"sync /workspace/gonka-data/chain/data/blockstore.db/002855.log:
input/output error"
Chain RPC temporarily stops responding to connections
00:06:26 - DAPI attempts to query chain status
ERROR: [training-task-assigner] Failed to query chain status
err="post failed: Post \"http://localhost:26657\": EOF"
Function logs error but CONTINUES EXECUTION (BUG!)
00:06:26 - Nil pointer dereference
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x3edaae2]
Fix:
💬 Comments (2)
hi @mfursov, I'd like to propose a bounty for reporting this issue and proposing a fix. reached out to you via email
🔄 Auto-synced from Issue #422 every hour.
Fixed in PR #639 - added missing return statement after error to prevent nil pointer dereference.