Hello!
On Mon, May 19, 2014 at 9:30 PM, arthurx wrote:
> The problem is that there would be the error
> net::ERR_INCOMPLETE_CHUNKED_ENCODING (as seen from chrome) when I using
> location capture inside a large script (already with some ngx.say() and
> other processing before calling the location capture).
>
Seems like your main request's response body is truncated.
> But when I try to debug and create a script that only consist of the
> location capture statement, this will return the right response.
>
Try to create an isolate example that can reproduce the issue in others' boxes.
> Would it be related to the fact that the upstream is speaking HTTP protocal?
No.
> Would headers from the upstream cause "premature" response to the client?
>
As long as your upstream is accessed directly in your main request
(that is, not in a subrequest initiated by ngx.location.capture, for
example).
> My configuration is like this
>
> location /internal_loc/ {
> proxy_pass http://backend/;
> }
> upstream backend {
> server 133.0.0.1:8888;
> keepalive 36;
> }
>
This config snippet is incomplete.
> error log has this message:
> the http output chain is empty while sending to client
>
ngx_lua should never generate an empty "http output chain" even when
you feed an empty La string to ngx.print(). I wonder if it is caused
by some 3rd-party nginx output filter modules you're using. Paste the
output of your nginx -V?
One suggestion for debugging this is to abort your nginx worker
process when it outputs that error message at
src/http/ngx_http_write_filter_module.c:207 and let it produce a core
dump file when the error happens. And we can then analyze the
resulting core dump with tools like gdb (in this case, you'd better
use -O0 to compile your nginx to get accurate and complete debug info
in the nginx binary).
BTW, you should always provide the versions of ngx_lua and nginx
you're using whenever you report a problem. If you're not using the
latest versions, try upgrading first.
Best regards,
-agentzh