Upstream split a header in FastCGI

Grigory Batalov bga at tepkom.ru
Sat Feb 18 18:44:02 MSK 2006


On Fri, 17 Feb 2006 19:47:51 +0300 (MSK)
Igor Sysoev <is-G97k7egY2jIKNkxEY4oc4w at public.gmane.org> wrote:

> > 2006/02/17 18:57:51 [alert] 15689#0: *46 upstream split a header in FastCGI records while reading response header from upstream, client: 127.0.0.1, server: localhost, URL: "/trac/", upstream: "fastcgi://127.0.0.1:1027"
...
> Это сообщение означает, что fastcgi сервер послал запись stderr
> в то время, пока ещё не до конца выведен заголовок ответа (он выводится
> в записях stdout). Хотя, судя по логу, записей (type = 7) stderr нет.
> 
> Такая обработка stderr во время чтения заголовка - это багофича nginx'а.
> Однако в данном случае, похоже, stderr нет.
> 
> Можно сделать следующее:
> 
> 1) в файле src/http/modules/ngx_http_fastcgi_module.c найти две строки
>     "upstream split a header in FastCGI records" и поменять в них
>     split на split1 и split2.
> 
> 2) запустить nginx с отладочныи логом (желательно поставить
>     worker_processes 1), сделать запрос и лог прислать мне.

  Здравствуйте, Игорь!

  Прилагаю error.log, полученный от запроса телнетом:

$ telnet localhost 8084
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
GET /trac/ HTTP/1.0

HTTP/1.1 502 Bad Gateway
Server: nginx/0.3.28
Date: Sat, 18 Feb 2006 14:31:48 GMT
Content-Type: text/html
Content-Length: 173
Connection: close

<html>
<head><title>502 Bad Gateway</title></head>
<body bgcolor="white">
<center><h1>502 Bad Gateway</h1></center>
<hr><center>nginx/0.3.28</center>
</body>
</html>
Connection closed by foreign host.


  Возможно, Вам будет интересно, что выдаёт требуемый скрипт
 при обращении к lighttpd-1.4.10:

$ telnet localhost 8085
Trying 127.0.0.1...
Connected to localhost.
Escape character is '^]'.
GET /trac/test/ HTTP/1.0

HTTP/1.0 200 OK
Connection: close
Cache-control: must-revalidate
Expires: Fri, 01 Jan 1999 00:00:00 GMT
Content-Type: text/html;charset=utf-8
Content-Length: 201
Date: Fri, 17 Feb 2006 23:59:06 GMT
Server: lighttpd (ALTLinux)

<html>
<head><title>Available Projects</title></head>
<body><h1>Available Projects</h1><ul><li>
   <a href="/trac/test/test" title="My example project">
    Test project</a>
  </li></ul></body>
</html>


  А вот это он пишет при запуске в консоли:

$ /usr/share/trac/cgi-bin/trac.fcgi
Status: 200
Cache-control: must-revalidate
Expires: Fri, 01 Jan 1999 00:00:00 GMT
Content-Type: text/html;charset=utf-8
Content-Length: 196

<html>
<head><title>Available Projects</title></head>
<body><h1>Available Projects</h1><ul><li>
   <a href="/trac/test" title="My example project">
    Test project</a>
  </li></ul></body>
</html>Content-Type: text/plain

Oops...

Trac detected an internal error:

0

Traceback (most recent call last):
  File "/usr/share/trac/cgi-bin/trac.fcgi", line 20, in ?
    fcgi_frontend.run()
  File "/usr/lib/python2.3/site-packages/trac/web/fcgi_frontend.py", line 28, in run
    _fcgi.Server(_handler).run()
  File "/usr/lib/python2.3/site-packages/trac/web/_fcgi.py", line 1049, in run
    sock = self._setupSocket()
  File "/usr/lib/python2.3/site-packages/trac/web/_fcgi.py", line 994, in _setupSocket
    req.run()
  File "/usr/lib/python2.3/site-packages/trac/web/_fcgi.py", line 580, in run
    self._end(appStatus, protocolStatus)
  File "/usr/lib/python2.3/site-packages/trac/web/_fcgi.py", line 606, in _end
    sys.exit(appStatus)
SystemExit: 0



-------------- next part --------------
A non-text attachment was scrubbed...
Name: error.log.gz
Type: application/x-gzip
Size: 2009 bytes
Desc: not available
URL: <http://nginx.org/pipermail/nginx-ru/attachments/20060218/d5d07a26/attachment.bin>


More information about the nginx-ru mailing list