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

Node restart a lot of times when start a test (MacOS) #183

Open
thieuanh1995hn opened this issue Sep 4, 2019 · 10 comments
Open

Node restart a lot of times when start a test (MacOS) #183

thieuanh1995hn opened this issue Sep 4, 2019 · 10 comments

Comments

@thieuanh1995hn
Copy link

thieuanh1995hn commented Sep 4, 2019

  • When i run:
python3 tests/hello_world.py
###  SCENARIO:
Create a contract from template, then build and deploy it.

Removing testnet cache for prefix `_127_0_0_1_8888_`
Testnet cache successfully removed.
Local node is stopped [].
Starting nodeos, cpu percent: 0, 0, 0, 0, 0; 0; 0; 0; 0; 0; 0;
Local node is stopped [].
Starting nodeos, cpu percent: 0, 0, 0, 0, 0; 0; 0; 0; 0; 0; 0;
Local node is stopped [].
Starting nodeos, cpu percent: 0, 0, 0, 0, 0; 0; 0; 0; 0; 0; 0;
Local node is stopped [7514].
Local node is stopped [].
ERROR:
The local 'nodeos' failed to start few times in sequence. Perhaps, something is
wrong with configuration of the system. See the command line issued:

nodeos --http-server-address 127.0.0.1:8888 --chain-state-db-size-mb 300 --contracts-console --verbose-http-errors --enable-stale-production --producer-name eosio --signature-provider EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV=KEY:5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3 --plugin eosio::producer_plugin --plugin eosio::chain_api_plugin --plugin eosio::http_plugin --delete-all-blocks


Now, see the result of execution of the command line:

..

Just another hang incident of the 'nodeos' executable.

Rerun the script.
  • But when i run directly
nodeos --http-server-address 127.0.0.1:8888 --chain-state-db-size-mb 300 --contracts-console --verbose-http-errors --enable-stale-production --producer-name eosio --signature-provider EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV=KEY:5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3 --plugin eosio::producer_plugin --plugin eosio::chain_api_plugin --plugin eosio::http_plugin --delete-all-blocks

Everything fine nodes was started and eosio produced block like normal.
Please help !

@thieuanh1995hn thieuanh1995hn changed the title Node restart a lot of times when start a test Node restart a lot of times when start a test (Macos) Sep 4, 2019
@thieuanh1995hn thieuanh1995hn changed the title Node restart a lot of times when start a test (Macos) Node restart a lot of times when start a test (MacOS) Sep 4, 2019
@thieuanh1995hn
Copy link
Author

I know the issue . Cause this library parse result in terminal of cleos command to JSON . But my result show with some warning . So it make your solution error !

@stefanzarembinski
Copy link
Contributor

Let me explain how does EOSFactory work.
First, it issues a command to a System. In your case, the command is

nodeos --http-server-address 127.0.0.1:8888 --chain-state-db-size-mb 300 --contracts-console --verbose-http-errors --enable-stale-production --producer-name eosio --signature-provider EOS6MRyAjQq8ud7hVNYcfnVPJqcVpscN5So8BhtHuGYqET5GDW5CV=KEY:5KQwrPbwdL6PhXujxW37FSSQZ1JiwsST4cqQzDeyXtP79zkvFD3 --plugin eosio::producer_plugin --plugin eosio::chain_api_plugin --plugin eosio::http_plugin --delete-all-blocks

Next, after a time (commas change to semicolons) EOSFactory successively (every second) sends the get info request to the local node. If few successful responses from the node are valid (semicolons change to starlets), EOSFActory is satisfied and reports that the local node is active.

For some reason, unknown to me, some Macs are slow with starting the nodeos and a newly launched node does not response before a preset timeout. This is a deficiency of the code and I will correct it.

You say that you have found a fix. Please, explain it to me.

If you have EOSFactory installed as GitHub repository, you can try to expand the timeout.
In file eosfactory/core/teos.py, the timeout is set in line 771. Now, it is 7:

def node_probe():
    DELAY_TIME = 4
    WAIT_TIME = 1

    NUMBER_BLOCKS_ADDED = 3
    NUMBER_GET_INFO_CALLS = 7 # <--- here!

@thieuanh1995hn
Copy link
Author

thieuanh1995hn commented Sep 8, 2019

@stefanzarembinski

  • EOSFactory will parse the result command cleos to JSON, at first it calling get info cleos API to check node right ? When i Use my Mac with region is my country (Vietnam) Cleos show some warning every cleos command i see warning something about some symbols not support.
  • Yeah i use cleos directly before and everything normal and i did not decide to fix it . But when i Jumb to ur source code and know about how the code working i change region to USA and the warning disappear and the bug too . I started node normally by EOSfactory.
  • I suggest to using web API instead to prevent this bug !

@stefanzarembinski
Copy link
Contributor

EOSFactory will parse the result command cleos to JSON
-- not exactly, it uses the command line literally as a bash command, exactly as you do it. Then it calls cleos get info command repeatably.

Your remark about the localization is precious to me. I will work on this issue.

Let you know that your suggestion about the web API (EOSJS) is under development now. However, it is not being implemented because of the localization issue that has to be fixed otherwise. Our reason for the EOSJS interface is having EOSFactory independent of the heavy dependency on EOS.

@stefanzarembinski
Copy link
Contributor

@thieuanh1995hn, you say "When i Use my Mac with region is my country (Vietnam) Cleos show some warning every cleos command i see warning something about some symbols not support.". Will you, please, show me these warnings?

@thieuanh1995hn
Copy link
Author

thieuanh1995hn commented Sep 10, 2019

  • Here is my language and region setup when Eosfactory bug exist:

Screen Shot 2019-09-10 at 18 04 04

Screen Shot 2019-09-10 at 18 04 08

  • You can see those warning. It come with eosfactory bug . When i changed region to USA warning and bug gone !

@stefanzarembinski
Copy link
Contributor

Thank you. I will fix it.

@stefanzarembinski
Copy link
Contributor

But, I see now that you show me a result from a call to cleos. Could you present the same effect with a Python EOSFactory script?

@thieuanh1995hn
Copy link
Author

But, I see now that you show me a result from a call to cleos. Could you present the same effect with a Python EOSFactory script?

  • In Python EOSFactory it just fail to check node started . It called get info in your code and i debug that the result of get info has been returned. But it can not parse to JSON. May be i will change region, start a python test and show you bug latter.

@stefanzarembinski
Copy link
Contributor

Thank you. I will install Vietnamese on my system to see the problem.

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

No branches or pull requests

2 participants