MongoError: write EPIPE

I am using Node.JS + Mongoose + MongoDB. If my application is still working fine, now when I try to save the document:

Save operation:

doc.save(function(err, d){
    console.log(err,d); 

{"name": "MongoError", "message": "write EPIPE"}

Error Stack:

{ [MongoError: server localhost:27017 received an error {"name":"MongoError","message":"write EPIPE"}]
  name: 'MongoError',
  message: 'server localhost:27017 received an error {"name":"MongoError","message":"write EPIPE"}' } undefined
error: TypeError: Cannot read property 'url' of undefined
    at EventEmitter.<anonymous> (/home/ec2-user/c/index.js:160:61)
    at EventEmitter.<anonymous> (/home/ec2-user/c/node_modules/mongoose/node_modules/mpromise/lib/promise.js:174:48)
    at EventEmitter.emit (events.js:95:17)
    at Promise.safeEmit (/home/ec2-user/c/node_modules/mongoose/node_modules/mpromise/lib/promise.js:81:21)
    at Promise.reject (/home/ec2-user/c/node_modules/mongoose/node_modules/mpromise/lib/promise.js:109:15)
    at Promise.error (/home/ec2-user/c/node_modules/mongoose/lib/promise.js:94:15)
    at Promise.resolve (/home/ec2-user/c/node_modules/mongoose/lib/promise.js:112:24)
    at /home/ec2-user/c/node_modules/mongoose/lib/document.js:1555:39
    at handleError (/home/ec2-user/c/node_modules/mongoose/node_modules/hooks-fixed/hooks.js:40:22)
    at next_ (/home/ec2-user/c/node_modules/mongoose/node_modules/hooks-fixed/hooks.js:75:26)

It seems that I can read data, but not write new documents. Mongo is an application and works. I have tried so far, restarting the database, without good results.

Just tried paste from mongo client and worked

> db.mysecretcollection.insert({url:"sampletestremoveme"});
WriteResult({ "nInserted" : 1 })

So this is the Node.js / Mongoose problem.

+4
source share
1 answer

, , . , ": bson size XXX bytes", .

+2