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

'At least one protocol must be specified' Error migraging from v4.2.5 to v5.2.0 #738

Closed
christroutner opened this issue Feb 12, 2025 · 2 comments

Comments

@christroutner
Copy link

I'm trying to upgrade from Helia v4.2.5 to the latest version of v5.2.0. I'm upgrading my dependencies, but at startup when the node tries to connect to other (un-upgraded) peers, it throws the following errors on every peer connection attempt:

status: Error trying to connect to peer node /ip4/143.198.134.59/tcp/4101/p2p/12D3KooWHogx3RcyNiSuY6SzS8GxzTAqtDCYzy17yQ1StWaLvX9j:  'At least one protocol must be specified'
status: getCRGist() Connecting to Circuit Relay /ip4/78.46.129.7/tcp/4001/p2p/12D3KooWEBzgK8a5TpMfLotuj7jJnEK41gbD9LZK6qCpxNrX43E9
status: Error trying to connect to peer node /ip4/78.46.129.7/tcp/4001/p2p/12D3KooWEBzgK8a5TpMfLotuj7jJnEK41gbD9LZK6qCpxNrX43E9:  'At least one protocol must be specified'
status: getCRGist() Connecting to Circuit Relay /ip4/5.78.70.29/tcp/4001/p2p/12D3KooWSREJ6x2DJSYrA1xRD2Qs6D4DHncsHmNnTHuMKHnqpG2i
status: Error trying to connect to peer node /ip4/5.78.70.29/tcp/4001/p2p/12D3KooWSREJ6x2DJSYrA1xRD2Qs6D4DHncsHmNnTHuMKHnqpG2i:  'At least one protocol must be specified'
status: Error trying to connect to peer node /ip4/137.184.13.92/tcp/4003/p2p/12D3KooWPpBXhhAeoCZCGuQ3KR4xwHzzvtP57f6zLmo8P7ZFBJFE:  'The operation was aborted due to timeout'
status: Error trying to connect to peer node /ip4/116.203.153.222/tcp/4001/p2p/12D3KooWEhCMWqbBY9bPkq1YJAZNxo8dfKEB8y35FSYCqvyb1wFe:  'At least one protocol must be specified'
status: Error trying to connect to peer node /ip4/49.13.197.135/tcp/4001/p2p/12D3KooWLcfGLeC8gsTmR4x24dd2ECeW2CY5x8dh6V8EzS8jcw3g:  'At least one protocol must be specified'
status: Error trying to connect to peer node /ip4/64.23.142.188/tcp/4001/p2p/12D3KooWQKLGpWc9BibQR41AXhgtrqDJE7Uo6kb4CL6nw1pHJ1sC:  'At least one protocol must be specified'

I'm having issues with file transfer between nodes in a certain situation, and I wanted to make sure I was using the latest version of Helia before I started getting too crazy with the debugging.

Is there a changelog of how to configure Helia from v4 to v5?

@christroutner
Copy link
Author

I managed to find this libp2p v1 -> v2 migration guide. After reading it, I updated my connectionEncryption property to connectionEncrypters.

That changed the error. Now I'm getting this error:

node:internal/event_target:1094
  process.nextTick(() => { throw err; });
                           ^

TypeError: peerId.toBytes is not a function
    at PeerFilter.has (file:///home/trout/work/psf/code/helia-coord/node_modules/@libp2p/peer-collections/dist/src/filter.js:12:39)
    at Registrar._onPeerIdentify (file:///home/trout/work/psf/code/helia-coord/node_modules/libp2p/dist/src/registrar.js:182:38)
    at [nodejs.internal.kHybridDispatch] (node:internal/event_target:820:20)
    at TypedEventEmitter.dispatchEvent (node:internal/event_target:755:26)
    at TypedEventEmitter.dispatchEvent (file:///home/trout/work/psf/code/helia-coord/node_modules/libp2p/node_modules/@libp2p/interface/dist/src/event-target.js:43:30)
    at Libp2p.events.dispatchEvent (file:///home/trout/work/psf/code/helia-coord/node_modules/libp2p/dist/src/libp2p.js:43:36)
    at TypedEventEmitter.safeDispatchEvent (file:///home/trout/work/psf/code/helia-coord/node_modules/libp2p/node_modules/@libp2p/interface/dist/src/event-target.js:53:21)
    at consumeIdentifyMessage (file:///home/trout/work/psf/code/helia-coord/node_modules/@libp2p/identify/dist/src/utils.js:142:12)

Turning on DEBUG=* I also see this higher up in the logs before the above error:

libp2p:circuit-relay:transport:error could not add discovered relay 12D3KooWHogx3RcyNiSuY6SzS8GxzTAqtDCYzy17yQ1StWaLvX9j TypeError: peerId.toBytes is not a function
    at ReservationStore.addRelay (file:///home/trout/work/psf/code/helia-coord/node_modules/@libp2p/circuit-relay-v2/dist/src/transport/reservation-store.js:97:41)
    at RelayDiscovery.<anonymous> (file:///home/trout/work/psf/code/helia-coord/node_modules/@libp2p/circuit-relay-v2/dist/src/transport/transport.js:68:39)
    at [nodejs.internal.kHybridDispatch] (node:internal/event_target:820:20)
    at RelayDiscovery.dispatchEvent (node:internal/event_target:755:26)
    at RelayDiscovery.dispatchEvent (file:///home/trout/work/psf/code/helia-coord/node_modules/@libp2p/interface/dist/src/event-target.js:43:30)
    at RelayDiscovery.safeDispatchEvent (file:///home/trout/work/psf/code/helia-coord/node_modules/@libp2p/interface/dist/src/event-target.js:53:21)
    at file:///home/trout/work/psf/code/helia-coord/node_modules/@libp2p/circuit-relay-v2/dist/src/transport/discovery.js:88:22 +0ms

I'll continue to add to this thread as I discover more about how to fix this issue. I'm sure other people will run into the same issues trying to upgrade from v4 to v5 of Helia.

@christroutner
Copy link
Author

That last error turned out to be related to the Circuit Relay V2 library. I updated it to the latest version (v3.1.11) and it fixed the issue. My node is now running with Helia v5.2.0!

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