It's probably because some callback is being called twice and you are trying to
send a response twice.
That problem is not easy to find, though.
Increase your log level and make sure that you have proper logging and
request/response logging. When that error occurs, check which requests came
before and you should be able to check where the problem is coming from.
It might be some silly error like this:
if (err) {
callback(err);
}
callback(null,result);
Which causes the callback to be called twice.
Good luck
> On Dec 9, 2013, at 9:01 PM, ming <[email protected]> wrote:
>
> Hi,
> i'm running a node application which crashes probably once a week due to an
> uncaught "Can't render headers ..." exception. The node.js version in use
> is 0.8.22 and the OS distro is RHEL 6.2. i did not find the definitive
> pattern of sequence of events which led to the crash though.
>
> The stack trace looks like:
>
> http.js:715
> throw new Error('Can\'t render headers after they are sent to the
> client.'
> ^
> Error: Can't render headers after they are sent to the client.
> at ServerResponse.OutgoingMessage._renderHeaders (http.js:715:11)
> at ServerResponse.writeHead (http.js:1059:20)
> at Socket.proxyError
> (/opt/share/node_modules/http-proxy/lib/node-http-proxy/http-proxy.js:193:9)
> at Socket.g (events.js:192:14)
> at Socket.EventEmitter.emit (events.js:126:20)
> at Socket.connect.require.lookup.addressType (net.js:699:16)
> at process.startup.processNextTick.process._tickCallback (node.js:245:9)
>
> According to my web surfing, several developers also ran into similar problem
> in the past but it is not clear to me what the culprit is. i know the
> node.js version i used (0.8.22) has some age but it seems that similar
> problems also exist in 0.10.10 so i'm not sure upgrading node.js helps in
> this case. Moreover, to upgrade node.js in our environment is somewhat
> painful and not really under my control.
>
> Any suggestion how i can track down and rectify the problem?
>
> Thanks.
>
>
>
> --
> --
> Job Board: http://jobs.nodejs.org/
> Posting guidelines:
> https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
> You received this message because you are subscribed to the Google
> Groups "nodejs" group.
> To post to this group, send email to [email protected]
> To unsubscribe from this group, send email to
> [email protected]
> For more options, visit this group at
> http://groups.google.com/group/nodejs?hl=en?hl=en
>
> ---
> You received this message because you are subscribed to the Google Groups
> "nodejs" group.
> To unsubscribe from this group and stop receiving emails from it, send an
> email to [email protected].
> For more options, visit https://groups.google.com/groups/opt_out.
--
--
Job Board: http://jobs.nodejs.org/
Posting guidelines:
https://github.com/joyent/node/wiki/Mailing-List-Posting-Guidelines
You received this message because you are subscribed to the Google
Groups "nodejs" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected]
For more options, visit this group at
http://groups.google.com/group/nodejs?hl=en?hl=en
---
You received this message because you are subscribed to the Google Groups
"nodejs" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
For more options, visit https://groups.google.com/groups/opt_out.