ethersphere / swarm-cli

Manage your Bee node and interact with the Swarm network via the CLI
BSD 3-Clause "New" or "Revised" License
48 stars 21 forks source link

feed print --list broken? #524

Closed ldeffenb closed 1 month ago

ldeffenb commented 3 months ago

I have a manifest feed reference fdfd170f73953bc262d936d3a5329b787980335dc0547032bb2a6239ebe95a76 made from a local identity and a topic string of OSM Map. swarm-cli print works by itself, but when I add --list to see all versions, it returns an error as shown below.

swarm-cli feed print -i osmtiles -T "OSM Map"
Feed Manifest URL: http://localhost:1633/bzz/18193743a7b709ac972c2f23b65fb9a53f6c317a934c65935dc61317fbfb4fb7/
Topic: 053822aeb5f1e905019add41b51494de5c398ce18ac3def3b4c4d531b76cb068
Number of Updates: 16
Run with --list to see all updates

swarm-cli feed print -i osmtiles -T "OSM Map" --list
Feed Manifest URL: http://localhost:1633/bzz/18193743a7b709ac972c2f23b65fb9a53f6c317a934c65935dc61317fbfb4fb7/
Topic: 053822aeb5f1e905019add41b51494de5c398ce18ac3def3b4c4d531b76cb068
Number of Updates: 16
ERROR Feed topic lookup error: Cannot read properties of undefined (reading 'startsWith')

This feed is very old, so it is quite possible that some of the chunks representing the earlier versions are no longer available in the swarm, but I'd like to see any version that IS actually available.

If I add --curl, both commands only issue the single following command and no additional command is executed before the --list error.

curl "http://localhost:1633/feeds/bc1d30e299e1c6beb1f470c171db11246ed94bdf/053822aeb5f1e905019add41b51494de5c398ce18ac3def3b4c4d531b76cb068" -H "accept: application/json, text/plain, */*"
Cafe137 commented 3 months ago

I could not reproduce it yet. That being said, I can relax the errors and skip if a chunk is not available at the time of the request.

s feed print --topic 053822aeb5f1e905019add41b51494de5c398ce18ac3def3b4c4d531b76cb068 --address bc1d30e299e1c6beb1f470c171db11246ed94bdf  --bee-api-url https://gateway-proxy-bee-0-0.gateway.ethswarm.org --list
Feed Manifest URL: https://gateway-proxy-bee-0-0.gateway.ethswarm.org/bzz/fdfd170f73953bc262d936d3a5329b787980335dc0547032bb2a6239ebe95a76/
Topic: 053822aeb5f1e905019add41b51494de5c398ce18ac3def3b4c4d531b76cb068
Number of Updates: 16

Update 0: 35c6c82f3325c3ed1bb9bceb68c413d44ac3d07f6a7d18999b72b6b31534d6f1
https://gateway-proxy-bee-0-0.gateway.ethswarm.org/bzz/35c6c82f3325c3ed1bb9bceb68c413d44ac3d07f6a7d18999b72b6b31534d6f1/

Update 1: 35c6c82f3325c3ed1bb9bceb68c413d44ac3d07f6a7d18999b72b6b31534d6f1
https://gateway-proxy-bee-0-0.gateway.ethswarm.org/bzz/35c6c82f3325c3ed1bb9bceb68c413d44ac3d07f6a7d18999b72b6b31534d6f1/

Update 2: ef5db9940d482fead33aca90f462c2efadea13718491a8520334046234680d9d
https://gateway-proxy-bee-0-0.gateway.ethswarm.org/bzz/ef5db9940d482fead33aca90f462c2efadea13718491a8520334046234680d9d/

Update 3: 57a37f3c1441823d2d175575f723d9baaf1cea1c3700ad2c62064c01af7a9fe1
https://gateway-proxy-bee-0-0.gateway.ethswarm.org/bzz/57a37f3c1441823d2d175575f723d9baaf1cea1c3700ad2c62064c01af7a9fe1/

Update 4: a6e77b7273a6d6415cd9e00bfb22c90a8adc5c050aa7eb9f606051222c8d4689
https://gateway-proxy-bee-0-0.gateway.ethswarm.org/bzz/a6e77b7273a6d6415cd9e00bfb22c90a8adc5c050aa7eb9f606051222c8d4689/

Update 5: f09da1184cc9ef6af3b228f72c6ff965fcfee58b47d65d52ef6cf4e5347c766e
https://gateway-proxy-bee-0-0.gateway.ethswarm.org/bzz/f09da1184cc9ef6af3b228f72c6ff965fcfee58b47d65d52ef6cf4e5347c766e/

Update 6: f74e5af645893e948203c809672dcdf0a364e234675eda2a38b288a087dc2ecb
https://gateway-proxy-bee-0-0.gateway.ethswarm.org/bzz/f74e5af645893e948203c809672dcdf0a364e234675eda2a38b288a087dc2ecb/

Update 7: 059f88b40931426d91a65a87917b7bb6b4c50f654418a8e1be62d90ed2701ed1
https://gateway-proxy-bee-0-0.gateway.ethswarm.org/bzz/059f88b40931426d91a65a87917b7bb6b4c50f654418a8e1be62d90ed2701ed1/

Update 8: 3805c8314f562d6612b631833756b182a362465eecbd20c0d934b61d5cad3f3f
https://gateway-proxy-bee-0-0.gateway.ethswarm.org/bzz/3805c8314f562d6612b631833756b182a362465eecbd20c0d934b61d5cad3f3f/

Update 9: 5c1d87ee5edd9dcb204aea3550cfce3b8960b8018bf59d995c2ec1846f3462bb
https://gateway-proxy-bee-0-0.gateway.ethswarm.org/bzz/5c1d87ee5edd9dcb204aea3550cfce3b8960b8018bf59d995c2ec1846f3462bb/

Update 10: 165c4f37e287b406ff6d1ff2e061802610433c86552d5af9a0c94cfd6c586b7c
https://gateway-proxy-bee-0-0.gateway.ethswarm.org/bzz/165c4f37e287b406ff6d1ff2e061802610433c86552d5af9a0c94cfd6c586b7c/

Update 11: ac28eaf69a6415a243d564ea69765ed8ee81faefc8b2e0b775fc54dbc32d8fa9
https://gateway-proxy-bee-0-0.gateway.ethswarm.org/bzz/ac28eaf69a6415a243d564ea69765ed8ee81faefc8b2e0b775fc54dbc32d8fa9/

Update 12: 2a81554afb0c758facee57bdf4cfa4f6b5c038391bf94ad39a5f0362316fd46c
https://gateway-proxy-bee-0-0.gateway.ethswarm.org/bzz/2a81554afb0c758facee57bdf4cfa4f6b5c038391bf94ad39a5f0362316fd46c/

Update 13: ac28eaf69a6415a243d564ea69765ed8ee81faefc8b2e0b775fc54dbc32d8fa9
https://gateway-proxy-bee-0-0.gateway.ethswarm.org/bzz/ac28eaf69a6415a243d564ea69765ed8ee81faefc8b2e0b775fc54dbc32d8fa9/

Update 14: a3b772d26db489be86ee60c35a1e3cef6c7949a27a1c24cfb7b1527e8b220687
https://gateway-proxy-bee-0-0.gateway.ethswarm.org/bzz/a3b772d26db489be86ee60c35a1e3cef6c7949a27a1c24cfb7b1527e8b220687/

Update 15: 4ae15225e0129734ade5c0965439b4281d274623f69446c7eb247e472cc77c43
https://gateway-proxy-bee-0-0.gateway.ethswarm.org/bzz/4ae15225e0129734ade5c0965439b4281d274623f69446c7eb247e472cc77c43/
ldeffenb commented 3 months ago

The error must be due to using the -i {identity} -T "OSM Map". Your command works and shows me everything. My command still gives me:

swarm-cli feed print -i osmtiles -T "OSM Map" --list
Feed Manifest URL: http://localhost:1633/bzz/18193743a7b709ac972c2f23b65fb9a53f6c317a934c65935dc61317fbfb4fb7/
Topic: 053822aeb5f1e905019add41b51494de5c398ce18ac3def3b4c4d531b76cb068
Number of Updates: 16
ERROR Feed topic lookup error: Cannot read properties of undefined (reading 'startsWith')

And yes, I did them both against my local light node with no specification of --bee-api-url.

ldeffenb commented 3 months ago

Isolated it to the use of -i {identity}.

This fails: swarm-cli feed print -i osmtiles -T "OSM Map" --list

This works:

swarm-cli feed print -a 0xbc1d30e299e1c6beb1f470c171db11246ed94bdf -T "OSM Map" --list

The address was acquired from the identity definition via: swarm-cli identity list

ldeffenb commented 3 months ago

Yep, this line requires the -a value to work properly. https://github.com/ethersphere/swarm-cli/blob/167678757516910bdf1c863ae6176619635bca6e/src/command/feed/print.ts#L89

Probably should use addressString to use either -a or the address from -i: https://github.com/ethersphere/swarm-cli/blob/167678757516910bdf1c863ae6176619635bca6e/src/command/feed/print.ts#L71