Skip to content

node: a transient RPC error during a boot-time chain read exits the daemon, so a flaky provider turns every restart into a crash-loop #2159

Closed

Description

@thiras

Component: node (decdn-node daemon)

Version: e229c2b4 (also seen on 891196e5)

Operating system: Ubuntu 26.04 x86_64, systemd unit (Restart=always), 7-node fleet sharing one RPC endpoint

Steps to reproduce

  1. Run decdn-node against an RPC provider that intermittently returns JSON-RPC errors (ours returned error code 1: no available upstreams to process the request and error code 19: Temporary internal error. Please retry).
  2. Restart the node (a routine binary upgrade is enough).

Expected behavior

A transient provider error during startup is retried in-process with bounded backoff, the way the running node already handles the same errors: the live tail logs multiplexed poller tick error; restarting after backoff, and the periodic blacklist re-enumeration logs periodic re-enumeration failed; keeping the current deny-set. The node keeps failing closed (the ALPN router stays gated on blacklist_ready_rx, so nothing is served before the deny-set is loaded), but it does not exit.

Actual behavior

Every boot-time chain read is propagated with ? out of run() (crates/node/src/runtime/mod.rs), so any single RPC error ends the process with node run failed and exit status 1:

Boot read Call site
CapacityBond registry bootstrap (getRegisteredNodes) runtime/mod.rs:911
slash-detection watcher (pausedTotal, operatorSlashCount) runtime/mod.rs:939
PaymentPool settlement service bootstrap (PaymentPool.usdc() self-check) runtime/mod.rs:1391
blacklist compliance watcher boot enumeration (blacklistedAddressCount, blacklistedHashCount) runtime/mod.rs:1421

Because these reads run one after another and all of them have to succeed in the same attempt, a provider with even a modest error rate makes a clean boot unlikely. After two upgrades on 2026-09-25 (all 7 nodes restarted each time):

Upgrade Restarts before staying up Longest time to recover
→ 891196e5 2–87 per node (ash1 86, nbg1 87, fra1 58) ~13 min
→ e229c2b4 4–59+ per node 4 of 7 nodes still crash-looping ~7 min after the deploy, at time of writing

Each crash-loop pass also re-binds the iroh endpoint (Endpoint dropped without calling Endpoint::close. Aborting ungracefully.) and hits the provider with a fresh burst of boot reads, which does not help a provider that is already struggling. Our systemd unit happens to restart indefinitely. A deployment with a tighter StartLimitBurst, or Kubernetes CrashLoopBackOff (whose restart delay grows to 5 min), would stay down far longer or give up.

The runtime/mod.rs:927 comment says the slash-watcher enumeration is fatal on purpose, "like the CapacityBond registry bootstrap above", so it "adds no new failure mode". That is true per read, but the failure modes add up: each fatal read adds one more RPC call that has to succeed in the same boot attempt.

Suggested fix

Keep startup fail-closed, but retry in-process instead of exiting: wrap each boot read, or the boot sequence as a whole, in the same bounded-backoff retry the poller already uses, logging a WARN per attempt and incrementing a counter. Treat only errors that can't be retried (wrong contract address, ABI decode or self-check mismatch, bad config) as fatal. A retryable-vs-permanent split around JSON-RPC error responses and transport errors would cover every case we saw. Optionally, cap the total retry time (configurable) so a truly dead endpoint still exits eventually.

Logs

{"level":"ERROR","fields":{"message":"node run failed","error":"blacklist compliance watcher boot enumeration: enumerate ContentBlacklist state for the boot snapshot: blacklistedAddressCount: server returned an error response: error code 1: no available upstreams to process …"}}
{"level":"ERROR","fields":{"message":"node run failed","error":"bootstrap the slash-detection watcher: enumerate operator slashes from CapacityBond at 0x65a9e38F41B9bE2fcB97950a0E3c33e506E6E353: pausedTotal: server returned …"}}
{"level":"ERROR","fields":{"message":"node run failed","error":"CapacityBond registry bootstrap at 0x65a9e38F41B9bE2fcB97950a0E3c33e506E6E353: paginated getRegisteredNodes from CapacityBond at 0x65a9…"}}
{"level":"ERROR","fields":{"message":"node run failed","error":"PaymentPool settlement service bootstrap: PaymentPool.usdc() self-check at 0x351E5544471e11638b89DF8E3A3299c28E00cEc3: server returned an error response: error …"}}
{"level":"ERROR","fields":{"message":"Endpoint dropped without calling `Endpoint::close`. Aborting ungracefully."},"target":"iroh::socket"}

# same provider errors on already-running nodes are retried, not fatal:
{"level":"WARN","fields":{"message":"multiplexed poller tick error; restarting after backoff","error":"multiplexed get_logs [312586830, 312586847]: server returned an error response: error code 19: Temporary internal error. Please retry, …"}}
{"level":"WARN","fields":{"message":"blacklist watcher: periodic re-enumeration failed; keeping the current deny-set (the live tail is still the primary path)","error":"blacklistedAddressCount: server returned an error response: error code 1: no available upstreams to proc…"}}

Breakdown of fatal exits on one node over ~15 min (e229c2b4): 31× blacklist boot enumeration, 1× slash-watcher bootstrap, 1× CapacityBond registry bootstrap.

Metadata

Metadata

Assignees

Labels

kind:bug

Type

No type

Fields

Priority

None yet

Projects

  • Status
    Done

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions