MongoError:写入EPIPE

我正在使用Node.JS + Mongoose + MongoDB。 如果我的应用程序工作正常,直到现在,当试图保存文档:

保存操作:

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

{“name”:“MongoError”,“message”:“写入EPIPE”}

错误堆栈:

 { [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) 

看起来我能够读取数据,但不能写入新的文件。 Mongo是应用程序并正在运行。 我已经尝试过,重新启动数据库,没有好的结果。

试图从mongo客户端插入并工作

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

所以它似乎是一个Node.js / Mongoose的问题。

       

网上收集的解决方案 "MongoError:写入EPIPE"