zenbot icon indicating copy to clipboard operation
zenbot copied to clipboard

Docker compose commands fails to run

Open code4passion opened this issue 6 years ago • 5 comments

System information

  • Have I written custom code (as opposed to using zenbot vanilla): No custom code
  • OS Platform and Distribution (e.g., Linux Ubuntu 16.04): Mac
  • Zenbot version (commit ref, or version): latest unstable branch
  • Zenbot branch: unstable
  • NodeJS version: 8.9.0
  • Python version (when using a python script):
  • Exact command to reproduce (include everything): docker-compose up
  • Did I make any changes to conf-sample.js?: no

Describe the problem

running docker-compose up gives following error

Source code / Error logs

aching to 9333ccc3dfb4_zenbot_mongodb_1, zenbot_server_1 server_1 | WARNING: MongoDB Connection Error: { MongoNetworkError: failed to connect to server [mongodb:27017] on first connect [MongoNetworkError: connect ECONNREFUSED 172.18.0.2:27017] server_1 | at Pool. (/app/node_modules/mongodb-core/lib/topologies/server.js:505:11) server_1 | at emitOne (events.js:116:13) server_1 | at Pool.emit (events.js:211:7) server_1 | at Connection. (/app/node_modules/mongodb-core/lib/connection/pool.js:329:12) server_1 | at Object.onceWrapper (events.js:317:30) server_1 | at emitTwo (events.js:126:13) server_1 | at Connection.emit (events.js:214:7) server_1 | at Socket. (/app/node_modules/mongodb-core/lib/connection/connection.js:245:50) server_1 | at Object.onceWrapper (events.js:315:30) server_1 | at emitOne (events.js:116:13) server_1 | name: 'MongoNetworkError', server_1 | message: 'failed to connect to server [mongodb:27017] on first connect [MongoNetworkError: connect ECONNREFUSED 172.18.0.2:27017]' } server_1 | WARNING: without MongoDB some features (such as backfilling/simulation) may be disabled. server_1 | Attempted authentication string: mongodb://mongodb:27017/zenbot4? server_1 | /app/lib/services/collection-service.js:18 server_1 | return conf.db.mongo.collection('sessions') server_1 | ^ server_1 | server_1 | TypeError: Cannot read property 'mongo' of undefined server_1 | at Object.getSessions (/app/lib/services/collection-service.js:18:22) server_1 | at Command. (/app/commands/trade.js:368:48) server_1 | at Command.listener (/app/node_modules/commander/index.js:315:8) server_1 | at emitTwo (events.js:126:13) server_1 | at Command.emit (events.js:214:7) server_1 | at Command.parseArgs (/app/node_modules/commander/index.js:651:12) server_1 | at Command.parse (/app/node_modules/commander/index.js:474:21) server_1 | at /app/zenbot.js:46:13 server_1 | at FSReqWrap.oncomplete (fs.js:135:15)

code4passion avatar May 03 '18 07:05 code4passion

Make sure you run MongoDB. See: GH-168

kenorb avatar May 03 '18 10:05 kenorb

I am able to get the bot working without docker. When i dont use docker i start mongodb in background and then run bot and it works fine.

Looking at the docker-compose file it looks that it starts mongodb and the bot, so i assume that it should start mongodb too. Not that familiar with docker hence cant debug more.

Any pointers?

code4passion avatar May 03 '18 18:05 code4passion

Any help will be appritiated

code4passion avatar May 06 '18 00:05 code4passion

Same problem on MacOS Mojave

crystalphi avatar Oct 29 '18 08:10 crystalphi

i got the same error on High Sierra, but that's when i was running on a boot 2 docker vm using virtualbox. When i updated to the latest Docker for Mac and did it natively, it worked. However, after you ctrl-c and quit you need to do docker-compose down before going back up again, otherwise the can't connect error comes back.

delboy1978uk avatar Jan 01 '19 19:01 delboy1978uk