Skip to content
This repository has been archived by the owner on Feb 12, 2024. It is now read-only.

ping error #1616

Closed
mccoysc opened this issue Oct 4, 2018 · 6 comments
Closed

ping error #1616

mccoysc opened this issue Oct 4, 2018 · 6 comments
Assignees
Labels
exp/novice Someone with a little familiarity can pick up kind/bug A bug in existing code (including security flaws) kind/resolved-in-helia P3 Low: Not priority right now status/ready Ready to be worked

Comments

@mccoysc
Copy link

mccoysc commented Oct 4, 2018

jsipfs ping QmW1apH3mUa1SGV9yPfnjhScVDWf3UmWsqCk87MdjbKNSj
Looking up peer QmW1apH3mUa1SGV9yPfnjhScVDWf3UmWsqCk87MdjbKNSj
Error
/usr/lib/node_modules/ipfs/node_modules/pull-stream/sinks/drain.js:22
throw end
^

Error: Error
at PingMessageStream._transform (/usr/lib/node_modules/ipfs/node_modules/ipfs-api/src/utils/ping-message-stream.js:18:15)
at PingMessageStream.Transform._read (/usr/lib/node_modules/ipfs/node_modules/readable-stream/lib/_stream_transform.js:184:10)
at PingMessageStream.Transform._write (/usr/lib/node_modules/ipfs/node_modules/readable-stream/lib/_stream_transform.js:172:83)
at doWrite (/usr/lib/node_modules/ipfs/node_modules/readable-stream/lib/_stream_writable.js:428:64)
at writeOrBuffer (/usr/lib/node_modules/ipfs/node_modules/readable-stream/lib/_stream_writable.js:417:5)
at PingMessageStream.Writable.write (/usr/lib/node_modules/ipfs/node_modules/readable-stream/lib/_stream_writable.js:334:11)
at DestroyableTransform.ondata (/usr/lib/node_modules/ipfs/node_modules/readable-stream/lib/_stream_readable.js:619:20)
at DestroyableTransform.emit (events.js:182:13)
at addChunk (/usr/lib/node_modules/ipfs/node_modules/readable-stream/lib/_stream_readable.js:291:12)
at readableAddChunk (/usr/lib/node_modules/ipfs/node_modules/readable-stream/lib/_stream_readable.js:278:11)

@mccoysc
Copy link
Author

mccoysc commented Oct 5, 2018

and when ping in browser,error like this:

await ipfs.ping("QmZ6YuHZUJd6k9hbJNaNUZBsWfwZGv62piZMU6oxHPBtDx")
collect.js:7 Uncaught TypeError: Cannot read property 'push' of null
at collect.js:7
at reduce.js:8
at drain.js:24
at f (index.js:84)
at Function.u [as push] (index.js:44)
at e.ping (ping-pull-stream.js:79)
at _getPeerInfo (index.js:339)
at s (get-peer-info.js:54)
at setImmediate.js:27
at setImmediate.js:40
at f (setImmediate.js:69)
at r (setImmediate.js:109)

@achingbrain
Copy link
Member

I've found the first error happens in the first few seconds of starting an IPFS node - after it's found a few peers the error stops occurring and the ping command starts working.

achingbrain added a commit that referenced this issue Oct 9, 2018
Without this PR:

```console
$ npm test

...*snip*

     Uncaught TypeError: Cannot read property 'push' of null
      at /Users/alex/Documents/Workspaces/ipfs/js-ipfs/node_modules/pull-stream/sinks/collect.js:7:9
      at /Users/alex/Documents/Workspaces/ipfs/js-ipfs/node_modules/pull-stream/sinks/reduce.js:8:11
      at /Users/alex/Documents/Workspaces/ipfs/js-ipfs/node_modules/pull-stream/sinks/drain.js:24:37
      at callback (/Users/alex/Documents/Workspaces/ipfs/js-ipfs/node_modules/pull-pushable/index.js:84:5)
      at Function.push (/Users/alex/Documents/Workspaces/ipfs/js-ipfs/node_modules/pull-pushable/index.js:44:7)
      at libp2pNode.ping (src/core/components/ping-pull-stream.js:79:18)
      at _getPeerInfo (/Users/alex/Documents/Workspaces/ipfs/js-ipfs/node_modules/libp2p/src/index.js:339:7)
      at setImmediate (/Users/alex/Documents/Workspaces/ipfs/js-ipfs/node_modules/libp2p/src/get-peer-info.js:54:24)
      at Immediate.<anonymous> (/Users/alex/Documents/Workspaces/ipfs/js-ipfs/node_modules/async/internal/setImmediate.js:27:16)
```

Might resolve the second issue in #1616
alanshaw pushed a commit that referenced this issue Oct 16, 2018
Without this PR:

```console
$ npm test

...*snip*

     Uncaught TypeError: Cannot read property 'push' of null
      at /Users/alex/Documents/Workspaces/ipfs/js-ipfs/node_modules/pull-stream/sinks/collect.js:7:9
      at /Users/alex/Documents/Workspaces/ipfs/js-ipfs/node_modules/pull-stream/sinks/reduce.js:8:11
      at /Users/alex/Documents/Workspaces/ipfs/js-ipfs/node_modules/pull-stream/sinks/drain.js:24:37
      at callback (/Users/alex/Documents/Workspaces/ipfs/js-ipfs/node_modules/pull-pushable/index.js:84:5)
      at Function.push (/Users/alex/Documents/Workspaces/ipfs/js-ipfs/node_modules/pull-pushable/index.js:44:7)
      at libp2pNode.ping (src/core/components/ping-pull-stream.js:79:18)
      at _getPeerInfo (/Users/alex/Documents/Workspaces/ipfs/js-ipfs/node_modules/libp2p/src/index.js:339:7)
      at setImmediate (/Users/alex/Documents/Workspaces/ipfs/js-ipfs/node_modules/libp2p/src/get-peer-info.js:54:24)
      at Immediate.<anonymous> (/Users/alex/Documents/Workspaces/ipfs/js-ipfs/node_modules/async/internal/setImmediate.js:27:16)
```

Might resolve the second issue in #1616
@alanshaw alanshaw added kind/bug A bug in existing code (including security flaws) exp/novice Someone with a little familiarity can pick up status/ready Ready to be worked P3 Low: Not priority right now labels Oct 17, 2018
@mccoysc
Copy link
Author

mccoysc commented Oct 18, 2018

await ipfs.ping("QmXp22HFGvo29o6dsGnJwxaHvTieEqMGr1pS55ZsZUonMf")

TypeError: Cannot read property 'push' of null TypeError: Cannot read property 'push' of null

(anonymous) @ collect.js:7
(anonymous) @ reduce.js:8
(anonymous) @ drain.js:24
f @ index.js:84
c @ index.js:69
s @ index.js:29
i @ drain.js:16
i @ drain.js:12
e @ pull.js:41
n @ ping.js:8
(anonymous) @ index.js:41
@alanshaw

@mccoysc
Copy link
Author

mccoysc commented Oct 18, 2018

and "QmXp22HFGvo29o6dsGnJwxaHvTieEqMGr1pS55ZsZUonMf" is my node itself.

@mccoysc
Copy link
Author

mccoysc commented Oct 18, 2018

and also, i ping others,"QmZ6YuHZUJd6k9hbJNaNUZBsWfwZGv62piZMU6oxHPBtDx",error again

@whizzzkid
Copy link

whizzzkid commented May 31, 2023

js-ipfs is being deprecated in favor of Helia. You can follow the migration plan here #4336 and read the migration guide.

This issue has been resolved in Helia! if this does not address your concern please let us know by reopening this issue before 2023-06-05!

@github-project-automation github-project-automation bot moved this from 🛑 Blocked to ✅ Done in js-ipfs deprecation May 31, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
exp/novice Someone with a little familiarity can pick up kind/bug A bug in existing code (including security flaws) kind/resolved-in-helia P3 Low: Not priority right now status/ready Ready to be worked
Projects
No open projects
Status: Done
Development

No branches or pull requests

4 participants