Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Cannot create a new feed manifest? #550

Closed
ldeffenb opened this issue Nov 20, 2024 · 4 comments
Closed

Cannot create a new feed manifest? #550

ldeffenb opened this issue Nov 20, 2024 · 4 comments

Comments

@ldeffenb
Copy link

I'm trying to use the following command to create a new feed manifest reference with a new topic ("OSM Map v2.2") in the mainnet swarm.

swarm-cli feed update -r ab77201f6541a9ceafb98a46c643273cfa397a87798273dd17feb2aa366ce2e6 -T "OSM Map v2.2" --bee-api-url http://192.168.10.38:10200 --curl -v

It shows the following after selecting the stamp and identity:

curl "http://192.168.10.38:10200/stamps" -H "accept: application/json, text/plain, */*"
curl "http://192.168.10.38:10200/feeds/bc1d30e299e1c6beb1f470c171db11246ed94bdf/f0f8fd0fefa62c6bfb731d94a10be7587ff775cf0e349c84aaf6fed243051a50?type=sequence" -H "accept: application/json, text/plain, */*"
ERROR Request failed with status code 404

There may be additional information in the Bee logs.

and the bee node has the following (sorry, only at --verbosity 3 as it's busy doing a massive upload)

"time"="2024-11-20 15:11:10.445838" "level"="error" "logger"="node/api/get_feed" "msg"="no update found"
"time"="2024-11-20 15:11:10.445938" "level"="info" "logger"="node/api" "msg"="api access" "ip"="192.168.10.177" "method"="GET" "host"="192.168.10.38:10200" "uri"="/feeds/bc1d30e299e1c6beb1f470c171db11246ed94bdf/f0f8fd0fefa62c6bfb731d94a10be7587ff775cf0e349c84aaf6fed243051a50?type=sequence" "proto"="HTTP/1.1" "status"=404 "size"=42 "duration"="14.182038435s" "user-agent"="axios/0.28.1"

I've used this same command with a different topic repeatedly in the past several years, and in fact, the original command still works but uses a topic ("OSM Map") that has gone non-reliable after many of the underlying soc chunks have gone non-retrievable and the stamp was subsequently left to expire. It worked even now. I suspect because the feed already exists in caches and therefore something was able to find the required update.

swarm-cli feed update -r ab470241d73ac7570dbccb9163f1f77efd9e6a570e28623faa85e28894c001ed -T "OSM Map" --bee-api-url http://192.168.10.38:10200 --curl -v
curl "http://192.168.10.38:10200/stamps" -H "accept: application/json, text/plain, */*"
curl "http://192.168.10.38:10200/feeds/bc1d30e299e1c6beb1f470c171db11246ed94bdf/053822aeb5f1e905019add41b51494de5c398ce18ac3def3b4c4d531b76cb068?type=sequence" -H "accept: application/json, text/plain, */*"
curl -X POST "http://192.168.10.38:10200/soc/bc1d30e299e1c6beb1f470c171db11246ed94bdf/bb87475f614fc7d6ff50d111c188b1d1e7db278a018a2e8fa83639ddaf1e1c1f?sig=d63cd99327e4d9db60091ef19291ca695a00a0f3031f0f16afdd5aaebd3d493f6bf7e2b690d341e2ce4d01a898fd2f07133a3ba5b4f44c8377931f3a729956741c" -H "accept: application/json, text/plain, */*" -H "content-type: application/octet-stream" -H "swarm-postage-batch-id: 2f641295d6d206b15446fe4645cfef6c3ec987ed22c0a26b13ba612ebd44d705"
curl -X POST "http://192.168.10.38:10200/feeds/bc1d30e299e1c6beb1f470c171db11246ed94bdf/053822aeb5f1e905019add41b51494de5c398ce18ac3def3b4c4d531b76cb068" -H "accept: application/json, text/plain, */*" -H "swarm-postage-batch-id: 2f641295d6d206b15446fe4645cfef6c3ec987ed22c0a26b13ba612ebd44d705"
Chunk Reference: ab470241d73ac7570dbccb9163f1f77efd9e6a570e28623faa85e28894c001ed
Chunk Reference URL: http://192.168.10.38:10200/bzz/ab470241d73ac7570dbccb9163f1f77efd9e6a570e28623faa85e28894c001ed/
Feed Reference: fe40cd23ff961fb63af26cf88b7205b72698f1e03abf71bab99c830b79eb8f40
Feed Manifest: fdfd170f73953bc262d936d3a5329b787980335dc0547032bb2a6239ebe95a76
Feed Manifest URL: http://192.168.10.38:10200/bzz/fdfd170f73953bc262d936d3a5329b787980335dc0547032bb2a6239ebe95a76/
curl "http://192.168.10.38:10200/stamps/2f641295d6d206b15446fe4645cfef6c3ec987ed22c0a26b13ba612ebd44d705" -H "accept: application/json, text/plain, */*"
Stamp ID: 2f641295
Label: OSM Tiles (Variable Redundancy)
Usage: 61%
Capacity (immutable): 1.56 TB remaining out of 4.00 TB
Depth: 30
Bucket Depth: 16
Amount: 97500000000
Usable: true
Utilization: 9988
Block Number: 36038695
Successfully updated feed.
@ldeffenb
Copy link
Author

Help would be appreciated as I'm trying to create a new feed manifest reference for the OSM map dataset for inclusion in some upcoming version of swarm-desktop, not to mention tracking the new versions that I'm actively uploading/pushing as I type.

@ldeffenb
Copy link
Author

ldeffenb commented Nov 20, 2024

swarm-cli invokes bee-js's makeFeedWriter from writeFeed which is used by the failing feed update command.

const writer = this.bee.makeFeedWriter('sequence', topic, wallet.getPrivateKey())

In bee-js, makeFeedWriter invokes updateFeed at:
https://github.com/ethersphere/bee-js/blob/9dd071d6dbedf9984efb5ce58612a8af6eddb60a/src/feed/index.ts#L157

updateFeed invokes findNextIndex.
https://github.com/ethersphere/bee-js/blob/9dd071d6dbedf9984efb5ce58612a8af6eddb60a/src/feed/index.ts#L80

findNextIndex invokes fetchLatestUpdate.
https://github.com/ethersphere/bee-js/blob/9dd071d6dbedf9984efb5ce58612a8af6eddb60a/src/feed/index.ts#L60

And fetchLatestUpdate does the GET /feeds/{owner}/{topic} that is returning the 404 error (confirmed by individually executing that curl command).

However the findNextIndex function in bee-js catches any BeeResponseError exceptions from fetchLatestFeedUpdate and converts it to an index of zero.
https://github.com/ethersphere/bee-js/blob/9dd071d6dbedf9984efb5ce58612a8af6eddb60a/src/feed/index.ts#L53-L69

But maybe for some reasons the 404 isn't triggering as an instance of a BeeResponseError? That would explain the observed behavior, but don't ask me what changed or when that prevents the creation of a new feed manifest reference that doesn't have any existing updates to retrieve.
https://github.com/ethersphere/bee-js/blob/9dd071d6dbedf9984efb5ce58612a8af6eddb60a/src/feed/index.ts#L64-L66

Certainly if fetchLatestFeedUpdate succeeds like when a feed manifest reference already exists, the bee-js code would go on to actually update the feed with the new sequence.
https://github.com/ethersphere/bee-js/blob/9dd071d6dbedf9984efb5ce58612a8af6eddb60a/src/feed/index.ts#L80

(Feel free to pass this analysis on to a bee-js issue if you determine that it is valid and actually an issue in bee-js rather than swarm-cli)

@ldeffenb
Copy link
Author

Ok, please ignore this out-of-date person. The issue was in 2.14.0, but had already been fixed in the current 2.18.0. Updated and managed to get my new feed reference created!

@ldeffenb
Copy link
Author

#345 would be a nice addition!

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

No branches or pull requests

1 participant