graphql-mongodb-example icon indicating copy to clipboard operation
graphql-mongodb-example copied to clipboard

Error connect to mongo in docker

Open rdeputat opened this issue 7 years ago • 2 comments

$ yarn start yarn run v1.3.2 $ node dist/index.js { MongoError: failed to connect to server [localhost:27017] on first connect at Pool. (/Users/romandeputat/Projects/Test/GraphQL/graphql-mongo/node_modules/mongodb-core/lib/topologies/server.js:326:35) at Pool.emit (events.js:160:13) at Connection. (/Users/romandeputat/Projects/Test/GraphQL/graphql-mongo/node_modules/mongodb-core/lib/connection/pool.js:270:12) at Object.onceWrapper (events.js:255:19) at Connection.emit (events.js:160:13) at Socket. (/Users/romandeputat/Projects/Test/GraphQL/graphql-mongo/node_modules/mongodb-core/lib/connection/connection.js:175:49) at Object.onceWrapper (events.js:255:19) at Socket.emit (events.js:160:13) at emitErrorNT (internal/streams/destroy.js:64:8) at process._tickCallback (internal/process/next_tick.js:152:19) name: 'MongoError', message: 'failed to connect to server [localhost:27017] on first connect' } ✨ Done in 1.97s.

https://hub.docker.com/_/mongo/

rdeputat avatar Feb 27 '18 13:02 rdeputat

@nmaro I have the issue image

itsmemadhuri avatar Apr 11 '18 04:04 itsmemadhuri

I believe there's 2 ways you could face this problem

  1. Anti-virus or firewall blocking the MongoDB Reference
  2. MongoDB is not deployed yet on the localhost:27017 OR choose to deploy it online instead to ease things up (offered by the official website, follow the steps and you will get the new mongo_url to be replaced). MongoDB installation

doptster avatar Jun 23 '18 17:06 doptster