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

dep bug: @achingbrain/nat-port-mapper -> could not find gateway #702

Closed
SgtPooki opened this issue Dec 9, 2024 · 0 comments · Fixed by libp2p/js-libp2p#2884
Closed

dep bug: @achingbrain/nat-port-mapper -> could not find gateway #702

SgtPooki opened this issue Dec 9, 2024 · 0 comments · Fixed by libp2p/js-libp2p#2884
Assignees

Comments

@SgtPooki
Copy link
Member

SgtPooki commented Dec 9, 2024

This error is occurring in helia-examples as well as locally for me now.

You can checkout the branch https://github.com/ipfs/helia-verified-fetch/tree/repro-could-not-find-gateway in helia-verified-fetch and then run the below to reproduce:

> npm i
> npm run build
> node packages/verified-fetch/test-time-to-first-byte.js

(node:39334) MaxListenersExceededWarning: Possible EventTarget memory leak detected. 11 abort listeners added to [AbortSignal]. MaxListeners is 10. Use events.setMaxListeners() to increase limit
(Use `node --trace-warnings ...` to show where the warning was created)
TTR: 536.7267499999999, TTFB: 5.246374999999944
file:///Users/sgtpooki/code/work/protocol.ai/ipfs/helia-verified-fetch/node_modules/@achingbrain/nat-port-mapper/dist/src/upnp/index.js:105
        throw new Error('could not find gateway');
              ^

Error: could not find gateway
    at UPNPClient.findGateway (file:///Users/sgtpooki/code/work/protocol.ai/ipfs/helia-verified-fetch/node_modules/@achingbrain/nat-port-mapper/dist/src/upnp/index.js:105:15)
    at process.processTicksAndRejections (node:internal/process/task_queues:105:5)
    at async UPNPClient.externalIp (file:///Users/sgtpooki/code/work/protocol.ai/ipfs/helia-verified-fetch/node_modules/@achingbrain/nat-port-mapper/dist/src/upnp/index.js:71:25)
    at async ExternalAddressChecker.checkExternalAddress (file:///Users/sgtpooki/code/work/protocol.ai/ipfs/helia-verified-fetch/node_modules/@libp2p/upnp-nat/dist/src/check-external-address.js:56:37)
    at async file:///Users/sgtpooki/code/work/protocol.ai/ipfs/helia-verified-fetch/node_modules/@libp2p/utils/dist/src/repeating-task.js:16:13

Node.js v22.9.0
achingbrain added a commit to libp2p/js-libp2p that referenced this issue Dec 10, 2024
Defer creating the last public ip promise until it's guaranteed to
have a a listener for promise rejections.

Fixes ipfs/helia#702
achingbrain added a commit to libp2p/js-libp2p that referenced this issue Dec 10, 2024
Defer creating the last public ip promise until it's guaranteed to
have a a listener for promise rejections.

Fixes ipfs/helia#702
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 a pull request may close this issue.

2 participants