1

I have a Node.js application running in two AWS instances behind a ELB instance. Every now and then, I get errors such as ERR_INVALID_CHUNKED_ENCODING or ERR_CONTENT_LENGTH_MISMATCH. This is observed in both Chrome and Safari in Mac.

The behavior is as if the browser drops the connection as soon as it throws the error. This happens for static assets served from the Node.js application as well.

What's interesting about this issue is that it only happens from time to time. I've both cleared browser cache and disabled cache from dev tools but that didn't solve the problem.

Another interesting thing is that hitting the AWS directly without ELB doesn't generate the errors. I've also tried accessing the ELB directly (and not through the domain name registered at GoDaddy) and it doesn't seem to generate the errors either.

Any nudge in the right direction would be extremely helpful. Thanks.

Griffith
  • 111
  • 3
  • 1
    I would start by identifying whether it's always one of the instances causing the issue, or both. (Add a response header in your node code like `X-Backend: i-xxxxxxxx` to identify the serving instance, or verify by comparing the instance logs). Then capture packets on the instances (`tshark`) and also the workstation, to see how ELB might be modifying the response, or if perhaps the app really does make a mistake but that it is somehow "unmasked" by the way ELB handles it. Duplicating the problem using `curl` might also provide useful info. – Michael - sqlbot Jan 10 '16 at 13:48

0 Answers0