-
Notifications
You must be signed in to change notification settings - Fork 1.2k
Slow response on new files AND Seeing "already piped" errors #1156
Comments
I'm trying to narrow this down ... there is definitely the new "already piped" error, but it doesn't seem to be the cause of the slow response. I was wrong about files.get, its dag.get that doesn't return. (In my code, I do a dag.get and then call files.cat if its a DAGNode.) dag.get is - for the new files - not returning at all (can wait 10's of minutes), for files pushed earlier, it works fine. The multihash (as returned by the HTTP API on the gateway server) is: QmZ5TBouUQrZrfUFxARh2RNUPEPgoRRk4QMesvkTaJSXNL I start this process up on the browser, then in another tab go to The file displays happily in that tab AND importantly the dag.get (that was previously sitting there doing nothing) now returns correctly and gets the file. This is a weird interaction between what should be independent processes. I don't know what is happening under the hood, but it seems like the http retrieval on the ipfs.io server is somehow priming the DHT so the browser call works ? |
I've confirmed some of that assumption by hacking the HTTP gateway so that after pushing the file to the local IPFS gateway, it queries ipfs.io before telling the client the ipfs hash ... Sounds confusing so let me draw out ...
This repeatably works. (NOTE - gateway.dweb.me is still experimental and its behavior is highly likely to change ! ) |
More testing .... going a "HEAD https://ipfs.io/ipfs/" is sufficient to unblock the client, |
That behavior happens flawlessly because Relay hasn't been integrated (aka set to default) and so the Browser node isn't dialing to your local node directly. It's coming :) https://github.com/ipfs/js-ipfs#project-status |
Ok - I can leave the hack in place for now (of doing a "Head" to ipfs.io) but trying to understanad what it means about DHT not being integrated, how is content being found if not via the DHT, and why does pinging ipfs.io make it suddenly get found. (Note the IPFS server where the content is being "added" is a Go server that Kyle set up). |
I think https://discuss.ipfs.io/t/ipfs-ls-cat-hash-halts-while-gateway-ipfs-shows-the-file-right-away/1853 is the same issue. As the poster says there "the whole point of P2P network is that a path between the node is found, am I wrong?" |
Not sure but probably related, from time to time I get this error log on the browser console: Details
|
I am getting a similar issue as @thiagodelgado111 when running Trace
I am wondering: as a workaround, can we somehow restart |
WIP to fix "already piped" error in libp2p/js-libp2p-switch#262 See also |
Version: 0.27.4
On OSX
I'm using files.cat to retrieve a file that has only a moment ago been pushed to the IPFS by our gateway server (so I'm expecting a relatively slow response).
But ... I'm seeing "Error already piped" dweb_transport_ipfs_bundled.js:122318 Uncaught Error: already piped
at sink (dweb_transport_ipfs_bundled.js:122318)
at consume (dweb_transport_ipfs_bundled.js:121847)
at Connection.consume (dweb_transport_ipfs_bundled.js:121847)
at pull (dweb_transport_ipfs_bundled.js:123000)
at Dialer.handle (dweb_transport_ipfs_bundled.js:109125)
at attemptMuxerUpgrade (dweb_transport_ipfs_bundled.js:70145)
at gotWarmedUpConn (dweb_transport_ipfs_bundled.js:70035)
at Swarm.dial (dweb_transport_ipfs_bundled.js:70022)
at _getPeerInfo (dweb_transport_ipfs_bundled.js:72065)
at setImmediate (dweb_transport_ipfs_bundled.js:72124)
I realize the linenumbers aren't that helpful, so if the trace isn't easy to find I can try and generate more info.
Of course we are used to seeing the ubiquitous "Stream ended prematurely" and "Invalid MAC" errors, so I'm wondering if this is another that can be safely ignored or is an indication of a problem.
What I'm seeing is that IPFS.files.cat is often never returning.
Sometimes this accompanied by the piping error.
If I reload then and do the exact same thing (the file already having been pushed to the IPFS gateway) t
or could be why I'm not seeing ipfs.files.get ever return .
If I reload and go back to the same file, it works - so I'm pretty sure the issue is in IPFS's response to not finding the file immediately.
Also ... if I load the file from the ipfs.io gateway in a different tab then the files.cat returns.
I'm pretty sure that I've seen that behavior in a different situation, where the act of looking for the file on ipfs.io speeds up the file coming back.
The text was updated successfully, but these errors were encountered: