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

Unable to read from work_peer ::ffff:172.17.0.2 7075: Connection reset by peer (104) #1324

Closed
luZheng-1122 opened this issue Oct 22, 2018 · 3 comments
Assignees
Projects
Milestone

Comments

@luZheng-1122
Copy link

Description of bug:

Steps to reproduce the issue:
1.build docker image with 'test' option:
./docker/node/build.sh -n test
source from: #443
2.run two docker containers with the image built in the first step, input different port number:
docker run --name nano1 -p 7001:7075/udp -p 7001:7075 -p 127.0.0.1:7011:7076 -v $(pwd):/root/RaiBlocksTest raiblocks-node-test
docker run --name nano2 -p 7002:7075/udp -p 7002:7075 -p 127.0.0.1:7012:7076 -v $(pwd):/root/RaiBlocksTest raiblocks-node-test
3.use RPC protocol to add work peers and bootstrap:
curl -d '{"action": "work_peer_add","address": "::ffff:172.17.0.3","port": "7075"}' 127.0.0.1:7011
curl -d '{"action": "bootstrap", "address": "::ffff:172.17.0.3", "port": "7075"}' 127.0.0.1:7011
'::ffff:172.17.0.3' is the ip address of one docker container.
4. when I try to send a RPC request to one node, I got this:

Describe the results you received:
when I add work peers, I got this:
[2018-10-22 05:52:14.056383]: 0x7f18b4000980 {"action": "work_peer_add","address": "::ffff:172.17.0.2","port": "7075"} [2018-10-22 05:52:14.057011]: RPC request 0x7f18b4000980 completed in: 660 microseconds [2018-10-22 05:57:06.793769]: Starting bootstrap attempt [2018-10-22 05:57:06.794616]: Bootstrap stopped because there are no peers [2018-10-22 05:57:06.795618]: Bootstrap stopped because there are no peers [2018-10-22 05:57:06.796194]: Bootstrap stopped because there are no peers [2018-10-22 05:57:06.796995]: Bootstrap stopped because there are no peers [2018-10-22 05:57:06.797559]: Bootstrap stopped because there are no peers [2018-10-22 05:57:06.798149]: Bootstrap stopped because there are no peers [2018-10-22 05:57:06.798809]: Bootstrap stopped because there are no peers [2018-10-22 05:57:06.799354]: Bootstrap stopped because there are no peers [2018-10-22 05:57:06.799986]: Bootstrap stopped because there are no peers [2018-10-22 05:57:06.800613]: Bootstrap stopped because there are no peers [2018-10-22 05:57:06.801241]: Exiting bulk push client [2018-10-22 05:57:06.801916]: Exiting bootstrap attempt [2018-10-22 06:00:52.837150]: Found a representative at [::ffff:172.17.0.2]:7075 [2018-10-22 06:00:52.838427]: Frontier sending finished [2018-10-22 06:02:06.007801]: Frontier sending finished [2018-10-22 06:02:06.795187]: Starting bootstrap attempt [2018-10-22 06:02:06.797426]: Received 1 frontiers from [::ffff:172.17.0.2]:7075 [2018-10-22 06:02:06.798485]: Completed frontier request, 0 out of sync accounts according to [::ffff:172.17.0.2]:7075 [2018-10-22 06:02:06.799370]: Completed pulls [2018-10-22 06:02:06.800043]: Bulk push finished [2018-10-22 06:02:06.800702]: Exiting bulk push client [2018-10-22 06:02:06.801444]: Exiting bootstrap attempt

when I send wallet add request, I got this:
[2018-10-22 06:22:36.893584]: Beginning pending block search [2018-10-22 06:22:36.895099]: Pending block search phase complete [2018-10-22 06:22:37.262700]: 0x7f18bc000a90 {"action": "wallet_add", "wallet": "1F68B3E5A07C36482E8BB611531E4B55B70129B32F277F0A5B89C7992A10C939", "key": "34F0A37AAD20F4A260F0A5B3CB3D7FB50673212263E58A380BC10474BB039CE4"} [2018-10-22 06:22:37.264385]: Unable to read from work_peer ::ffff:172.17.0.2 7075: Connection reset by peer (104) [2018-10-22 06:22:37.265631]: Work generation complete: 2118 us [2018-10-22 06:22:37.267023]: RPC request 0x7f18bc000a90 completed in: 4488 microseconds

Describe the results you expected:
I expect the two nodes can connect and sync.

Additional information you deem important (e.g. issue happens only occasionally):

Environment:

OS: macOS High Sierra
Darwin Kernel Version 17.5.0
Node version: 8

logs

@renesq
Copy link

renesq commented Oct 29, 2018

If I recall correctly, the node generally blocks peering with private docker IP ranges. I was advocating this because the node tended to peer with itself and found it's in sync with itself.
See node.cpp rai::reserved_address for a list of ranges

Cross-docker access is a bit quirky and I'm no expert on that, but why don't you try to peer and curl on localhost? Also try to adjust ports in the config.json to avoid any potential for clashes (not sure if UPNP automatically takes care of these docker ports), and then just bind the ports to the host.

@rkeene
Copy link
Contributor

rkeene commented Nov 20, 2018

Regarding the reserved ranges, in version 18+ it will be possible to override this exclusion using a config option created as part of pull request #1370 called "allow_local_peers".

@zhyatt zhyatt added this to Unscheduled in V18 Dec 27, 2018
@cryptocode
Copy link
Contributor

Seems like #1370 solves this as the IP used is in a reserved range.

@cryptocode cryptocode moved this from Unscheduled to CP 0 in V18 Dec 28, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
No open projects
V18
CP 0
Development

No branches or pull requests

4 participants