Skip to content

fix(gateway): tolerate kubo /api/v0/id field changes (NodeInfo optional fields)#81

Open
ehsan6sha wants to merge 1 commit into
mainfrom
fix/ipfs-nodeinfo-optional-fields
Open

fix(gateway): tolerate kubo /api/v0/id field changes (NodeInfo optional fields)#81
ehsan6sha wants to merge 1 commit into
mainfrom
fix/ipfs-nodeinfo-optional-fields

Conversation

@ehsan6sha

Copy link
Copy Markdown
Member

Problem

The gateway logs a non-fatal WARN on every pin:
Failed to fetch local IPFS node multiaddrs ... error=IPFS API error: error decoding response body

Root cause: the deployed kubo is 0.41.0, whose /api/v0/id no longer returns ProtocolVersion (it now sends a Protocols list). NodeInfo (fula-blockstore/src/ipfs.rs) is rename_all="PascalCase" and requires protocol_version: StringProtocolVersion. Missing required field → serde fails the whole decode → origins() returns empty → the WARN, and the pin omits the origins hint.

Impact is non-fatal — pins land regardless; the origins hint just lets the pinning service fetch the CID directly from the gateway's kubo instead of DHT-walking, so without it pins propagate a touch slower.

Fix

origins() only reads addresses. Make the other fields #[serde(default)] so a kubo /api/v0/id field rename/removal can never break the decode again.

Test

cargo check -p fula-blockstore clean. After deploy the WARN disappears and pins carry the origins hint.

🤖 Generated with Claude Code

…al fields)

kubo 0.41 dropped `ProtocolVersion` from /api/v0/id (it now sends a `Protocols`
list), but NodeInfo required `protocol_version: String`, so serde failed the
whole decode -> origins() returned empty -> the gateway logged "Failed to fetch
local IPFS node multiaddrs (error decoding response body)" and omitted the
pinning `origins` hint (pins still succeed, just resolve slower via DHT walk).

origins() only reads `addresses`; make public_key/agent_version/protocol_version
#[serde(default)] so a kubo field rename/removal can never break the decode
again.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Claude-Session: https://claude.ai/code/session_0161UGEJmTpM6DM2cVZyV6Ev
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant