Zenbot: docker-compose up error

Created on 8 Jun 2017  Â·  23Comments  Â·  Source: DeviaVir/zenbot

When running docker-compose up i get

ERROR: for mongodb-data Cannot start service mongodb-data: oci runtime error: container_linux.go:247: starting container process caused "process_linux.go:359: container init caused \"rootfs_linux.go:54: mounting \\"/C/Users/Curri/Documents/GitHub/zenbot/data/db\\" to rootfs \\"/var/lib/docker/overlay2/6f26981ffba8f523d28236e7b38c37cbca71fc267d9b9c1e5a9adbc9ed01e855/merged\\" at \\"/data/db\\" caused \\"stat /C/Users/Curri/Documents/GitHub/zenbot/data/db: input/output error\\"\""
ERROR: Encountered errors while bringing up the project.

as well as the other error I get is

Starting zenbot_mongodb-data_1
Starting zenbot_mongodb_1
Recreating 693ef93d0326_693ef93d0326_zenbot_server_1

ERROR: for server Cannot start service server: Cannot link to a non running container: /zenbot_mongodb_1 AS /zenbot_server_1/mongodb
ERROR: Encountered errors while bringing up the project.

question

Most helpful comment

Try this instead
sudo docker-compose up

All 23 comments

When I had that second error you posted I restarted the Docker service and it fixed it,

Try this instead
sudo docker-compose up

I'm running on wondows not linux so no sudo command.

my docker-compose build shows

mongodb-data uses an image, skipping
mongodb uses an image, skipping
Building server
Step 1/4 : FROM node:latest
---> 6cc3b1eca1bc
Step 2/4 : ADD . /app
---> Using cache
---> 25bbe695b31d
Step 3/4 : WORKDIR /app
---> Using cache
---> 8b8a2c115935
Step 4/4 : RUN npm install
---> Using cache
---> ca05afc7b8e0
Successfully built ca05afc7b8e0

I was able to get docker-compose to run but if I run a command like

zenbot backfill gdax.BTC-USD 7 I get

\Documents\GitHub\zenbot [master ≡ +0 ~2 -0 !]> zenbot backfill gdax.BTC-USD 7
warning: mongodb not accessible. some features (such as backfilling/simulation) may be disabled.
C:\Users\Curri\Documents\GitHub\zenbot\node_modules\sosa_mongo\mongo_backend.js:6
if (!backend_options.db) throw new Error('must pass a node-mongodb-native db with backend_options.db');
^

Error: must pass a node-mongodb-native db with backend_options.db
at module.exports (C:\Users\Curri\Documents\GitHub\zenbot\node_modules\sosa_mongo\mongo_backend.js:6:34)
at C:\Users\Curri\Documents\GitHub\zenbot\node_modules\sosa\index.js:7:17
at createCollection (C:\Users\Curri\Documents\GitHub\zenbot\db\createCollection.js:5:7)
at Object.container (C:\Users\Curri\Documents\GitHub\zenbot\db\trades.js:2:36)
at Object.getValue (C:\Users\Curri\Documents\GitHub\zenbot\node_modules\codemap\index.js:298:22)
at C:\Users\Curri\Documents\GitHub\zenbot\node_modules\codemap\index.js:238:23
at Array.forEach (native)
at Object.get (C:\Users\Curri\Documents\GitHub\zenbot\node_modules\codemap\index.js:237:13)
at get (C:\Users\Curri\Documents\GitHub\zenbot\node_modules\codemap\index.js:60:22)
at Command. (C:\Users\Curri\Documents\GitHub\zenbot\commands\backfill.js:22:22)

You must run zenbot in docker, because mongodb is running in docker.

Actually it is not very easy to run simulations in a docker container... So I set up a linux virtual machine to run simulations.

Yeah I was just thinking about setting up a linux virtual then deal with windows bs.

Windows is not really friends with all docker functions just yet. There have been people that solved this problem by using the volume differently, but I don't know the details (and quite frankly do not care too much about Windows).

Looks like more issues with volumes and Windows, honestly like others I don't use Windows and don't care enough about it to fix it. In addition fixing it on Windows might cause issues with other platforms. As others mentioned probably better to get a VM with linux

I haven't used linux in about 2 years. What's a good lite linux distro for VM.

You could look at CentOS 7. Lean and mean if you don't install desktop (Gnome or KDE)
It is rock solid. It will run smooth with 2 GiB mem in a VM. KVM if your host is Linux. Else your could use VirtualBox

I had issues with Docker on Windows. It's filesystem related. If you're on Windows 10 with Creators Update, then your best bet is to use the Windows Subsystem for Linux (WSL) and follow the standard Linux instructions (no Docker). Works great for me.

https://msdn.microsoft.com/en-us/commandline/wsl/install_guide

The error is filesystem related, when using Docker for Windows (as opposed to the old docker on windows which worked with VirtualBox) your shared filesystem works over windows file sharing and just isn't compatible with all FS operations in the docker container. You can fix this easily by not mapping the DB data to a directory outside of the container. Change the following line in your docker-compose.yml

- ./data/db:/data/db To - /data/db

And re-run docker-compose up -d. You're DB service should start now. You will need to copy these files out of the container if you want to back them up. I think the command is docker cp

when I run this: zenbot backfill gdax.ETH-USD --days 14 I get the mongodb error running on my linux VPS. My other bot (not zenbot) continues to run just fine in the background, but no matter how I try to sim using zenbot, I get the error. Tried running the above with sudo at the front too, but not sure if I'm doing something wrong or not. I just followed the instructions on the wiki and installed via git clone then moved the dir to the same dir my other bot's in.

@QuadroBro Please look at the response I posted just before yours, your VPS/FS doesn't support memory mapped files, and so it cannot load the DB. Make the change I suggested and it should work.

@cmroche I don't use docker though. Does that matter?

@QuadroBro Probably, the only errors listed in the original issue are ones emitted by docker. Unless you're referring to the generic cannot connect to mongodb error, in which case check your DB server and configuration.

@cmroche I'm getting Error: must pass a node-mongodb-native db with backend_options.db then a bunch of other bullshit

@cmroche here's the
zberror

It cannot connect to the DB, this isn't really this issue. Please check your conf.js for the IP and User/Password and make sure your MongoDB server is configured correctly.

Yeah, it's because they didn't add the line about installing mongo-db. There's the command for copying the sample config to a config.js, but no npm install mongoshit or apt-get mongoshit

Closing due to inactivity.

Was this page helpful?
0 / 5 - 0 ratings

Related issues

voltz67 picture voltz67  Â·  5Comments

KryptoNova picture KryptoNova  Â·  3Comments

JensvdHeydt picture JensvdHeydt  Â·  3Comments

michaelr524 picture michaelr524  Â·  3Comments

gleblanc1783 picture gleblanc1783  Â·  3Comments