Eos: keosd connection error

Created on 6 Jun 2018  路  12Comments  路  Source: EOSIO/eos

OS: macOS High Sierra 10.13.4 (17E202)
EOS: 1.0.1 (379cb1a9)

I'm starting nodeos as such; Exactly the same as previous versions with the exact same config.ini.

nodeos -e -p eosio --config-dir ~/eosio-wallet

With the following config.ini

http-server-address = 127.0.0.1:8888
access-control-allow-origin = *
access-control-allow-credentials = false
wallet-dir = "."
unlock-timeout = 3600
producer-name = eosio
enable-stale-production = true
plugin = eosio::http_plugin
plugin = eosio::chain_api_plugin
plugin = eosio::history_api_plugin
plugin = eosio::wallet_api_plugin
plugin = eosio::producer_plugin

And I'm receiving the following error when running cleos wallet list after migrating to EOS 1.0.1

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

And attempting to run keosd itself (even though nodeos starts it?) results in this error;

~/contracts/eos/libraries/appbase/application.cpp(304): Throw in function appbase::abstract_plugin &appbase::application::get_plugin(const string &) const
Dynamic exception type: boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<std::runtime_error> >
std::exception::what: unable to find plugin: eosio::chain_api_plugin

I've tried finding the keosd process, apparently none is running, and tried another build and install, though I'm not sure of ALL directories i should clean exiting files from.

Most helpful comment

cd ~/eosio-wallet/
vim config.ini
modify:
http-server-address = 127.0.0.1:8889
added
plugin = eosio::http_plugin
plugin = eosio::wallet_api_plugin

then go to keosd folder
cd /path/build/programs/keosd
./keosd

2006570ms thread-0 http_plugin.cpp:290 plugin_initialize ] configured http to listen on 127.0.0.1:8889
2006570ms thread-0 wallet_plugin.cpp:39 plugin_initialize ] initializing wallet plugin
2006570ms thread-0 http_plugin.cpp:377 add_handler ] add api url: /v1/keosd/stop
2006570ms thread-0 http_plugin.cpp:331 plugin_startup ] start listening for http requests
2006571ms thread-0 wallet_api_plugin.cpp:73 plugin_startup ] starting wallet_api_plugin
2006571ms thread-0 http_plugin.cpp:377 add_handler ] add api url: /v1/wallet/create
2006571ms thread-0 http_plugin.cpp:377 add_handler ] add api url: /v1/wallet/create_key
2006571ms thread-0 http_plugin.cpp:377 add_handler ] add api url: /v1/wallet/get_public_keys
2006571ms thread-0 http_plugin.cpp:377 add_handler ] add api url: /v1/wallet/import_key

and then

./cleos --wallet-url="http://localhost:8889/" wallet list

All 12 comments

the default url for the wallet API is now http://localhost:8900/ if you run the wallet api as part of a nodeos instance you will need to tell cleos to access the wallet on a non-standard URL with the --wallet-url option.

That said, Co-locating the wallet API and a running nodeos is deprecated and considered less secure than separating the process spaces which run untrusted code (WASM contracts) and sensitive data (private keys).

I compiled and installed EOS 1.0.1 on a fresh computer with no errors, but I'm still getting the same error on the computer I migrated.

Running cleos --wallet-url="http://localhost:8900/" wallet list returns;

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

Running keosd returns;

749431ms thread-0   http_plugin.cpp:285           plugin_initialize    ] configured http to listen on 127.0.0.1:8888
749431ms thread-0   main.cpp:52                   main                 ] /Users/mitch/contracts/eos/libraries/appbase/application.cpp(304): Throw in function appbase::abstract_plugin &appbase::application::get_plugin(const string &) const
Dynamic exception type: boost::exception_detail::clone_impl<boost::exception_detail::error_info_injector<std::runtime_error> >
std::exception::what: unable to find plugin: eosio::chain_api_plugin

@MitchPierias I have met the same issue, do you know how to fix it now?

@chebaogong No luck yet. Compiling and installing on a fresh machine works fine, but migration from EOS Dawn 4 too EOS 1.0.1 seems to produce this error for me. My suspicion is a lingering config or keos file from Dawn 4 that's interfering with 1.0.1, but I can't find all files to remove for a clean install... This is rendering one of my development systems completely unusable at this time.

@MitchPierias, @chebaogong, looks like it's because previous port value exist in cleos config file. Change http-server-address in it and/or use same port in --wallet-url. More info: https://eosio.stackexchange.com/a/858/1618

if you are using Docker, just run this code on your command Line,

alias cleos='docker exec eosio /opt/eosio/bin/cleos --wallet-url http://localhost:8888'

that should solve your problem.

cd ~/eosio-wallet/
vim config.ini
modify:
http-server-address = 127.0.0.1:8889
added
plugin = eosio::http_plugin
plugin = eosio::wallet_api_plugin

then go to keosd folder
cd /path/build/programs/keosd
./keosd

2006570ms thread-0 http_plugin.cpp:290 plugin_initialize ] configured http to listen on 127.0.0.1:8889
2006570ms thread-0 wallet_plugin.cpp:39 plugin_initialize ] initializing wallet plugin
2006570ms thread-0 http_plugin.cpp:377 add_handler ] add api url: /v1/keosd/stop
2006570ms thread-0 http_plugin.cpp:331 plugin_startup ] start listening for http requests
2006571ms thread-0 wallet_api_plugin.cpp:73 plugin_startup ] starting wallet_api_plugin
2006571ms thread-0 http_plugin.cpp:377 add_handler ] add api url: /v1/wallet/create
2006571ms thread-0 http_plugin.cpp:377 add_handler ] add api url: /v1/wallet/create_key
2006571ms thread-0 http_plugin.cpp:377 add_handler ] add api url: /v1/wallet/get_public_keys
2006571ms thread-0 http_plugin.cpp:377 add_handler ] add api url: /v1/wallet/import_key

and then

./cleos --wallet-url="http://localhost:8889/" wallet list

@rainysiu had the same problem but now its working after this, Thanks

I've encountered the same issue before, turns out the problem is by default, cleos starts keosd at ::1:8900, however, cleos always trying to connect to 127.0.0.1:8900.

So, an alternative solution is specifying wallet-url the first querying keosd through cleos. For example, I can try to list all imported keys(though at this point, the wallet wasn't created yet):

cleos --wallet-url http://127.0.0.1:8900 wallet keys

with that, cleos will have keosd started at 127.0.0.1:8900.

The next time you can interact with keosd without --wallet-url specified.

Can confirm @chengevo's work around here worked for me when I had the same issue.

@chebaogong I found the problem was starting nodeos with the eosio-wallet config file and inherently configuring my eosio-wallet/config.ini with nodeos commands. This made the wallet start on incorrect ports and look for plugins which were specific too nodeos and not keosd. Thanks to @zxcat for pointing out this problem.

@MitchPierias @zxcat Thank you very much. It works now.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

toonsevrin picture toonsevrin  路  3Comments

dimakomar picture dimakomar  路  3Comments

christola picture christola  路  3Comments

yashbhavsar007 picture yashbhavsar007  路  3Comments

hoopslb picture hoopslb  路  3Comments