Skip to content
This repository has been archived by the owner on May 24, 2022. It is now read-only.

Client fails to setup due to race during docker node startup #36

Closed
0x7CFE opened this issue Oct 27, 2017 · 7 comments
Closed

Client fails to setup due to race during docker node startup #36

0x7CFE opened this issue Oct 27, 2017 · 7 comments
Labels

Comments

@0x7CFE
Copy link
Contributor

0x7CFE commented Oct 27, 2017

When deploy is invoked with like ./parity-deploy.sh --config aura -n 1 -r nightly --min-gas-price 0 --enable-client --reserved-only, client node is created.

Unfortunately the following scenario is possible: https://gist.github.com/0x7CFE/df64afad8244e74156a772a6b2df28f0

tl;dr: Client fails to start due to failed name resolution (related to openethereum/parity-ethereum#6907). Looks like this happens because of a race between nodes. If host1 starts before client all is working as expected. However, client may try to resolve host1 before latter obtains an IP address.

In order to fix that, we need either fix the order in which nodes start or assign static addresses to nodes.

@0x7CFE 0x7CFE added the bug label Oct 27, 2017
@0x7CFE
Copy link
Contributor Author

0x7CFE commented Oct 27, 2017

Found the best solution so far and it is: https://docs.docker.com/compose/startup-order/
So, client node simply should depend on all hosts. That would fix the race.

@0x7CFE
Copy link
Contributor Author

0x7CFE commented Oct 30, 2017

Unfortunately that wasn't enough. On a more complex case other than 1 client 1 authority, the problem remains. That's because each authority node is configured so that other authorities are set as reserved nodes. So host1 depends on host2 and vice versa.

This results in the following dead loop:

$ sudo docker-compose up
Creating network "paritydeploy_default" with the default driver
Creating host2
Creating host1
Creating client
Attaching to host1, host2, client
host1     | Loading config file from /parity/authority.toml
host2     | Loading config file from /parity/authority.toml
host2     | Invalid node address format given for a boot node: enode://be0df3e855e5995a57ecf1e863aba96f0e29f075a9cbb359456b045b67d895c87c4935599306b797ef2b172d2b6556d0c57f60dcc1b5f0b4080bb74ebb2c32e2@host1:30303
host1     | Invalid node address format given for a boot node: enode://ba1d0e6d920b7e219f13ef540319c361abbd9c26e5487ff35f6a019cd8dd2d6d62642b55a06472a766f12705de971a1bb40d5f643d0f38e58f7960f79fe13ef4@host2:30303
client    | Loading config file from /parity/client.toml
host1 exited with code 1
host2 exited with code 1
client    | Invalid node address format given for a boot node: enode://be0df3e855e5995a57ecf1e863aba96f0e29f075a9cbb359456b045b67d895c87c4935599306b797ef2b172d2b6556d0c57f60dcc1b5f0b4080bb74ebb2c32e2@host1:30303
client exited with code 1

We need either to solve nameserver issues, retry resolution after some time or bring all hosts up and then actually start the business logic.

@0x7CFE 0x7CFE reopened this Oct 30, 2017
@ddorgan
Copy link
Collaborator

ddorgan commented Feb 23, 2018

I believe a fix was introduced for this. Can you please retest.

@ddorgan ddorgan closed this as completed Feb 23, 2018
@ddorgan ddorgan reopened this Feb 23, 2018
@ddorgan
Copy link
Collaborator

ddorgan commented Mar 21, 2018

@0x7CFE is this still any issue?

@ddorgan
Copy link
Collaborator

ddorgan commented Apr 4, 2018

@0x7CFE any update on this?

@0x7CFE
Copy link
Contributor Author

0x7CFE commented Jun 14, 2018

@ddorgan, sorry for the late response. I haven't used docker recently. Probably would be better to ask someone, who is working on it now.

@ddorgan
Copy link
Collaborator

ddorgan commented Jun 15, 2018

@0x7CFE Thanks! Closing issue.

@ddorgan ddorgan closed this as completed Jun 15, 2018
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
Projects
None yet
Development

No branches or pull requests

2 participants