You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Hi,
We recently deployed a node app in production that talks to a API endpoint over https. Of late, we started noticing that the call to the API was failing with error as 'Parser Error : Duplicate Content-Length' and there were a minimum of 6-7 occurrences daily. Though the error message clearly indicates that the API is sending multiple content-length header in the response, we couldn't log these headers in the node app as the call were failing in the underlying node module before reaching our code.
Below are the open issues related to this in nodejs GitHub page. nodejs/http-parser#435 nodejs/http-parser#460
In order to troubleshoot the issue better, we decided to introduce a nginx proxy between the node app and the API endpoint. We decided to use OpenResty as it allows us to use lua language and provides the ability to log the entire request and response including the headers in JSON format. Once we capture the error condition, we were planning to share it with the API team and press them for a fix.
To our surprise the error that used to occur at least 6-7 times a day stopped altogether. The log entries were all clean with only one content-length header and no failures in the app as such.
We are pretty sure that the API team didn't fix their code as they are waiting on us to capture the error scenario.
My queries here are as below.
Does OpenResty or nginx or luajson that we are using is removing the duplicate content-length header if the values are same ?
If the above is true, can you please point me to the docs. Also, is there a way for us to log the headers before it gets removed ?
Are we inadvertently removing it as part of the lua script ? We are logging the entire request and response as JSON via this script. Please refer attachment.
The docker image we are using is "openresty/openresty:jessie" version is 1.13.6.1 and we are using "luajson" package. I have attached the docker file, nginx.conf and lua script as a zip file. Archive.zip
Please clarify at the earliest as we are lost on what exactly is happening here.
Thanks,
Sudharsan N.
The text was updated successfully, but these errors were encountered:
Hello, I can't help with your queries -- you might get more help on the OpenResty mailing list. But in terms of the OpenResty Docker images, was your OpenResty app working on one image tag and then not on another?
jessie images tags shouldn't have changed lately (they were archived a while ago). But if you move to more recent ones, make sure you use a full tag, like openresty/openresty:1.15.8.2-5-buster so you can control versions.
On Sun, Dec 8, 2019, 10:45 AM Evan ***@***.***> wrote:
Hello, I can't help with your queries -- you might get more help on the
OpenResty mailing list. But in terms of the OpenResty Docker images, was
your OpenResty app working on one image tag and then not on another?
jessie images tags shouldn't have changed lately (they were archived a
while ago). But if you move to more recent ones, make sure you use a full
tag, like openresty/openresty:1.15.8.2-5-buster so you can control
versions.
Changes and tags are shown here:
https://github.com/openresty/docker-openresty/blob/master/CHANGELOG.md
—
You are receiving this because you authored the thread.
Reply to this email directly, view it on GitHub
<#131?email_source=notifications&email_token=ACN2G4HITHPBP4QUIIVZPRTQXUJA3A5CNFSM4JXWJSRKYY3PNVWWK3TUL52HS4DFVREXG43VMVBW63LNMVXHJKTDN5WW2ZLOORPWSZGOEGHB2KY#issuecomment-562961707>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/ACN2G4DZKWBAC2RNA6OBQ4LQXUJA3ANCNFSM4JXWJSRA>
.
Uh oh!
There was an error while loading. Please reload this page.
Hi,
We recently deployed a node app in production that talks to a API endpoint over https. Of late, we started noticing that the call to the API was failing with error as 'Parser Error : Duplicate Content-Length' and there were a minimum of 6-7 occurrences daily. Though the error message clearly indicates that the API is sending multiple content-length header in the response, we couldn't log these headers in the node app as the call were failing in the underlying node module before reaching our code.
Below are the open issues related to this in nodejs GitHub page.
nodejs/http-parser#435
nodejs/http-parser#460
In order to troubleshoot the issue better, we decided to introduce a nginx proxy between the node app and the API endpoint. We decided to use OpenResty as it allows us to use lua language and provides the ability to log the entire request and response including the headers in JSON format. Once we capture the error condition, we were planning to share it with the API team and press them for a fix.
To our surprise the error that used to occur at least 6-7 times a day stopped altogether. The log entries were all clean with only one content-length header and no failures in the app as such.
We are pretty sure that the API team didn't fix their code as they are waiting on us to capture the error scenario.
My queries here are as below.
The docker image we are using is "openresty/openresty:jessie" version is 1.13.6.1 and we are using "luajson" package. I have attached the docker file, nginx.conf and lua script as a zip file.
Archive.zip
Please clarify at the earliest as we are lost on what exactly is happening here.
Thanks,
Sudharsan N.
The text was updated successfully, but these errors were encountered: