Closed Altimit closed 7 years ago
I will look in the week, the problem probably is in b6dace3 or d20b712.
@Altimit You can try, was reverted b6dace3 and d20b712 commit:
git clone -b testing https://github.com/nginx-modules/ngx_cache_purge.git
Same thing here.
debug.log:
2016/12/14 12:01:34 [debug] 12672#12672: accept on 0.0.0.0:80, ready: 0
2016/12/14 12:01:34 [debug] 12672#12672: posix_memalign: 00000000026D6C10:512 @16
2016/12/14 12:01:34 [debug] 12672#12672: *32 accept: 127.0.0.1:44640 fd:14
2016/12/14 12:01:34 [debug] 12672#12672: *32 event timer add: 14: 60000:1481716954850
2016/12/14 12:01:34 [debug] 12672#12672: *32 reusable connection: 1
2016/12/14 12:01:34 [debug] 12672#12672: *32 epoll add event: fd:14 op:1 ev:80002001
2016/12/14 12:01:34 [debug] 12672#12672: *32 http wait request handler
2016/12/14 12:01:34 [debug] 12672#12672: *32 malloc: 00000000026D6E20:1024
2016/12/14 12:01:34 [debug] 12672#12672: *32 recv: eof:0, avail:1
2016/12/14 12:01:34 [debug] 12672#12672: *32 recv: fd:14 79 of 1024
2016/12/14 12:01:34 [debug] 12672#12672: *32 reusable connection: 0
2016/12/14 12:01:34 [debug] 12672#12672: *32 posix_memalign: 000000000270FAC0:4096 @16
2016/12/14 12:01:34 [debug] 12672#12672: *32 http process request line
2016/12/14 12:01:34 [debug] 12672#12672: *32 http request line: "PURGE /test HTTP/1.1"
2016/12/14 12:01:34 [debug] 12672#12672: *32 http uri: "/test"
2016/12/14 12:01:34 [debug] 12672#12672: *32 http args: ""
2016/12/14 12:01:34 [debug] 12672#12672: *32 http exten: ""
2016/12/14 12:01:34 [debug] 12672#12672: *32 http process request header line
2016/12/14 12:01:34 [debug] 12672#12672: *32 http header: "User-Agent: curl/7.35.0"
2016/12/14 12:01:34 [debug] 12672#12672: *32 http header: "Host: localhost"
2016/12/14 12:01:34 [debug] 12672#12672: *32 http header: "Accept: */*"
2016/12/14 12:01:34 [debug] 12672#12672: *32 http header done
2016/12/14 12:01:34 [debug] 12672#12672: *32 event timer del: 14: 1481716954850
2016/12/14 12:01:34 [debug] 12672#12672: *32 generic phase: 0
2016/12/14 12:01:34 [debug] 12672#12672: *32 rewrite phase: 1
2016/12/14 12:01:34 [debug] 12672#12672: *32 test location: "/"
2016/12/14 12:01:34 [debug] 12672#12672: *32 test location: "purge"
2016/12/14 12:01:34 [debug] 12672#12672: *32 test location: "test"
2016/12/14 12:01:34 [debug] 12672#12672: *32 using configuration "/test"
2016/12/14 12:01:34 [debug] 12672#12672: *32 http cl:-1 max:1048576
2016/12/14 12:01:34 [debug] 12672#12672: *32 rewrite phase: 3
2016/12/14 12:01:34 [debug] 12672#12672: *32 post rewrite phase: 4
2016/12/14 12:01:34 [debug] 12672#12672: *32 generic phase: 5
2016/12/14 12:01:34 [debug] 12672#12672: *32 generic phase: 6
2016/12/14 12:01:34 [debug] 12672#12672: *32 generic phase: 7
2016/12/14 12:01:34 [debug] 12672#12672: *32 access phase: 8
2016/12/14 12:01:34 [debug] 12672#12672: *32 access phase: 9
2016/12/14 12:01:34 [debug] 12672#12672: *32 access phase: 10
2016/12/14 12:01:34 [debug] 12672#12672: *32 post access phase: 11
2016/12/14 12:01:34 [debug] 12672#12672: *32 posix_memalign: 00000000026EB020:4096 @16
2016/12/14 12:01:34 [debug] 12672#12672: *32 http set discard body
2016/12/14 12:01:34 [alert] 12574#12574: worker process 12672 exited on signal 11 (core dumped)
2016/12/14 12:01:34 [debug] 12676#12676: epoll add event: fd:6 op:1 ev:00002001
In the same time purging via curl -XGET http://localhost/purge
works well.
<html>
<head><title>Successful purge</title></head>
<body bgcolor="white">
<center><h1>Successful purge</h1>
<br>Key : /test
<br>Path: /data/nginx/img_cache/9/ac/4539330648b80f94ef3bf911f6d77ac9
</center>
<hr><center>nginx/1.11.6</center>
</body>
</html>
debug-log:
2016/12/14 12:03:55 [debug] 12676#12676: accept on 0.0.0.0:80, ready: 0
2016/12/14 12:03:55 [debug] 12676#12676: posix_memalign: 00000000026D67F0:512 @16
2016/12/14 12:03:55 [debug] 12676#12676: *33 accept: 127.0.0.1:44642 fd:3
2016/12/14 12:03:55 [debug] 12676#12676: *33 event timer add: 3: 60000:1481717095688
2016/12/14 12:03:55 [debug] 12676#12676: *33 reusable connection: 1
2016/12/14 12:03:55 [debug] 12676#12676: *33 epoll add event: fd:3 op:1 ev:80002001
2016/12/14 12:03:55 [debug] 12676#12676: *33 http wait request handler
2016/12/14 12:03:55 [debug] 12676#12676: *33 malloc: 00000000026D6A00:1024
2016/12/14 12:03:55 [debug] 12676#12676: *33 recv: eof:0, avail:1
2016/12/14 12:03:55 [debug] 12676#12676: *33 recv: fd:3 78 of 1024
2016/12/14 12:03:55 [debug] 12676#12676: *33 reusable connection: 0
2016/12/14 12:03:55 [debug] 12676#12676: *33 posix_memalign: 000000000270FAC0:4096 @16
2016/12/14 12:03:55 [debug] 12676#12676: *33 http process request line
2016/12/14 12:03:55 [debug] 12676#12676: *33 http request line: "GET /purge HTTP/1.1"
2016/12/14 12:03:55 [debug] 12676#12676: *33 http uri: "/purge"
2016/12/14 12:03:55 [debug] 12676#12676: *33 http args: ""
2016/12/14 12:03:55 [debug] 12676#12676: *33 http exten: ""
2016/12/14 12:03:55 [debug] 12676#12676: *33 http process request header line
2016/12/14 12:03:55 [debug] 12676#12676: *33 http header: "User-Agent: curl/7.35.0"
2016/12/14 12:03:55 [debug] 12676#12676: *33 http header: "Host: localhost"
2016/12/14 12:03:55 [debug] 12676#12676: *33 http header: "Accept: */*"
2016/12/14 12:03:55 [debug] 12676#12676: *33 http header done
2016/12/14 12:03:55 [debug] 12676#12676: *33 event timer del: 3: 1481717095688
2016/12/14 12:03:55 [debug] 12676#12676: *33 generic phase: 0
2016/12/14 12:03:55 [debug] 12676#12676: *33 rewrite phase: 1
2016/12/14 12:03:55 [debug] 12676#12676: *33 test location: "/"
2016/12/14 12:03:55 [debug] 12676#12676: *33 test location: "purge"
2016/12/14 12:03:55 [debug] 12676#12676: *33 using configuration "/purge"
2016/12/14 12:03:55 [debug] 12676#12676: *33 http cl:-1 max:1048576
2016/12/14 12:03:55 [debug] 12676#12676: *33 rewrite phase: 3
2016/12/14 12:03:55 [debug] 12676#12676: *33 post rewrite phase: 4
2016/12/14 12:03:55 [debug] 12676#12676: *33 generic phase: 5
2016/12/14 12:03:55 [debug] 12676#12676: *33 generic phase: 6
2016/12/14 12:03:55 [debug] 12676#12676: *33 generic phase: 7
2016/12/14 12:03:55 [debug] 12676#12676: *33 access phase: 8
2016/12/14 12:03:55 [debug] 12676#12676: *33 access phase: 9
2016/12/14 12:03:55 [debug] 12676#12676: *33 access phase: 10
2016/12/14 12:03:55 [debug] 12676#12676: *33 post access phase: 11
2016/12/14 12:03:55 [debug] 12676#12676: *33 posix_memalign: 00000000026EB020:4096 @16
2016/12/14 12:03:55 [debug] 12676#12676: *33 http set discard body
2016/12/14 12:03:55 [debug] 12676#12676: *33 http cache key: "/test"
2016/12/14 12:03:55 [debug] 12676#12676: *33 add cleanup: 00000000026EB6F8
2016/12/14 12:03:55 [debug] 12676#12676: *33 http file cache exists: 0 e:1
2016/12/14 12:03:55 [debug] 12676#12676: *33 cache file: "/data/nginx/img_cache/9/ac/4539330648b80f94ef3bf911f6d77ac9"
2016/12/14 12:03:55 [debug] 12676#12676: *33 add cleanup: 00000000026EB750
2016/12/14 12:03:55 [debug] 12676#12676: *33 http file cache fd: 10
2016/12/14 12:03:55 [debug] 12676#12676: *33 read: 10, 00000000026EB7D0, 390, 0
2016/12/14 12:03:55 [debug] 12676#12676: *33 HTTP/1.1 200 OK
Server: nginx/1.11.6
Date: Wed, 14 Dec 2016 12:03:55 GMT
Content-Type: text/html
Content-Length: 265
Connection: keep-alive
2016/12/14 12:03:55 [debug] 12676#12676: *33 write new buf t:1 f:0 00000000026EBB08, pos 00000000026EBB08, size: 148 file: 0, size: 0
2016/12/14 12:03:55 [debug] 12676#12676: *33 http write filter: l:0 f:0 s:148
2016/12/14 12:03:55 [debug] 12676#12676: *33 http output filter "/purge?"
2016/12/14 12:03:55 [debug] 12676#12676: *33 http copy filter: "/purge?"
2016/12/14 12:03:55 [debug] 12676#12676: *33 http postpone filter "/purge?" 00007FFF36D57700
2016/12/14 12:03:55 [debug] 12676#12676: *33 write old buf t:1 f:0 00000000026EBB08, pos 00000000026EBB08, size: 148 file: 0, size: 0
2016/12/14 12:03:55 [debug] 12676#12676: *33 write new buf t:1 f:0 00000000026EB9A8, pos 00000000026EB9A8, size: 265 file: 0, size: 0
2016/12/14 12:03:55 [debug] 12676#12676: *33 http write filter: l:1 f:0 s:413
2016/12/14 12:03:55 [debug] 12676#12676: *33 http write filter limit 0
2016/12/14 12:03:55 [debug] 12676#12676: *33 writev: 413 of 413
2016/12/14 12:03:55 [debug] 12676#12676: *33 http write filter 0000000000000000
2016/12/14 12:03:55 [debug] 12676#12676: *33 http copy filter: 0 "/purge?"
2016/12/14 12:03:55 [debug] 12676#12676: *33 http finalize request: 0, "/purge?" a:1, c:2
2016/12/14 12:03:55 [debug] 12676#12676: *33 http request count:2 blk:0
2016/12/14 12:03:55 [debug] 12676#12676: *33 http finalize request: -4, "/purge?" a:1, c:1
2016/12/14 12:03:55 [debug] 12676#12676: *33 set http keepalive handler
2016/12/14 12:03:55 [debug] 12676#12676: *33 http close request
2016/12/14 12:03:55 [debug] 12676#12676: *33 http log handler
2016/12/14 12:03:55 [debug] 12676#12676: *33 run cleanup: 00000000026EB750
2016/12/14 12:03:55 [debug] 12676#12676: *33 file cleanup: fd:10
2016/12/14 12:03:55 [debug] 12676#12676: *33 run cleanup: 00000000026EB6F8
2016/12/14 12:03:55 [debug] 12676#12676: *33 http file cache cleanup
2016/12/14 12:03:55 [debug] 12676#12676: *33 http file cache free, fd: 10
2016/12/14 12:03:55 [debug] 12676#12676: *33 free: 000000000270FAC0, unused: 0
2016/12/14 12:03:55 [debug] 12676#12676: *33 free: 00000000026EB020, unused: 839
2016/12/14 12:03:55 [debug] 12676#12676: *33 free: 00000000026D6A00
2016/12/14 12:03:55 [debug] 12676#12676: *33 hc free: 0000000000000000 0
2016/12/14 12:03:55 [debug] 12676#12676: *33 hc busy: 0000000000000000 0
2016/12/14 12:03:55 [debug] 12676#12676: *33 tcp_nodelay
2016/12/14 12:03:55 [debug] 12676#12676: *33 reusable connection: 1
2016/12/14 12:03:55 [debug] 12676#12676: *33 event timer add: 3: 65000:1481717100688
2016/12/14 12:03:55 [debug] 12676#12676: *33 http keepalive handler
2016/12/14 12:03:55 [debug] 12676#12676: *33 malloc: 00000000026D6A00:1024
2016/12/14 12:03:55 [debug] 12676#12676: *33 recv: eof:1, avail:1
2016/12/14 12:03:55 [debug] 12676#12676: *33 recv: fd:3 0 of 1024
2016/12/14 12:03:55 [info] 12676#12676: *33 client 127.0.0.1 closed keepalive connection
2016/12/14 12:03:55 [debug] 12676#12676: *33 close http connection: 3
2016/12/14 12:03:55 [debug] 12676#12676: *33 event timer del: 3: 1481717100688
2016/12/14 12:03:55 [debug] 12676#12676: *33 reusable connection: 0
2016/12/14 12:03:55 [debug] 12676#12676: *33 free: 00000000026D6A00
2016/12/14 12:03:55 [debug] 12676#12676: *33 free: 00000000026D67F0, unused: 128
@denji Tried nginx-1.11.10. Same thing.
built by gcc 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04)
built with OpenSSL 1.1.0d 26 Jan 2017
TLS SNI support enabled
configure arguments: --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --modules-path=/usr/lib/nginx/modules --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx.lock --http-client-body-temp-path=/var/cache/nginx/client_temp --http-proxy-temp-path=/var/cache/nginx/proxy_temp --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp --http-scgi-temp-path=/var/cache/nginx/scgi_temp --user=nginx --group=nginx --with-compat --with-file-aio --with-threads --with-http_addition_module --with-http_auth_request_module --with-http_dav_module --with-http_flv_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_mp4_module --with-http_random_index_module --with-http_realip_module --with-http_secure_link_module --with-http_slice_module --with-http_ssl_module --with-http_stub_status_module --with-http_sub_module --with-http_v2_module --with-mail --with-mail_ssl_module --with-stream --with-stream_realip_module --with-stream_ssl_module --with-stream_ssl_preread_module --with-cc-opt='-g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fPIC' --with-ld-opt='-Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now -Wl,--as-needed -pie' --with-openssl=/home/wizard/dist/test2/openssl-1.1.0d --add-dynamic-module=/home/wizard/dist/test2/ngx_cache_purge
Recompiled it with FRiCKLE/ngx_cache_purge, but using config from this repo. In this case everything works fine.
@Altimit FRiCKLE/ngx_cache_purge-2.3
does not support dynamic modules (--add-module=…/ngx_cache_purge
).
Recompiled it with FRiCKLE/ngx_cache_purge … In this case everything works fine.
--add-dynamic-module=/home/wizard/dist/test2/ngx_cache_purge
@denji If I'm right, it doesn't support dynamic modules only because of it's config file. So, as I've mentioned, I took config file from this repo https://github.com/nginx-modules/ngx_cache_purge/blob/master/config
@denji Sorry for misleading. In this configuration it also doesn't work. Worker process crashes when I use PURGE method. I tried to play with different versions of nginx, openssl and ngx_cache_purge module. So I've found out that the problem is presumably caused by newer verson of nginx. nginx-1.11.1 + nginx-modules/ngx_cache_purge + OpenSSL 1.0.1f works.
nginx version: nginx/1.11.1
built by gcc 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04)
built with OpenSSL 1.0.1f 6 Jan 2014
TLS SNI support enabled
configure arguments: --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --modules-path=/usr/lib/nginx/modules --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx.lock --http-client-body-temp-path=/var/cache/nginx/client_temp --http-proxy-temp-path=/var/cache/nginx/proxy_temp --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp --http-scgi-temp-path=/var/cache/nginx/scgi_temp --user=nginx --group=nginx --add-dynamic-module=/home/wizard/dist/test3/ngx_cache_purge --with-http_ssl_module --with-http_realip_module --with-http_addition_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_random_index_module --with-http_secure_link_module --with-http_stub_status_module --with-http_auth_request_module --with-http_xslt_module=dynamic --with-http_image_filter_module=dynamic --with-http_geoip_module=dynamic --with-http_perl_module=dynamic --add-dynamic-module=debian/extra/njs-1c50334fbea6/nginx --with-threads --with-stream --with-stream_ssl_module --with-http_slice_module --with-mail --with-mail_ssl_module --with-file-aio --with-ipv6 --with-http_v2_module --with-cc-opt='-g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security' --with-ld-opt='-Wl,-Bsymbolic-functions -Wl,-z,relro'
nginx-1.11.10 + nginx-modules/ngx_cache_purge + OpenSSL 1.0.1f crashes the worker.
nginx version: nginx/1.11.10
built by gcc 4.8.4 (Ubuntu 4.8.4-2ubuntu1~14.04)
built with OpenSSL 1.0.1f 6 Jan 2014
TLS SNI support enabled
configure arguments: --prefix=/etc/nginx --sbin-path=/usr/sbin/nginx --modules-path=/usr/lib/nginx/modules --conf-path=/etc/nginx/nginx.conf --error-log-path=/var/log/nginx/error.log --http-log-path=/var/log/nginx/access.log --pid-path=/var/run/nginx.pid --lock-path=/var/run/nginx.lock --http-client-body-temp-path=/var/cache/nginx/client_temp --http-proxy-temp-path=/var/cache/nginx/proxy_temp --http-fastcgi-temp-path=/var/cache/nginx/fastcgi_temp --http-uwsgi-temp-path=/var/cache/nginx/uwsgi_temp --http-scgi-temp-path=/var/cache/nginx/scgi_temp --user=nginx --group=nginx --with-compat --with-file-aio --with-threads --with-http_addition_module --with-http_auth_request_module --with-http_dav_module --with-http_flv_module --with-http_gunzip_module --with-http_gzip_static_module --with-http_mp4_module --with-http_random_index_module --with-http_realip_module --with-http_secure_link_module --with-http_slice_module --with-http_ssl_module --with-http_stub_status_module --with-http_sub_module --with-http_v2_module --with-mail --with-mail_ssl_module --with-stream --with-stream_realip_module --with-stream_ssl_module --with-stream_ssl_preread_module --with-cc-opt='-g -O2 -fstack-protector --param=ssp-buffer-size=4 -Wformat -Werror=format-security -Wp,-D_FORTIFY_SOURCE=2 -fPIC' --with-ld-opt='-Wl,-Bsymbolic-functions -Wl,-z,relro -Wl,-z,now -Wl,--as-needed -pie' --add-dynamic-module=/home/wizard/dist/test2/ngx_cache_purge
@Altimit nginx-1.11 unstable mainline, it may be better with nginx-1.10, or just lasted version of nginx-1.11?
@Altimit 1.11.10 https://nginx.org/en/CHANGES
Everything worked fine with nginx_1.11.1 + FRiCKLE/ngx_cache_purge bundle. Then, in order to implement APLN for http2 support, I recompiled nginx with openssl-1.1.0c and nginx-modules/ngx_cache_purge. After that I started getting
Empty reply from server
on my purge cache requests.nginx -V
:nginx -T
configuration file /etc/nginx/nginx.conf:Debug log: