EOSIO / eos

An open source smart contract platform
https://developers.eos.io/manuals/eos
MIT License
11.27k stars 3.6k forks source link

nodeos_run_test-mongodb fails #2471

Closed xdengpao closed 6 years ago

xdengpao commented 6 years ago
 Start 28: p2p_dawn515_test

28/31 Test #28: p2p_dawn515_test ....................... Passed 1.02 sec Start 29: nodeos_run_test-mongodb 29/31 Test #29: nodeos_run_test-mongodb ................***Failed 2.61 sec Start 30: distributed-transactions-test 30/31 Test #30: distributed-transactions-test .......... Passed 38.82 sec Start 31: distributed-transactions-remote-test 31/31 Test #31: distributed-transactions-remote-test ... Passed 56.02 sec 97% tests passed, 1 tests failed out of 31

Total Test time (real) = 396.72 sec

The following tests FAILED: 29 - nodeos_run_test-mongodb (Failed) Errors while running CTest Makefile:61: recipe for target 'test' failed make: *** [test] Error 8

================================================================= Contents of var/lib/node_00/stderr.txt: 1243131ms thread-0 chain_plugin.cpp:99 plugin_initialize ] initializing chain plugin 1243131ms thread-0 chain_plugin.cpp:137 plugin_initialize ] Resync requested: wiping database and blocks 1243131ms thread-0 mongo_db_plugin.cpp:803 plugin_initialize ] initializing mongo_db_plugin 1243131ms thread-0 mongo_db_plugin.cpp:811 plugin_initialize ] Resync requested: wiping mongo database on startup 1243131ms thread-0 mongo_db_plugin.cpp:821 plugin_initialize ] connecting to mongodb://localhost:27017/EOStest 1243131ms thread-0 mongo_db_plugin.cpp:717 wipe_database ] mongo db wipe_database

== Errors see above == Shut down the cluster. cmd: programs/eosio-launcher/eosio-launcher -k 15 cmd: pkill nodeos Shut down the wallet. cmd: pkill keosd Traceback (most recent call last): File "tests/nodeos_run_test.py", line 93, in if cluster.launch(prodCount=prodCount) is False: File "/home/eos/eos/build/tests/testUtils.py", line 1198, in launch if not self.waitOnClusterBlockNumSync(1): File "/home/eos/eos/build/tests/testUtils.py", line 1318, in waitOnClusterBlockNumSync if node.doesNodeHaveBlockNum(targetHeadBlockNum) is False: File "/home/eos/eos/build/tests/testUtils.py", line 316, in doesNodeHaveBlockNum info=self.getInfo(silentErrors=True) File "/home/eos/eos/build/tests/testUtils.py", line 851, in getInfo trans=Node.runCmdReturnJson(cmd) File "/home/eos/eos/build/tests/testUtils.py", line 158, in runCmdReturnJson return jsonData UnboundLocalError: local variable 'jsonData' referenced before assignment

wuuzx commented 6 years ago

Same problem with a empty var/lib on tag dawn-v3.0.0

according to

cd eos/build tests/nodeos_run_test.py --mongodb -v --dump-error-detail >& mongo_test.out

Then send the mongo_test.out file.

here is the output : cat mongo_test.out BEGIN TEST_OUTPUT: test_output_0.txt SERVER: localhost PORT: 8888 echo db.version() | mongo --host localhost --port 27017 EOStest MongoDb response: b'MongoDB shell version v3.6.3\nconnecting to: mongodb://localhost:27017/EOStest\nMongoDB server version: 3.6.3\n3.6.3\nbye\n' cmd: programs/eosio-launcher/eosio-launcher -k 15

== Errors see above == Shut down the cluster. cmd: programs/eosio-launcher/eosio-launcher -k 15 Traceback (most recent call last): File "./nodeos_run_test.py", line 90, in cluster.killall() File "/home/wu/eos/build/tests/testUtils.py", line 1882, in killall if 0 != subprocess.call(cmd.split(), stdout=Utils.FNull): File "/usr/lib/python3.5/subprocess.py", line 557, in call with Popen(*popenargs, **kwargs) as p: File "/usr/lib/python3.5/subprocess.py", line 947, in init restore_signals, start_new_session) File "/usr/lib/python3.5/subprocess.py", line 1551, in _execute_child raise child_exception_type(errno_num, err_msg) FileNotFoundError: [Errno 2] No such file or directory: 'programs/eosio-launcher/eosio-launcher'

During handling of the above exception, another exception occurred:

Traceback (most recent call last): File "./nodeos_run_test.py", line 633, in cluster.killall() File "/home/wu/eos/build/tests/testUtils.py", line 1882, in killall if 0 != subprocess.call(cmd.split(), stdout=Utils.FNull): File "/usr/lib/python3.5/subprocess.py", line 557, in call with Popen(*popenargs, **kwargs) as p: File "/usr/lib/python3.5/subprocess.py", line 947, in init restore_signals, start_new_session) File "/usr/lib/python3.5/subprocess.py", line 1551, in _execute_child raise child_exception_type(errno_num, err_msg) FileNotFoundError: [Errno 2] No such file or directory: 'programs/eosio-launcher/eosio-launcher'

But esoio-launcher is there!

dahifi commented 6 years ago

Check the owner on 'programs/eosio-launcher/eosio-launcher'. I had same error and turned out that root was owner, not my user account. I believe it was caused by me running build as sudo.

See my notes on #2464, I ran chown on my entire build dir and now I'm getting the jsonData error that you mentioned, but mine is on the nodeos_run_test.

wuuzx commented 6 years ago

Thank you for replay. But seems not my case

image

dahifi commented 6 years ago

I've been having similar problems with the nodeos_run_test.py as well on both master and Dawn-v3.0.0. What version of Ubuntu are you running? Have you tried blowing out our eos directory and rebuilding from scratch?

wuuzx commented 6 years ago

Ubuntu 16.04. Yes I have clone it from github and rebuilding from scratch. A previous build run test without any error, but encounter a bug later (can not compile sample contract), so I delete entire directory and clone a new version, then encounter this problem. any idea? By the way I have make install before, does that matters?

xdengpao commented 6 years ago

ubunt 16.04. I have rebuilded Dawn-v3.0.0 for two times, but it have the same problem.

wuuzx commented 6 years ago

After delete, clone, build again. The error is still there, but following command report a defferent reseaon now:

tests/nodeos_run_test.py --mongodb -v --dump-error-detail

BEGIN TEST_OUTPUT: test_output_0.txt SERVER: localhost PORT: 8888 echo db.version() | mongo --host localhost --port 27017 EOStest MongoDb response: b'MongoDB shell version v3.6.3\nconnecting to: mongodb://localhost:27017/EOStest\nMongoDB server version: 3.6.3\n3.6.3\nbye\n' cmd: programs/eosio-launcher/eosio-launcher -k 15 cmd: pkill nodeos echo db.dropDatabase() | mongo --host localhost --port 27017 EOStest Stand up cluster cmd: programs/eosio-launcher/eosio-launcher -p 1 -n 1 -s mesh -d 1 -f --nodeos --log-level-net-plugin debug --plugin eosio::mongo_db_plugin --resync --mongodb-uri mongodb://localhost:27017/EOStest launching bios spawning child, programs/nodeos/nodeos --log-level-net-plugin debug --resync --config-dir etc/eosio/node_bios --data-dir var/lib/node_bios launching testnet_00 spawning child, programs/nodeos/nodeos --log-level-net-plugin debug --plugin eosio::mongo_db_plugin --resync --mongodb-uri mongodb://localhost:27017/EOStest --config-dir etc/eosio/node_00 --data-dir var/lib/node_00


run 'bash bios_boot.sh' to kick off delegated block production


 cmd: pgrep -a nodeos

pgrep: "1703 programs/nodeos/nodeos --log-level-net-plugin debug --resync --config-dir etc/eosio/node_bios --data-dir var/lib/node_bios 1704 programs/nodeos/nodeos --log-level-net-plugin debug --plugin eosio::mongo_db_plugin --resync --mongodb-uri mongodb://localhost:27017/EOStest --config-dir etc/eosio/node_00 --data-dir var/lib/node_00 " Node> Host: localhost, Port:8888 Cluster viability smoke test. Validate every cluster node has block 1. cmd: programs/cleos/cleos --host localhost --port 8888 --wallet-host localhost --wallet-port 8899 get info RAW > Failed to connect to nodeos at localhost:8888; is nodeos running?

      JSON> 

================================================================= Contents of etc/eosio/node_00/config.ini: genesis-json = ./genesis.json block-log-dir = blocks readonly = 0 send-whole-blocks = true http-server-address = 127.0.0.1:8888 p2p-listen-endpoint = 0.0.0.0:9876 p2p-server-address = localhost:9876 allowed-connection = any p2p-peer-address = localhost:9776 required-participation = 33 private-key = ["EOS8QNPjDEwW1GUgvBjEnbU8DzmhEw7aBqA7XNpTTKFFpC3zZKbZC","5KDe1JGqxBmcgyp9FHia3RPToxtT5p52s5E5DHge1tAY5oh6nZQ"] producer-name = inita producer-name = initb producer-name = initc producer-name = initd producer-name = inite producer-name = initf producer-name = initg producer-name = inith producer-name = initi producer-name = initj producer-name = initk producer-name = initl producer-name = initm producer-name = initn producer-name = inito producer-name = initp producer-name = initq producer-name = initr producer-name = inits producer-name = initt producer-name = initu plugin = eosio::producer_plugin plugin = eosio::chain_api_plugin plugin = eosio::account_history_api_plugin

Contents of var/lib/node_00/stderr.txt: 1093743ms thread-0 chain_plugin.cpp:99 plugin_initialize ] initializing chain plugin 1093743ms thread-0 chain_plugin.cpp:137 plugin_initialize ] Resync requested: wiping database and blocks 1093743ms thread-0 mongo_db_plugin.cpp:803 plugin_initialize ] initializing mongo_db_plugin 1093743ms thread-0 mongo_db_plugin.cpp:811 plugin_initialize ] Resync requested: wiping mongo database on startup 1093743ms thread-0 mongo_db_plugin.cpp:821 plugin_initialize ] connecting to mongodb://localhost:27017/EOStest 1093743ms thread-0 mongo_db_plugin.cpp:717 wipe_database ] mongo db wipe_database

== Errors see above == Shut down the cluster. cmd: programs/eosio-launcher/eosio-launcher -k 15 cmd: pkill nodeos Shut down the wallet. cmd: pkill keosd Traceback (most recent call last): File "tests/nodeos_run_test.py", line 93, in if cluster.launch(prodCount=prodCount) is False: File "/home/wu/eos/build/tests/testUtils.py", line 1251, in launch if not self.waitOnClusterBlockNumSync(1): File "/home/wu/eos/build/tests/testUtils.py", line 1357, in waitOnClusterBlockNumSync ret=Utils.waitForBool(lam, timeout) File "/home/wu/eos/build/tests/testUtils.py", line 114, in waitForBool ret=Utils.waitForObj(myLam) File "/home/wu/eos/build/tests/testUtils.py", line 101, in waitForObj ret=lam() File "/home/wu/eos/build/tests/testUtils.py", line 113, in myLam = lambda: True if lam() else None File "/home/wu/eos/build/tests/testUtils.py", line 1356, in lam = lambda: doNodesHaveBlockNum(self.nodes, targetHeadBlockNum) File "/home/wu/eos/build/tests/testUtils.py", line 1351, in doNodesHaveBlockNum if (not node.killed) and (not node.doesNodeHaveBlockNum(targetHeadBlockNum)): File "/home/wu/eos/build/tests/testUtils.py", line 339, in doesNodeHaveBlockNum info=self.getInfo(silentErrors=True) File "/home/wu/eos/build/tests/testUtils.py", line 839, in getInfo trans=Node.runCmdReturnJson(cmd) File "/home/wu/eos/build/tests/testUtils.py", line 182, in runCmdReturnJson return jsonData UnboundLocalError: local variable 'jsonData' referenced before assignment

wuuzx commented 6 years ago

this is a snapshot of error(on master branch) image

reoxey commented 6 years ago

I have exactly the same issue

  Node> Host: localhost, Port:8888
 Cluster viability smoke test. Validate every cluster node has block 1. 
         cmd: programs/cleos/cleos --host localhost --port 8888  --wallet-host localhost --wallet-port 8899 get info
          RAW > Failed to connect to nodeos at localhost:8888; is nodeos running?

          JSON> 
amActiveHello commented 6 years ago

1、sec@ll-B85M-DS3H-A:~/rgh/eos_719/eos/build/programs/cleos$ ./cleos create account eosio user EOS7eanXtt1fx9sThAtg1pohi4bVVfHu2XanYaMjtxhtC65CV2S6q ### Failed to connect to nodeos at http://127.0.0.1:8888/; is nodeos running? 2、sec@ll-B85M-DS3H-A:~/rgh/eos_719/eos/build/programs/cleos$ ./cleos set contract eosio /home/sec/rgh/eos_719/eos/build/contracts/eosio.bios -p eosio@active Reading WAST/WASM from /home/sec/rgh/eos_719/eos/build/contracts/eosio.bios/eosio.bios.wasm... Using already assembled WASM... Publishing contract...

Failed to connect to nodeos at http://127.0.0.1:8888/; is nodeos running?

3、可是8888端口没有占用,nodeos没有启动

RyoNgs commented 6 years ago

this is my solution. about nodeos_run_test-mongodb failed.

  1. install mongo db core -> $ sudo apt-get install mongodb-server-core
  2. install mongo db client -> $ sudo apt install mongodb-clients
  3. test mongo db -> eosio/build/tests/nodeos_run_test.py --mongod -v --dump-error-detail >& mongo_test.out
  4. check log -> vi eosio/build/mongo_test.out

image

  1. build validation -> $ ~/opt/mongodb/bin/mongod -f ~/opt/mongodb/mongod.conf & -> $ cd eosio/build -> make test
MarcelBlockchain commented 6 years ago

Just tried to run the test, seems they changed the args from --mongod to --mongodb. But somehow 'command not found' is still printed

jgiszczak commented 6 years ago

Bad script generating UnboundLocalError: local variable 'jsonData' referenced before assignment was corrected quote some time ago.

The argument has always been --mongodb. Report of --mongod above is a typo.

@MarcelBlockchain See dahifi's comment about checking ownership/permissions of all files. EOS.IO should not be built with sudo.