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

docker-compose up error #241

Closed
spencer-currie opened this issue Jun 8, 2017 · 23 comments
Closed

docker-compose up error #241

spencer-currie opened this issue Jun 8, 2017 · 23 comments
Labels

Comments

@spencer-currie
Copy link

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.

@gpearson100
Copy link

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

@zhaozdi
Copy link

zhaozdi commented Jun 8, 2017

Try this instead
sudo docker-compose up

@spencer-currie
Copy link
Author

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

@spencer-currie
Copy link
Author

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

@spencer-currie
Copy link
Author

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)

@zhaozdi
Copy link

zhaozdi commented Jun 8, 2017

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

@zhaozdi
Copy link

zhaozdi commented Jun 8, 2017

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

@spencer-currie
Copy link
Author

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

@DeviaVir
Copy link
Owner

DeviaVir commented Jun 8, 2017

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).

@egorbenko
Copy link
Contributor

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

@spencer-currie
Copy link
Author

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

@tuxitor
Copy link
Contributor

tuxitor commented Jun 8, 2017

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

@mshish
Copy link

mshish commented Jun 9, 2017

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

@cmroche
Copy link
Contributor

cmroche commented Jun 26, 2017

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

@QuadroBro
Copy link

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.

@cmroche
Copy link
Contributor

cmroche commented Jul 17, 2017

@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.

@QuadroBro
Copy link

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

@cmroche
Copy link
Contributor

cmroche commented Jul 17, 2017

@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.

@QuadroBro
Copy link

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

@QuadroBro
Copy link

@cmroche here's the
zberror

@cmroche
Copy link
Contributor

cmroche commented Jul 17, 2017

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.

@QuadroBro
Copy link

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

@DeviaVir
Copy link
Owner

Closing due to inactivity.

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

9 participants