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

MongoError: failed to connect to server #38

Closed
keshaipad opened this issue Aug 23, 2016 · 5 comments
Closed

MongoError: failed to connect to server #38

keshaipad opened this issue Aug 23, 2016 · 5 comments

Comments

@keshaipad
Copy link

Can't understand why:

MacBook-Pro:zenbot macbookpro$ ./reducer.sh

/Users/macbookpro/btc-bot/zenbot/node_modules/motley-mongo/node_modules/mongodb/lib/mongo_client.js:225
          throw err
          ^
MongoError: failed to connect to server [localhost:27017] on first connect
    at null.<anonymous> (/Users/macbookpro/btc-bot/zenbot/node_modules/motley-mongo/node_modules/mongodb/node_modules/mongodb-core/lib/topologies/server.js:312:35)
    at emitOne (events.js:77:13)
    at emit (events.js:169:7)
    at null.<anonymous> (/Users/macbookpro/btc-bot/zenbot/node_modules/motley-mongo/node_modules/mongodb/node_modules/mongodb-core/lib/connection/pool.js:256:12)
    at g (events.js:260:16)
    at emitTwo (events.js:87:13)
    at emit (events.js:172:7)
    at Socket.<anonymous> (/Users/macbookpro/btc-bot/zenbot/node_modules/motley-mongo/node_modules/mongodb/node_modules/mongodb-core/lib/connection/connection.js:160:49)
    at Socket.g (events.js:260:16)
    at emitOne (events.js:77:13)

I was try to reinstall all, but again same error.

@grigio
Copy link
Contributor

grigio commented Aug 23, 2016

it seems you don't have mongodb running.. what do you get if you type mongo in the terminal?

@BarnumD
Copy link
Contributor

BarnumD commented Aug 23, 2016

If mongo is on a different host (or in the case of docker, a different container) you may need to edit the config.js to specify the correct connection string.

@egorbenko
Copy link
Contributor

if you are using docker replace this line
c.mongo_url = "mongodb://localhost:27017/zenbrain"
with
c.mongo_url = "mongodb://" + process.env.MONGODB_PORT_27017_TCP_ADDR + ":27017/zenbrain"

@dwightmulcahy
Copy link

dwightmulcahy commented May 8, 2017

getting the same error... running this fine in a docker container but want to run it without Docker.

what is the solution?

@JoeyBurzynski
Copy link

JoeyBurzynski commented May 8, 2017

@grigio @dwightmulcahy

Use mongod to start MongoDB.

Reference: https://docs.mongodb.com/manual/reference/program/mongod/

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

7 participants