Eos: cleos command error

Created on 11 Jul 2018  ·  25Comments  ·  Source: EOSIO/eos

I install EOS on Ubuntu 18.04. If I run cleos wallet command without running keosd, the error is:
"/usr/local/bin/keosd" launched Unable to connect to keosd, if keosd is running please kill the process and try again.

If I run keosd first, then run cleos wallet list, the error is:
2490315ms thread-0 main.cpp:2756 main ] Failed with error: Assert Exception (10) response_content_length >= 0: Invalid content-length response

This command run well:

cleos --wallet-url http://127.0.0.1:8888 wallet list

but this error:

cleos --wallet-url http://localhost:8888 wallet list

Wallets:
1562262ms thread-0 main.cpp:2756 main ] Failed with error: Assert Exception (10)
response_content_length >= 0: Invalid content-length response

the hosts file has added: 127.0.0.1:localhost

bug

Most helpful comment

Has anybody fixed this? I tried changing http-validate-host to false in config.ini, but that didn't work.

All 25 comments

the second error means that the --wallet-url (or default value) doesn't match the http(s)-listen-address provided to keosd. Can you post the values of those?

@wanderingbort
I run the keosd and cleos without options. So the --wallet-url (or default value) and http(s)-listen-address both are 127.0.0.1:8900

2152842ms thread-0 http_plugin.cpp:331 plugin_initialize ] configured http to listen on 127.0.0.1:8900
2152842ms thread-0 wallet_plugin.cpp:39 plugin_initialize ] initializing wallet plugin
2152842ms thread-0 http_plugin.cpp:422 add_handler ] add api url: /v1/keosd/stop
2152842ms thread-0 http_plugin.cpp:376 plugin_startup ] start listening for http requests
2152843ms thread-0 wallet_api_plugin.cpp:73 plugin_startup ] starting wallet_api_plugin
2152843ms thread-0 http_plugin.cpp:422 add_handler ] add api url: /v1/wallet/create
2152843ms thread-0 http_plugin.cpp:422 add_handler ] add api url: /v1/wallet/create_key
2152843ms thread-0 http_plugin.cpp:422 add_handler ] add api url: /v1/wallet/get_public_keys
2152843ms thread-0 http_plugin.cpp:422 add_handler ] add api url: /v1/wallet/import_key
2152843ms thread-0 http_plugin.cpp:422 add_handler ] add api url: /v1/wallet/list_keys
2152843ms thread-0 http_plugin.cpp:422 add_handler ] add api url: /v1/wallet/list_wallets
2152843ms thread-0 http_plugin.cpp:422 add_handler ] add api url: /v1/wallet/lock
2152843ms thread-0 http_plugin.cpp:422 add_handler ] add api url: /v1/wallet/lock_all
2152843ms thread-0 http_plugin.cpp:422 add_handler ] add api url: /v1/wallet/open
2152843ms thread-0 http_plugin.cpp:422 add_handler ] add api url: /v1/wallet/remove_key
2152843ms thread-0 http_plugin.cpp:422 add_handler ] add api url: /v1/wallet/set_timeout
2152843ms thread-0 http_plugin.cpp:422 add_handler ] add api url: /v1/wallet/sign_digest
2152843ms thread-0 http_plugin.cpp:422 add_handler ] add api url: /v1/wallet/sign_transaction
2152843ms thread-0 http_plugin.cpp:422 add_handler ] add api url: /v1/wallet/unlock

Hi, same errors here on Ubuntu 16.04

reproduced with 1.0.7, 1.0.8, 1.0.9 - and 1.0.6 works flawlessly.

I am using the default port and it's reproducible.

i have same errors on ubuntu 16.04 , i installed yerterday

use last master ef654aa34c, get info reproduced same error:

2490315ms thread-0 main.cpp:2756 main ] Failed with error: Assert Exception (10) response_content_length >= 0: Invalid content-length response

well, for 1.0.9 and later, add http-validate-host = false to your config.ini.
https://github.com/EOSIO/eos/issues/4603#issuecomment-404372073

@spartucus where is r config.ini on imac?

@lvyg if you follow the document EOS developer, it is /tmp/eosio/config

Has anybody fixed this? I tried changing http-validate-host to false in config.ini, but that didn't work.

@sarojchintak it should work if you restart eosio

@sarojchintak restart keosd and it will be fine

What did you use to restart keosd/eosio? I've done both and no luck.

well, for 1.0.9 and later, add http-validate-host = false to your config.ini.

works fine!

I install eos follow the document, but can't find eosio finder in /tmp/.

How to solve? i want freedom

I have the same error in Ubuntu 16.04,add http-validate-host = false to my config.ini did not fix it

resolved
config add “http-validate-host = false”

OK,I solve it.

Has anybody fixed this? I tried changing http-validate-host to false in config.ini, but that didn't work.
eos version 1.0.10

@cppfuns cleos --wallet-url http://127.0.0.1:8900 wallet create worked for me but cleos wallet create did not

See this article to resolve this issue
https://www.bcskill.com/index.php/archives/268.html

when build eosio 1.0.10
if run
cleos wallet list
will get:

"/usr/local/bin/keosd" launched
Unable to connect to keosd, if keosd is running please kill the process and try again.

you will find http-server-address in config.ini with 127.0.0.1:8899
but the default is 8900, so change 8899 to 8900
now start keosd in one terminal, and in another terminal we can run cleos wallet list normally

but when I run it befoare 1.0.3, no such problem.

Once run "cleos --wallet-url http://127.0.0.1:8900 wallet list"
and now run cleos wallet list with no problem.

strange problem.

I working like this: $ cleos --wallet-url http://127.0.0.1:8888 wallet create

Was this page helpful?
0 / 5 - 0 ratings