Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error after npm install node-uptime,Can't set headers after they are sent. #360

Open
cloudcache opened this issue Aug 13, 2017 · 0 comments

Comments

@cloudcache
Copy link

node app.js
Monitor origin started
info - socket.io started
Express server listening on port 80 in development mode
[Error: http://localhost/api/checks/needingPoll resource responded with error code: 404]
Mongoose: pings.ensureIndex({ timestamp: -1 }) { safe: true, background: true }
Mongoose: pings.ensureIndex({ check: 1 }) { safe: true, background: true }
Mongoose: checkevents.ensureIndex({ timestamp: -1, check: 1 }) { safe: true, background: true }
Mongoose: checkhourlystats.ensureIndex({ timestamp: -1, check: 1 }) { safe: true, background: true, unique: true }
Mongoose: checkdailystats.ensureIndex({ timestamp: -1, check: 1 }) { safe: true, background: true, unique: true }
Mongoose: checkmonthlystats.ensureIndex({ timestamp: -1, check: 1 }) { safe: true, background: true, unique: true }
Mongoose: checkyearlystats.ensureIndex({ timestamp: -1, check: 1 }) { safe: true, background: true, unique: true }
Mongoose: taghourlystats.ensureIndex({ timestamp: -1, name: 1 }) { safe: true, background: true, unique: true }
Mongoose: tagdailystats.ensureIndex({ timestamp: -1, name: 1 }) { safe: true, background: true, unique: true }
Mongoose: tagmonthlystats.ensureIndex({ timestamp: -1, name: 1 }) { safe: true, background: true, unique: true }
Mongoose: tagyearlystats.ensureIndex({ timestamp: -1, name: 1 }) { safe: true, background: true, unique: true }
Mongoose: tags.ensureIndex({ name: 1 }) { safe: true, background: true, unique: true }
Mongoose: checks.find({ '$where': 'function () {\n if (this.isPaused) return false;\n if (!this.firstTested) return true;\n var delay = (this.lastTested.getTime() - this.firstTested.getTime()) % this.interval;\n return (Date.now() - this.lastTested.getTime() + delay) >= (this.interval || 60000);\n}' }) { fields: { qos: 0 }, safe: true }

/root/node_modules/node-uptime/node_modules/mongoose/lib/utils.js:410
throw err;
^
Error: Can't set headers after they are sent.
at ServerResponse.OutgoingMessage.setHeader (http.js:724:11)
at ServerResponse.res.setHeader (/root/node_modules/node-uptime/node_modules/express/node_modules/connect/lib/patch.js:59:22)
at ServerResponse.res.set.res.header (/root/node_modules/node-uptime/node_modules/express/lib/response.js:514:10)
at ServerResponse.res.send (/root/node_modules/node-uptime/node_modules/express/lib/response.js:126:10)
at ServerResponse.res.json (/root/node_modules/node-uptime/node_modules/express/lib/response.js:192:15)
at Promise. (/root/node_modules/node-uptime/app/api/routes/check.js:36:11)
at Promise. (/root/node_modules/node-uptime/node_modules/mongoose/lib/promise.js:128:8)
at Promise.emit (events.js:95:17)
at Promise.emit (/root/node_modules/node-uptime/node_modules/mongoose/lib/promise.js:66:38)
at Promise.complete (/root/node_modules/node-uptime/node_modules/mongoose/lib/promise.js:77:20)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant