Closed ChihChengLiang closed 5 years ago
@ChihChengLiang I am running go 1.11.1 and the repo is in my $GOPATH and I get this error occasionally when running from the CLI and no docker container:
Steps to reproduce:
Open a new terminal sesh and run
$ ./sharding-p2p-poc -seed=0 -port=10000 -rpcport=13000 &
[1] 27462
2018/11/16 16:18:17 Initializing logging reporter
16:18:17.752 INFO sharding-p: Node is listening: seed=0, addr=127.0.0.1:10000, peerID=QmS5QmciTXXnCUCyxud5eWFenUMAmvAWSDa1c7dvdXRMZ7 main.go:189
16:18:17.753 INFO sharding-p: RPC server listening to address: 127.0.0.1:13000 rpcserver.go:423
$ ./sharding-p2p-poc -seed=1 -port=10001 -rpcport=13001 &
[2] 27463
$ 2018/11/16 16:18:26 Initializing logging reporter
16:18:26.341 INFO sharding-p: Node is listening: seed=1, addr=127.0.0.1:10001, peerID=QmexAnfpHrhMmAC5UNQVS8iBuUUgDrMbMY17Cck2gKrqeX main.go:189
16:18:26.341 INFO sharding-p: RPC server listening to address: 127.0.0.1:13001 rpcserver.go:423
$ ./sharding-p2p-poc -seed=2 -port=10002 -rpcport=13002 &
[3] 27464
$ 2018/11/16 16:18:33 Initializing logging reporter
16:18:33.960 INFO sharding-p: Node is listening: seed=2, addr=127.0.0.1:10002, peerID=Qmd3wzD2HWA95ZAs214VxnckwkwM4GHJyC6whKUCNQhNvW main.go:189
16:18:33.960 INFO sharding-p: RPC server listening to address: 127.0.0.1:13002 rpcserver.go:423
Open another terminal sesh and run:
$ ./sharding-p2p-poc -port=10001 -rpcport=13001 -client addpeer 127.0.0.1 10000 0
16:20:28.108 CRITI sharding-p: Failed to add peer at 127.0.0.1:10000, err: rpc error: code = Unknown desc = Failed to connect to peer <peer.ID Qm*KoDARa>, err: dial attempt failed: <peer.ID Qm*gKrqeX> --> <peer.ID Qm*KoDARa> dial attempt failed: connected to wrong peer cli.go:136
You can see that we get an error, but if i run it again:
jonny@jonnys-MBP:$ ./sharding-p2p-poc -port=10001 -rpcport=13001 -client addpeer 127.0.0.1 10000 0
$ ./sharding-p2p-poc -port=10001 -rpcport=13001 -client listpeer
["QmS5QmciTXXnCUCyxud5eWFenUMAmvAWSDa1c7dvdXRMZ7"]
You can see that it worked.
I am thinking that it has something to go with the code running on go1.11.1.
I will trace through the code and investigate. If either @ChihChengLiang or @mhchia can confirm that it works on a previous version of Go...that might be a good lead.
It works for me on the first try. I'm using go1.11.1.
Note that I've updated my environment with
go get -v ...
make deps # get latest gx
make partial-gx-rw
go build
@jrhea I believe it's related to #100 and I'm currently working on the fix right now. Sorry for the trouble.
@nic619 ahhh... interesting. Let me know if you have a fix and I will test it. @ChihChengLiang I'll try your suggestion as well
@NIC619 your fix seemed to work.
Closed in favor of #121
What was wrong?
This is an attempt to fix #85 by using the Go mod approach.
How was it fixed?
By introducing
go.mod
andgo.sum
, thego mod download
step in thedev.Dockerfile
can cache the dependencies download, so no need togo get
every time on codebase changes.But there's an issue. The containers spun from the newly built images fails randomly when executing
add_peer
commands in Ansible scripts. The error message is:To reproduce this PR, one needs to
$GOPATH
Cute Animal Picture