Bug 32041 - Неработоспособен из коробки
Summary: Неработоспособен из коробки
Status: CLOSED FIXED
Alias: None
Product: Sisyphus
Classification: Development
Component: nginx (show other bugs)
Version: unstable
Hardware: all Linux
: P3 blocker
Assignee: Anton Farygin
QA Contact: qa-sisyphus
URL: https://trac.nginx.org/nginx/ticket/926
Keywords:
Depends on:
Blocks:
 
Reported: 2016-04-30 07:57 MSK by Evgenii Terechkov
Modified: 2016-05-01 22:52 MSK (History)
1 user (show)

See Also:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Evgenii Terechkov 2016-04-30 07:57:28 MSK
Обновился с  1.8.1-alt1 на 1.10.0-alt2

nginx не смог перезапуститься с диагностикой:

=8<============================================
root@thinkpad /etc/nginx #systemctl status nginx.service 
● nginx.service - The nginx HTTP and reverse proxy server
   Loaded: loaded (/lib/systemd/system/nginx.service; enabled; vendor preset: disabled)
   Active: failed (Result: exit-code) since Сб 2016-04-30 11:19:44 KRAT; 33min ago
  Process: 4024 ExecStop=/usr/sbin/nginx -s stop (code=exited, status=1/FAILURE)
  Process: 4030 ExecStartPre=/usr/sbin/nginx -t (code=exited, status=1/FAILURE)
 Main PID: 27717 (code=exited, status=0/SUCCESS)

апр 30 11:19:44 thinkpad.evg-krsk.dyndns.org systemd[1]: Starting The nginx HTTP and reverse proxy server...
апр 30 11:19:44 thinkpad.evg-krsk.dyndns.org nginx[4030]: nginx: [emerg] unknown directive "gzip" in /etc/nginx/nginx.conf:23
апр 30 11:19:44 thinkpad.evg-krsk.dyndns.org nginx[4030]: nginx: configuration file /etc/nginx/nginx.conf test failed
апр 30 11:19:44 thinkpad.evg-krsk.dyndns.org systemd[1]: nginx.service: Control process exited, code=exited status=1
апр 30 11:19:44 thinkpad.evg-krsk.dyndns.org systemd[1]: Failed to start The nginx HTTP and reverse proxy server.
апр 30 11:19:44 thinkpad.evg-krsk.dyndns.org systemd[1]: nginx.service: Unit entered failed state.
апр 30 11:19:44 thinkpad.evg-krsk.dyndns.org systemd[1]: nginx.service: Failed with result 'exit-code'.
[1]    8532 exit 3     systemctl status nginx.service
=8<============================================

заметил, что хотя /etc/nginx/nginx.conf и изменён (проверил rpm -V nginx), но /etc/nginx/nginx.conf.rpmnew не создался.

Пришлось вытянуть nginx.conf из rpm-пакета 1.10.0-alt2, но с ним ситуация такая же:
=8<============================================
root@thinkpad /etc/nginx #git diff -U1
diff --git a/nginx/nginx.conf b/nginx/nginx.conf
index 6fd5805..29fcf6e 100644
--- a/nginx/nginx.conf
+++ b/nginx/nginx.conf
@@ -2,3 +2,3 @@
 
-worker_processes  1;
+worker_processes  10;
 
@@ -7,3 +7,3 @@ error_log   /var/log/nginx/error.log;
 events {
-       worker_connections  128;
+       worker_connections  1024;
 }
@@ -24,4 +24,2 @@ http {
 
-        keepalive_timeout 85;
-
        # text/html doesn't need to be defined there, it's compressed always
@@ -30,3 +28,2 @@ http {
        # gzip_comp_level 9;
-        autoindex_localtime on;
        include /etc/nginx/sites-enabled.d/*.conf;
root@thinkpad /etc/nginx #nginx -t    
nginx: [emerg] unknown directive "gzip" in /etc/nginx/nginx.conf:23
nginx: configuration file /etc/nginx/nginx.conf test failed
[1]    8848 exit 1     nginx -t
=8<============================================

В чём дело пока не понял.
Comment 1 Anton Farygin 2016-04-30 08:02:33 MSK
Использую nginx на многих системах - везде всё работает.
, давайте разбираться что сломалось.

Для начала предлагаю закомментировать директиву gzip
nginx.conf:#    gzip               on;
Comment 2 Evgenii Terechkov 2016-04-30 08:17:45 MSK
Такая цепочка комментирования:
=8<============================================
nginx: [emerg] unknown directive "gzip_types" in /etc/nginx/nginx.conf:28
=8<============================================
потом
=8<============================================
nginx: [emerg] unknown directive "charset" in /etc/nginx/sites-enabled.d/site.conf:10
=8<============================================
потом
=8<============================================
nginx: the configuration file /etc/nginx/nginx.conf syntax is ok
=8<============================================


итого отвалились директивы gzip, gzip_types, charset.
Comment 3 Evgenii Terechkov 2016-04-30 08:23:39 MSK
Если при этом попытаться обратиться к серверу браузером, он (сервер) падает с ошибкой сегментации и дампит корку:

=8<============================================
2016-04-30T12:18:22.749460+07:00 thinkpad systemd[1]: Started Process Core Dump (PID 10542/UID 0).
2016-04-30T12:18:47.388458+07:00 thinkpad systemd[1]: Started Process Core Dump (PID 10570/UID 0).
=8<============================================

трасировка такая:
=8<============================================
evg@thinkpad ~ $gdb nginx nginx.core
GNU gdb (GDB) 7.9-alt2 (ALT Linux)
Copyright (C) 2015 Free Software Foundation, Inc.
License GPLv3+: GNU GPL version 3 or later <http://gnu.org/licenses/gpl.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.  Type "show copying"
and "show warranty" for details.
This GDB was configured as "x86_64-alt-linux".
Type "show configuration" for configuration details.
For bug reporting instructions, please see:
<http://www.gnu.org/software/gdb/bugs/>.
Find the GDB manual and other documentation resources online at:
<http://www.gnu.org/software/gdb/documentation/>.
For help, type "help".
Type "apropos word" to search for commands related to "word"...
Reading symbols from nginx...Reading symbols from /usr/lib/debug/usr/sbin/nginx.debug...done.
done.
[New LWP 10544]
[Thread debugging using libthread_db enabled]
Using host libthread_db library "/lib64/libthread_db.so.1".
Missing separate debuginfo for /lib64/libnss_mymachines.so.2
Try to install the hash file /usr/lib/debug/.build-id/c7/f8b868895177581eb7c76e2b3200e2c89dd476.debug
Core was generated by `nginx: worker process         '.
Program terminated with signal SIGSEGV, Segmentation fault.
#0  0x0000000000000000 in ?? ()
(gdb) bt
#0  0x0000000000000000 in ?? ()
#1  0x000000000048273e in ngx_http_autoindex_handler (r=0xec7070) at src/http/modules/ngx_http_autoindex_module.c:279
#2  0x000000000044bdd0 in ngx_http_core_content_phase (r=0xec7070, ph=0xeb6c00) at src/http/ngx_http_core_module.c:1377
#3  0x00000000004465d5 in ngx_http_core_run_phases (r=r@entry=0xec7070) at src/http/ngx_http_core_module.c:847
#4  0x00000000004466bc in ngx_http_handler (r=r@entry=0xec7070) at src/http/ngx_http_core_module.c:830
#5  0x0000000000451303 in ngx_http_process_request (r=0xec7070) at src/http/ngx_http_request.c:1910
#6  0x0000000000451817 in ngx_http_process_request_headers (rev=rev@entry=0xe87f70) at src/http/ngx_http_request.c:1342
#7  0x0000000000451b48 in ngx_http_process_request_line (rev=0xe87f70) at src/http/ngx_http_request.c:1022
#8  0x000000000043a3bb in ngx_epoll_process_events (cycle=<optimized out>, timer=<optimized out>, flags=<optimized out>) at src/event/modules/ngx_epoll_module.c:822
#9  0x00000000004321d3 in ngx_process_events_and_timers (cycle=cycle@entry=0xe82080) at src/event/ngx_event.c:242
#10 0x00000000004385d1 in ngx_worker_process_cycle (cycle=0xe82080, data=<optimized out>) at src/os/unix/ngx_process_cycle.c:753
#11 0x0000000000437050 in ngx_spawn_process (cycle=cycle@entry=0xe82080, proc=0x438550 <ngx_worker_process_cycle>, data=0x0, name=0x4d2f1f "worker process", respawn=respawn@entry=0)
    at src/os/unix/ngx_process.c:198
#12 0x00000000004396b4 in ngx_reap_children (cycle=0xe82080) at src/os/unix/ngx_process_cycle.c:621
#13 ngx_master_process_cycle (cycle=cycle@entry=0xe82080) at src/os/unix/ngx_process_cycle.c:174
#14 0x000000000041604a in main (argc=<optimized out>, argv=<optimized out>) at src/core/nginx.c:367
(gdb) quit
evg@thinkpad ~ $
=8<============================================
Comment 4 Evgenii Terechkov 2016-05-01 14:24:01 MSK
Апстрим уже сталкивался с такими случаями (см. URL). Как я понимаю, все они закрыты как invalid, т.к. дело во внешних модулях, с которыми собирался nginx.

В моём случае оказалось достаточно выключить сборку с ctpp2 чтобы нормализовать ситуацию.
Comment 5 Evgenii Terechkov 2016-05-01 14:27:39 MSK
Сервер при этом даже работает (отдаёт браузеру содержимое).
Comment 6 Denis Smirnov 2016-05-01 22:48:27 MSK
Извиняюсь, вчера пофиксил, а отправить на сборку забыл. Отправляю сейчас.

Да, виноват именно ctpp.

Заодно причесал подгрузку dynamic modules, и распилил на подпакеты (xslt, perl, geoip, image_filter).
Comment 7 Repository Robot 2016-05-01 22:52:57 MSK
nginx-1.10.0-alt3 -> sisyphus:

* Sun May 01 2016 Denis Smirnov <mithraen@altlinux> 1.10.0-alt3
- remove ctpp module (ALT #32041)
- fix dynamic modules configuration (use /etc/nginx/modules-enabled.d)
- move perl module to nginx-perl subpackege
- move GeoIP module to nginx-geoip subpackege
- move xslt module to nginx-xslt subpackege
- add image_filter module to nginx-image_filter subpackage
- add filetrigger for restart nginx when modules installed/removed