1
votes

I am working with MongoDB in a Node server.

I have a parent process who spawn new child process, and every one make some function and then save the result in mongo, after that i stop it with:

process.exit()

I dont know why, some of this child process throw me this error:

{ MongoError: server localhost:27017 received an error
{"name":"MongoError","message":"write EPIPE"}
at .<anonymous> (/node_modules/mongodb-core/lib/topologies/server.js:213:40)
at g (events.js:286:16)
at emitTwo (events.js:106:13)
at emit (events.js:191:7)
at .<anonymous> (/node_modules/mongodb-core/lib/connection/pool.js:119:12)
at g (events.js:286:16)
at emitTwo (events.js:106:13)
at emit (events.js:191:7)
at Socket.<anonymous> (/node_modules/mongodb-core/lib/connection/connection.js:151:49)
at Socket.g (events.js:286:16)
at emitOne (events.js:96:13)
at Socket.emit (events.js:188:7)
at onwriteError (_stream_writable.js:319:10)
at onwrite (_stream_writable.js:337:5)
at WritableState.onwrite (_stream_writable.js:89:5)
at fireErrorCallbacks (net.js:462:13)
at Socket._destroy (net.js:503:3)
at WriteWrap.afterWrite (net.js:796:10)
name: 'MongoError',
message: 'server localhost:27017 received an error 
{"name":"MongoError","message":"write EPIPE"}' }

I am missing some configuration? what is the "write EPIPE" error means when it comes from Mongo?

Technicals:

  • MongoDB Version: 3.2.9
  • Node Version:v6.4.0
2

2 Answers

2
votes

One possible issue that i see here.

Most likely is that some of your documents was too big. Try to remove some fields from docs and see if you will still have this issue.

It's weird why mongo don't show correct errors, but what i found a lot of people have same issue.

http://databasefaq.com/index.php/answer/119679/nodejs-mongodb-mongoose-epipe-mongoerror-write-epipe

Hope this helps.

2
votes

In my case I am using mongo atlas service and my problem was that I have changed the Server IP and I have forgotten updated it in the white list of ips, I made the change and it immediately worked.