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

Failure on 'cleos create account...' in docker image #5959

Closed
kination opened this issue Oct 11, 2018 · 7 comments
Closed

Failure on 'cleos create account...' in docker image #5959

kination opened this issue Oct 11, 2018 · 7 comments
Assignees
Labels

Comments

@kination
Copy link

kination commented Oct 11, 2018

Hello,
I'm currently running EOSIO in docker image(docker pull eosio/eos), following guide in getting started.

In 1.7, when I run 'create account' inside docker container, it shows error like:

root@e94ff54bc0d5:/# cleos create account eosio jung XXXXXX...
Failed to connect to nodeos at http://127.0.0.1:8888/; is nodeos running?

I tried nodeos, and it shows:

root@e94ff54bc0d5:/# nodeos
2018-10-11T06:26:38.938 thread-0   chain_plugin.cpp:329          plugin_initialize    ] initializing chain plugin
2018-10-11T06:26:38.938 thread-0   chain_plugin.cpp:570          plugin_initialize    ] Starting up fresh blockchain with default genesis state.
2018-10-11T06:26:38.964 thread-0   http_plugin.cpp:422           plugin_initialize    ] configured http to listen on 127.0.0.1:8888
2018-10-11T06:26:38.964 thread-0   net_plugin.cpp:2891           plugin_initialize    ] Initialize net plugin
2018-10-11T06:26:38.964 thread-0   net_plugin.cpp:2917           plugin_initialize    ] host: 0.0.0.0 port: 9876
2018-10-11T06:26:38.964 thread-0   net_plugin.cpp:2988           plugin_initialize    ] my node_id is 6f8eaae92de225a80111aec9cf08060c9dfc0e2ebd9cbbce790f8ddae82e1699
2018-10-11T06:26:38.964 thread-0   main.cpp:110                  main                 ] nodeos version v1.3.0
2018-10-11T06:26:38.964 thread-0   main.cpp:111                  main                 ] eosio root is /root/.local/share
2018-10-11T06:26:38.965 thread-0   controller.cpp:1398           startup              ] No head block in fork db, perhaps we need to replay
2018-10-11T06:26:38.965 thread-0   controller.cpp:375            initialize_fork_db   ]  Initializing new blockchain with genesis state
2018-10-11T06:26:38.993 thread-0   chain_plugin.cpp:662          plugin_startup       ] starting chain in read/write mode
2018-10-11T06:26:38.993 thread-0   chain_plugin.cpp:666          plugin_startup       ] Blockchain started; head block is #1, genesis timestamp is 2018-06-01T12:00:00.000
2018-10-11T06:26:38.993 thread-0   http_plugin.cpp:486           plugin_startup       ] start listening for http requests
2018-10-11T06:26:38.993 thread-0   net_plugin.cpp:3003           plugin_startup       ] net_plugin::plugin_startup failed to bind to port 9876
2018-10-11T06:26:39.022 thread-0   main.cpp:150                  main                 ] std::exception

Is there something I have to do?

@taokayan
Copy link
Contributor

taokayan commented Oct 11, 2018

Looks like nodes failed to startup because port 9876 is occupied. Try to change the port number from 9876 to something else?

@kination
Copy link
Author

@taokayan thanks! Can I change port number inside docker container?

@taokayan
Copy link
Contributor

I guess the easiest way is to kill the process that occupies port 9876

@kination
Copy link
Author

Is there some relation with #5179 ?

@jgiszczak
Copy link
Contributor

Within your docker volume, edit /opt/eosio/bin/data-dir/config.ini and change p2p-listen-endpoint = 0.0.0.0:9876 to the port you prefer. Then restart nodeos within docker.

@kination
Copy link
Author

@jgiszczak thanks for guide, but there is no directory data-dir inside /opt/eosio/bin.
There were config.ini file in root, so I changed to:

...
# The actual host:port used to listen for incoming p2p connections. (eosio::net_plugin)
p2p-listen-endpoint = 0.0.0.0:9000

# An externally accessible host:port for identifying this node. Defaults to p2p-listen-endpoint. (eosio::net_plugin)
...

But it still causing same error.

2018-10-13T13:20:38.996 thread-0   chain_plugin.cpp:329          plugin_initialize    ] initializing chain plugin
2018-10-13T13:20:39.003 thread-0   block_log.cpp:124             open                 ] Log is nonempty
2018-10-13T13:20:39.003 thread-0   block_log.cpp:142             open                 ] Index is nonempty
2018-10-13T13:20:39.072 thread-0   http_plugin.cpp:422           plugin_initialize    ] configured http to listen on 127.0.0.1:8888
2018-10-13T13:20:39.072 thread-0   net_plugin.cpp:2910           plugin_initialize    ] Initialize net plugin
2018-10-13T13:20:39.072 thread-0   net_plugin.cpp:2936           plugin_initialize    ] host: 0.0.0.0 port: 9876
2018-10-13T13:20:39.072 thread-0   net_plugin.cpp:3007           plugin_initialize    ] my node_id is e7a6360ff009b53ced98002bf0bf3c87a1186116086108a6300f7c6bbce07cbe
2018-10-13T13:20:39.073 thread-0   main.cpp:110                  main                 ] nodeos version v1.3.1
2018-10-13T13:20:39.073 thread-0   main.cpp:111                  main                 ] eosio root is /root/.local/share
2018-10-13T13:20:39.073 thread-0   chain_plugin.cpp:664          plugin_startup       ] starting chain in read/write mode
2018-10-13T13:20:39.073 thread-0   chain_plugin.cpp:668          plugin_startup       ] Blockchain started; head block is #1, genesis timestamp is 2018-06-01T12:00:00.000
2018-10-13T13:20:39.073 thread-0   http_plugin.cpp:486           plugin_startup       ] start listening for http requests
2018-10-13T13:20:39.074 thread-0   net_plugin.cpp:3022           plugin_startup       ] net_plugin::plugin_startup failed to bind to port 9876
2018-10-13T13:20:39.082 thread-0   main.cpp:150                  main                 ] std::exception

Any other solution?

@jgiszczak
Copy link
Contributor

The nodeosd.sh script that invokes nodeos copies config.ini from the root of the container to the data-dir I described. If you're not using that script, you'll need to find the copy of config.ini that is actually in use in your container. As you've already discovered, it's not the copy in the root.

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

4 participants