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

Error: must pass a node-mongodb-native db with backend_options.db #827

Closed
reteps opened this issue Dec 9, 2017 · 6 comments
Closed

Error: must pass a node-mongodb-native db with backend_options.db #827

reteps opened this issue Dec 9, 2017 · 6 comments
Labels

Comments

@reteps
Copy link

reteps commented Dec 9, 2017

Full Error:

Peter@Peters-MacBook-Pro:10:42 AM zenbot $ zenbot trade --paper
warning: mongodb not accessible. some features (such as backfilling/simulation) may be disabled.
/Users/Peter/repos/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 (/Users/Peter/repos/zenbot/node_modules/sosa_mongo/mongo_backend.js:6:34)
    at /Users/Peter/repos/zenbot/node_modules/sosa/index.js:7:17
    at createCollection (/Users/Peter/repos/zenbot/db/createCollection.js:5:7)
    at Object.container (/Users/Peter/repos/zenbot/db/sessions.js:2:36)
    at Object.getValue (/Users/Peter/repos/zenbot/node_modules/codemap/index.js:298:22)
    at /Users/Peter/repos/zenbot/node_modules/codemap/index.js:238:23
    at Array.forEach (<anonymous>)
    at Object.get (/Users/Peter/repos/zenbot/node_modules/codemap/index.js:237:13)
    at get (/Users/Peter/repos/zenbot/node_modules/codemap/index.js:60:22)
    at Command.<anonymous> (/Users/Peter/repos/zenbot/commands/trade.js:319:24)
    at Command.listener (/Users/Peter/repos/zenbot/node_modules/commander/index.js:315:8)
    at Command.emit (events.js:159:13)
    at Command.parseArgs (/Users/Peter/repos/zenbot/node_modules/commander/index.js:653:12)
    at Command.parse (/Users/Peter/repos/zenbot/node_modules/commander/index.js:475:21)
    at /Users/Peter/repos/zenbot/zenbot.js:39:11
    at /Users/Peter/repos/zenbot/boot.js:28:7
    at f (/Users/Peter/repos/zenbot/node_modules/once/once.js:25:25)
    at Glob.<anonymous> (/Users/Peter/repos/zenbot/node_modules/glob/glob.js:151:7)
    at Glob.emit (events.js:159:13)
    at Glob._finish (/Users/Peter/repos/zenbot/node_modules/glob/glob.js:197:8)
    at done (/Users/Peter/repos/zenbot/node_modules/glob/glob.js:182:14)
    at Glob._processGlobStar2 (/Users/Peter/repos/zenbot/node_modules/glob/glob.js:637:12)

My docker-compose.yml mongodb: command: is mongod --smallfiles --bind_ip_all

@dextervip
Copy link

Try image: mongo:3.4

@reteps
Copy link
Author

reteps commented Dec 9, 2017

it did nothing. If I run the command mongo, it gives me an error though.

MongoDB shell version v3.4.10
connecting to: mongodb://127.0.0.1:27017
2017-12-09T11:53:03.699-0500 W NETWORK  [thread1] Failed to connect to 127.0.0.1:27017, in(checking socket for error after poll), reason: Connection refused
2017-12-09T11:53:03.701-0500 E QUERY    [thread1] Error: couldn't connect to server 127.0.0.1:27017, connection attempt failed :
connect@src/mongo/shell/mongo.js:237:13
@(connect):1:6
exception: connect failed

@mrzobot
Copy link

mrzobot commented Dec 11, 2017

I modified docker-compose and set mongodb to mongod --blind_ip_all that worked.

@BennettStaley
Copy link

i believe you mean --bind_ip_all, but yes, that fixes the issue.

@reteps
Copy link
Author

reteps commented Dec 12, 2017

Why was this closed? A solution was proposed that I already tried, which didn't fix my issue.

@DeviaVir
Copy link
Owner

@reteps you have no mongo server running. Start a mongo server, try to connect to it using the mongo client, when that works, try zenbot again.

Or use docker-compose, whichever suits your needs better.

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

5 participants