BigChainDB in Docker immediately crashes with Connection Refused?
I’m on Win10 x64 following the instructions at https://docs.bigchaindb.com/projects/server/en/latest/appendices/run-with-docker.html
Because I’m running in windows (and don’t have $HOME
), here’s the actual commands I’m running:
docker run --rm -v "C:/bigchaindb_docker:/data" -ti bigchaindb/bigchaindb -y configure rethinkdb
docker run -v "C:/bigchaindb_docker:/data" -d --name bigchaindb -p "58080:8080" -p "59984:9984" bigchaindb/bigchaindb start
The first command seems to execute just fine. I see a .bigchaindb
file in my C:/bigchaindb_docker
folder. The second command will start a container but around 6 seconds later the container exits with code 1. I ran docker start <container> && docker attach <container>
and was able to get this dump:
INFO:bigchaindb.commands.bigchain:BigchainDB Version 0.10.0.dev
INFO:bigchaindb.config_utils:Configuration loaded from `/data/.bigchaindb`
Traceback (most recent call last):
File "/usr/local/lib/python3.5/dist-packages/rethinkdb/net.py", line 271, in __init__
self._socket = socket.create_connection((self.host, self.port), timeout)
File "/usr/lib/python3.5/socket.py", line 711, in create_connection
raise err
File "/usr/lib/python3.5/socket.py", line 702, in create_connection
sock.connect(sa)
ConnectionRefusedError: [Errno 111] Connection refused
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/usr/local/bin/bigchaindb", line 11, in <module>
load_entry_point('BigchainDB', 'console_scripts', 'bigchaindb')()
File "/usr/src/app/bigchaindb/commands/bigchain.py", line 401, in main
utils.start(create_parser(), sys.argv[1:], globals())
File "/usr/src/app/bigchaindb/commands/utils.py", line 96, in start
return func(args)
File "/usr/src/app/bigchaindb/commands/bigchain.py", line 201, in run_start
_run_init()
File "/usr/src/app/bigchaindb/commands/bigchain.py", line 142, in _run_init
schema.init_database(connection=b.connection)
File "/usr/src/app/bigchaindb/backend/schema.py", line 99, in init_database
create_database(connection, dbname)
File "/usr/lib/python3.5/functools.py", line 743, in wrapper
return dispatch(args[0].__class__)(*args, **kw)
File "/usr/src/app/bigchaindb/backend/rethinkdb/schema.py", line 17, in create_database
if connection.run(r.db_list().contains(dbname)):
File "/usr/src/app/bigchaindb/backend/rethinkdb/connection.py", line 49, in run
self._connect()
File "/usr/src/app/bigchaindb/backend/rethinkdb/connection.py", line 73, in _connect
self.conn = r.connect(host=self.host, port=self.port, db=self.dbname)
File "/usr/local/lib/python3.5/dist-packages/rethinkdb/net.py", line 661, in connect
return conn.reconnect(timeout=timeout)
File "/usr/local/lib/python3.5/dist-packages/rethinkdb/net.py", line 572, in reconnect
return self._instance.connect(timeout)
File "/usr/local/lib/python3.5/dist-packages/rethinkdb/net.py", line 430, in connect
self._socket = SocketWrapper(self, timeout)
File "/usr/local/lib/python3.5/dist-packages/rethinkdb/net.py", line 337, in __init__
(self.host, self.port, str(ex)))
rethinkdb.errors.ReqlDriverError: Could not connect to localhost:28015. Error: [Errno 111] Connection refused
I am looking into using BigChainDB and I don’t know much about it. I’d guess that it’s trying to connect to rethinkdb and it’s not running. I don’t know where to begin to fix that, I’ve never used rethinkdb either. Has anybody run into this problem before?
One Solution collect form web for “BigChainDB in Docker immediately crashes with Connection Refused?”
From the first line of the logs you provided it looks like you are running the master branch:
INFO:bigchaindb.commands.bigchain:BigchainDB Version 0.10.0.dev
It used to be that the latest tag of a BigchainDB (docker) image would point to the latest master branch. This was changed recently such that it now points to the latest release, matching what is on the Python Package Index (PyPI).
So if you pull the image again it should update to the latest release which at the time of writing is 0.9.5
. That is:
docker pull bigchaindb/bigchaindb
or equivalently:
docker pull bigchaindb/bigchaindb:latest
or explicitly pulling the tag 0.9.5
:
docker pull bigchaindb/bigchaindb:0.9.5
If you use version 0.9.5
, and try the two commands you posted it should work.
If you wish to use the latest master branch, then you will need to run RethinkDB since it is no longer embedded in the Docker image. Detailed instructions can be found in the master version of the BigchainDB documentation under the Run the backend database section.