Retrieval with zero connected peers returns 404 "address not found", indistinguishable from missing content
维护者通常 2 天内回复
评估
这个 Issue 还没有评估数据。
描述
Context
Bee 2.8.1-7cf53193, API version 8.1.0, beeMode: light, macOS, home network behind NAT.
Node state at time of failure:
{"beeMode":"light","connectedPeers":0,"neighborhoodSize":1,"reserveSize":0,"isReachable":false}
{"depth":9,"connected":0,"population":7181,"reachability":"Private","networkAvailability":"Unavailable"}
Chequebook was funded (totalBalance: 19584745999995000), so this is not a payment issue.
Summary
When a node has no connected peers, GET /bzz/{ref}/ returns 404 {"code":404,"message":"address not found or incorrect"}. That is the same response the node gives for content that genuinely does not exist, so an operator cannot tell "my node is disconnected" from "this content is gone".
This cost a full benchmarking session: the conclusion was first that content had failed to upload, then that the network was slow, before discovering the node had silently dropped from 75 peers to 0 partway through. Every measurement taken in between was invalid, and nothing in the API response hinted at the real cause.
Expected behavior
Retrieval failing because the node has no peers to ask should be distinguishable from retrieval failing because the chunk was not found. A 503 Service Unavailable with a message such as no peers available to retrieve from; node may be disconnected or still connecting would communicate that the fault is local and transient.
Actual behavior
All retrievals return the same 404, in a consistent ~1.8 s:
$ curl -s -o /dev/null -w '%{http_code} %{time_starttransfer}s\n' \
http://localhost:1633/bzz/<ref>/
404 1.803649s
Against 11 references known to exist — all but one served successfully by a public gateway at the same moment — this node returned 404 for 9. The two that succeeded were already in its local cache.
Steps to reproduce
- Run a light node and confirm
GET /statusreportsconnectedPeers: 0and/topologyreportsnetworkAvailability: "Unavailable"(on this node it happened on its own after several hours). GET /bzz/{ref}/for any reference known to exist on the network.- Observe
404 address not found or incorrect, identical to the response for a nonexistent reference.
Possible solution
The distinction already exists internally and is discarded at the HTTP boundary:
pkg/topology/topology.go:19—ErrNotFound = errors.New("no peer found")pkg/retrieval/retrieval.go:214-219— returns that error when all peers are depleted, distinct fromstorage.ErrNotFoundreturned at line 287 for genuine not-foundpkg/api/bzz.go:517-521— collapses any manifest-load error intojsonhttp.NotFound(w, nil)
So the API layer could check errors.Is(err, topology.ErrNotFound) and return 503 with a distinct message, rather than 404. The same treatment likely applies to the other download handlers (/bytes, /chunks).
A lighter-touch alternative, if changing the status code is considered breaking: keep 404 but make the message distinguish the two cases.
AI Disclosure
- This issue contains suggestions and text generated by an LLM.
- I have reviewed the AI generated content thoroughly.
- I possess the technical expertise to responsibly review the AI generated content mentioned in this issue.
- 主要语言
- Go
- 星标
- 1.5k
- 派生
- 390
- 平均合并
- 4 天 15 小时
- 30 天内合并 PR
- 21
环境准备
- 提供 Dockerfile 或 Docker Compose 文件
- 有 Pull Request 模板
- 阅读贡献指南
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
ethersphere/bee 的其他 Issue
-
Redistribution commit/reveal fall back to a 500,000 gas floor that no longer fits under Glamsterdam (EIP-8038)可能已有人在做 @sbackend123 于 1 天前认领。 未关闭
难度 2/5 1 小时以内 新手友好度 85/100
ethersphere/bee#5652 · 已指派 1 人 ·
维护者通常 2 天内回复
-
Chequebook deployment uses a fixed 175,000 gas limit; it needs about 630,000 under Glamsterdam (live on Sepolia since 2026-10-06)可能已有人在做 @sbackend123 于 1 天前认领。 未关闭
难度 2/5 1-3 小时 新手友好度 85/100
ethersphere/bee#5650 · 已指派 1 人 ·
维护者通常 2 天内回复
-
seen
难度 4/5 3-5 天 新手友好度 40/100
ethersphere/bee#5648 ·
维护者通常 2 天内回复
-
pusher: chunksWorker deadlocks on a deferred chunk that fails IdentityAddress (send on nil op.Err), halting all push-sync可能已有人在做 @sbackend123 于 3 天前认领。 未关闭seen
难度 3/5 1-2 天 新手友好度 75/100
ethersphere/bee#5641 · 已指派 1 人 ·
维护者通常 2 天内回复
-
GET /bzz/<ref>/ can 404 off-node, and the 404 is indistinguishable from a missing index document未关闭seen
难度 3/5 1-2 天 新手友好度 52/100
ethersphere/bee#5625 · 1 条评论 ·
维护者通常 2 天内回复
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
openimsdk/openim-sdk-core#1127 ·
-
github_actions
难度 2/5 1-3 小时 新手友好度 65/100
Hochfrequenz/aibap.mcp#578 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 85/100
mvanhorn/cli-printing-press#4980 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 62/100
lenaxia/LLMSafeSpaces#1644 · 3 条评论 · 1 个 reaction ·
维护者通常 1 天内回复
-
automation code-quality cookie documentation improvement quick-win task-mining
难度 2/5 1-3 小时 新手友好度 65/100
维护者通常 1 天内回复