Welcome! Log In Create A New Profile

Advanced

the http output chain is empty bug

May 29, 2014 03:59AM
nginx >= 1.5.7 (в более новых воспроизводится)
Собран с lua модулем (0.9.8) (ошибка воспроизводится и с более новыми версиями)

# ./sbin/nginx -V
nginx version: nginx/1.5.7
built by gcc 4.4.7 20120313 (Red Hat 4.4.7-3) (GCC)
configure arguments: --add-module=../lua-nginx-module

Конфиг

user nginx;
worker_processes 1;

error_log /var/log/nginx/nginx-error.log error;

events {
use epoll;
}

http {
gzip on;

server {
listen 80;
root /usr/local/nginx/html;

location = /empty/ {
empty_gif;
}

location = /include/ {
content_by_lua '
ngx.location.capture("/empty/")
ngx.location.capture("/empty/")
';
}

location = /ssi.html {
ssi on;
}
}
}

Содержимое /usr/local/nginx/html/ssi.html
HEADER
<!--#include virtual="/include/" wait="yes" -->

При запросе http://localhost/ssi.html получаю пустой ответ (без заголовков и без тела)
И в логе
[alert] 20457#0: *1 the http output chain is empty, client: 127.0.0.1, server: , request: "GET /ssi.html HTTP/1.1", subrequest: "/include/"

То есть, если из ssi запроса делаем 2 lua подзапроса и при этом перед ssi запросом что-то выводится, и включен gzip модуль, то получаем пустой ответ.

Ошибка появилась с версии 1.5.7. Так как в src/http/modules/ngx_http_gzip_filter_module.c была добавлена проверка, что цепочка чайнов (chain) не NULL
- if (ctx->nomem) {
+ if (ctx->nomem || in == NULL) {

При этом при 2х луа подзапросах из луа модуля вызывается ngx_http_lua_flush_pending_output, которая вызывает
rc = ngx_http_lua_output_filter(r, NULL) как раз с пустой цепочкой чайнов. И вероятно из за этого и случается ошибка.

Помогите понять. Это проблема nginx или lua модуля? И как это можно пофиксить?
Зачем это условие в gzip фильтре?
Или вероятно из lua модуля должно вызваться ngx_http_send_special(r, flags); с флагом NGX_HTTP_FLUSH, которая вызовет фильтры с некоторым чайном?
Subject Author Posted

the http output chain is empty bug

kirimedia May 29, 2014 03:59AM

Re: the http output chain is empty bug

Maxim Dounin May 29, 2014 11:08AM

Re: the http output chain is empty bug

JohnNovimov July 03, 2014 08:22AM

Re: the http output chain is empty bug

JohnNovimov July 03, 2014 08:27AM

Re: the http output chain is empty bug

Maxim Dounin July 03, 2014 08:48AM

Re: the http output chain is empty bug

tester123 December 06, 2014 11:28AM

Re: the http output chain is empty bug

mva December 06, 2014 11:50AM

Re: the http output chain is empty bug

tester123 December 06, 2014 12:08PM

Re: the http output chain is empty bug

tester123 December 06, 2014 12:09PM

Re: the http output chain is empty bug

tester123 December 06, 2014 12:14PM

Re: the http output chain is empty bug

Anton Gorlov December 06, 2014 12:26PM

Re: the http output chain is empty bug

tester123 December 06, 2014 12:59PM

Re: the http output chain is empty bug

Maxim Dounin December 07, 2014 06:52PM

Re: the http output chain is empty bug

tester123 December 18, 2014 01:53PM

Re: the http output chain is empty bug

Maxim Dounin December 18, 2014 02:38PM

Re: the http output chain is empty bug

tester123 December 21, 2014 03:01PM

Re: the http output chain is empty bug

Maxim Dounin December 21, 2014 08:06PM

Re: the http output chain is empty bug

mva December 06, 2014 12:26PM

Re: the http output chain is empty bug

tester123 December 06, 2014 01:04PM

Re: the http output chain is empty bug

tester123 December 06, 2014 01:09PM

Re: the http output chain is empty bug

tester123 December 08, 2014 08:25AM

Re: the http output chain is empty bug

tester123 December 08, 2014 10:27AM

Re: the http output chain is empty bug

tester123 May 28, 2015 04:17PM

Re: the http output chain is empty bug

Maxim Dounin June 01, 2015 08:44AM



Sorry, only registered users may post in this forum.

Click here to login

Online Users

Guests: 252
Record Number of Users: 8 on April 13, 2023
Record Number of Guests: 421 on December 02, 2018
Powered by nginx      Powered by FreeBSD      PHP Powered      Powered by MariaDB      ipv6 ready