Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

ipfs swarm connect fails immediately with "dial back off" #2543

Closed
interfect opened this issue Apr 9, 2016 · 8 comments
Closed

ipfs swarm connect fails immediately with "dial back off" #2543

interfect opened this issue Apr 9, 2016 · 8 comments

Comments

@interfect
Copy link

I'm trying to debug/work around #2540, by manually convincing my IPFS to try connecting to some peers. I have the Windows x64 binary for 0.4.0.

When I try to use ipfs swarm connect to force a connection to a peer, it will sometimes fail immediately with a dial back off message:

C:\Users\anovak\bin\ipfs>ipfs swarm connect /ip6/fcd8:a4e5:3af7:557e:72e5:f9d1:a
599:e329/tcp/4001/ipfs/QmSoLV4Bbm51jM9C4gDYZQ9Cy3U6aXMJDAbzgu2fzaDs64
Error: connect QmSoLV4Bbm51jM9C4gDYZQ9Cy3U6aXMJDAbzgu2fzaDs64 failure: dial back
off

A few more tries of the command gets it to actually do something:

C:\Users\anovak\bin\ipfs>ipfs swarm connect /ip6/fcd8:a4e5:3af7:557e:72e5:f9d1:a
599:e329/tcp/4001/ipfs/QmSoLV4Bbm51jM9C4gDYZQ9Cy3U6aXMJDAbzgu2fzaDs64
Error: connect QmSoLV4Bbm51jM9C4gDYZQ9Cy3U6aXMJDAbzgu2fzaDs64 failure: dial atte
mpt failed: <peer.ID Pa3kGt> --> <peer.ID SoLV4B> dial attempt failed: message d
id not have trailing newline

(I think in this case it isn't working because the peer is not yet upgraded to 0.4. But clearly it at least sent some packets.)

Anyway, I think that my command to dial the peer is being understood as more of a suggestion, and if IPFS is already busily dialing and getting nowhere, it won't actually bother trying to talk to the peer I told it to talk to.

User commands shouldn't be subject to exponential back-off. Instead, ipfs swarm connect should result in an immediate network connection attempt to the named address, no matter how many other dialing attempts are in progress or failing, and no matter how recently the same peer has been dialed.

@kbtombul
Copy link

kbtombul commented Apr 9, 2016

(I think in this case it isn't working because the peer is not yet upgraded to 0.4. But clearly it at least sent some packets.)

I don't think that's the case, I was able to connect to that peer right after getting that error.

@EliasGabrielsson
Copy link
Contributor

I have similar experience. First time I run ipfs daemoneverything worked but next time it failed to get any peers and ipfs connect throw dial backoff.

ipfs-update install v0.4.0 - Success
ipfs init - New repo, success
ipfs daemon - Connected to 30 peers, success
Ctrl + c - Closed daemon, success.
ipfs daemon - Failed, no peers

ipfs swarm connect /ip4/104.236.151.122/tcp/4001/ipfs/QmSoLju6m7xTh3DuokvT3886QRYqxAzb1kShaanJgW36yx
Error: connect QmSoLju6m7xTh3DuokvT3886QRYqxAzb1kShaanJgW36yx failure: dial backoff

@whyrusleeping
Copy link
Member

mars has a patch currently that should help, you can ipfs swarm connect /ip4/104.131.131.82/tcp/4001/ipfs/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ and things should work as expected.

@EliasGabrielsson
Copy link
Contributor

I tried above command with this error:

$ ipfs swarm connect /ip4/104.131.131.82/tcp/4001/ipfs/QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ
Error: connect QmaCpDMGvV2BGHeYERUEnRQAwe3N8SzbUtfsmvsqQLuvuJ failure: dial attempt failed: failed to dial <peer.ID aCpDMG>

How could I see a more verbose error log?

@whyrusleeping
Copy link
Member

More verbose information about dials can be found in ipfs log tail. The command needs better filtering stuff to be built in, but its a good flow of 'everything thats happening'.

That said, I think this issue has been resolved.

@interfect
Copy link
Author

The underlying issue causing the connects to fail has I think been
resolved, but I would still prefer my manual connection directives not to
be subject to back-off, if that is architecturally feasible.

On Thu, Apr 28, 2016 at 1:48 PM, Jeromy Johnson notifications@github.com
wrote:

More verbose information about dials can be found in ipfs log tail. The
command needs better filtering stuff to be built in, but its a good flow of
'everything thats happening'.

That said, I think this issue has been resolved.


You are receiving this because you authored the thread.
Reply to this email directly or view it on GitHub
#2543 (comment)

@whyrusleeping
Copy link
Member

@interfect very much agreed. I opened #2456 as a way to get closer to that. Its not super easy due to how the dialing process currently works, but its something to move towards.

@codeimmortal
Copy link

update the latest version of ipfs from https://ipfs.io/docs/install/ and it solved my issue now the lastest version is 0.4.4 .

# for free to join this conversation on GitHub. Already have an account? # to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants