NodeJS - "错误:此套接字已关闭"间歇

时间:2016-09-16 07:00:17

标签: node.js mongodb sockets exception

请在调用nodeJS路由时看到以下错误。 我也在另一条路线上看到同样的例外。两个路由都有进行MongoDB操作的方法。这是间歇性的,仅在两个API调用中处理DB中的值。

    {
  date: 'Thu Sep 15 2016 04:16:46 GMT-0500 (EST)',
  process: {
    pid: 4424,
    uid: 0,
    gid: 0,
    cwd: '***rootFolder***',
    execPath: '/usr/bin/node',
    version: 'v6.3.1',
    argv: [
      '/usr/bin/node',
      '**rootfolder**/app.js'
    ],
    memoryUsage: {
      rss: 104415232,
      heapTotal: 77893632,
      heapUsed: 60997696
    }
  },
  os: {
    loadavg: [
      0.03564453125,
      0.06103515625,
      0.0625
    ],
    uptime: 3184925
  },
  trace: [
    {
      column: 19,
      file: 'net.js',
      function: 'WriteStream.Socket._writeGeneric',
      line: 672,
      method: 'Socket._writeGeneric',
      native: false
    },
    {
      column: 8,
      file: 'net.js',
      function: 'WriteStream.Socket._write',
      line: 724,
      method: 'Socket._write',
      native: false
    },
    {
      column: 12,
      file: '_stream_writable.js',
      function: 'doWrite',
      line: 307,
      method: null,
      native: false
    },
    {
      column: 5,
      file: '_stream_writable.js',
      function: 'writeOrBuffer',
      line: 293,
      method: null,
      native: false
    },
    {
      column: 11,
      file: '_stream_writable.js',
      function: 'WriteStream.Writable.write',
      line: 220,
      method: 'Writable.write',
      native: false
    },
    {
      column: 40,
      file: 'net.js',
      function: 'WriteStream.Socket.write',
      line: 650,
      method: 'Socket.write',
      native: false
    },
    {
      column: 16,
      file: 'console.js',
      function: 'Console.warn',
      line: 51,
      method: 'warn',
      native: false
    },
    {
      column: 43,
      file: '*****/node_modules/express/lib/application.js',
      function: 'EventEmitter.logerror',
      line: 629,
      method: 'logerror',
      native: false
    },
    {
      column: 20,
      file: 'timers.js',
      function: 'runCallback',
      line: 576,
      method: null,
      native: false
    },
    {
      column: 5,
      file: 'timers.js',
      function: 'tryOnImmediate',
      line: 550,
      method: null,
      native: false
    },
    {
      column: 5,
      file: 'timers.js',
      function: 'processImmediate [as _immediateCallback]',
      line: 529,
      method: null,
      native: false
    }
  ],
  stack: [
    'Error: This socket is closed',
    '    at WriteStream.Socket._writeGeneric (net.js:672:19)',
    '    at WriteStream.Socket._write (net.js:724:8)',
    '    at doWrite (_stream_writable.js:307:12)',
    '    at writeOrBuffer (_stream_writable.js:293:5)',
    '    at WriteStream.Writable.write (_stream_writable.js:220:11)',
    '    at WriteStream.Socket.write (net.js:650:40)',
    '    at Console.warn (console.js:51:16)',
    '    at EventEmitter.logerror (***rootFolder***/node_modules/express/lib/application.js:629:43)',
    '    at runCallback (timers.js:576:20)',
    '    at tryOnImmediate (timers.js:550:5)',
    '    at processImmediate [as _immediateCallback] (timers.js:529:5)'
  ]
}

0 个答案:

没有答案