Opened 5 years ago

Closed 5 years ago

#684 closed defect (invalid)

False [warn] no "fastcgi_cache_key" for "fastcgi_cache" breaks start

Reported by: omega8cc@… Owned by:
Priority: critical Milestone:
Component: nginx-core Version: 1.7.x
Keywords: fastcgi_cache_key Cc:
uname -a: Linux v165q.qq.o8.io 3.2.23-vs2.3.2.12-beng #1 SMP Tue Jul 24 10:15:16 BST 2012 x86_64 GNU/Linux
nginx -V: nginx version: nginx/1.7.8 built by gcc 4.7.2 (Debian 4.7.2-5) TLS SNI support enabled configure arguments: --prefix=/usr --sbin-path=/usr/sbin/nginx --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/lock/nginx.lock --user=www-data --group=www-data --with-http_realip_module --with-http_gzip_static_module --with-http_stub_status_module --with-http_ssl_module --with-http_dav_module --with-http_flv_module --with-http_mp4_module --without-mail_pop3_module --without-mail_imap_module --without-mail_smtp_module --without-http_scgi_module --without-http_uwsgi_module --with-ipv6 --with-http_geoip_module --with-debug --add-module=/var/opt/nginx-upload-progress-module/ --add-module=/var/opt/ngx-cache-purge/

Description

Since version 1.7.8 Nginx fails to start, as a result of this patch now included: http://hg.nginx.org/nginx/rev/906530c9ffd2

To reproduce use only dynamic variables in fastcgi_cache_key with no other hardcoded default values.

Example which worked before:

fastcgi_cache speed;
fastcgi_cache_key "$is_bot$device$host$request_method$key_uri$cache_uid$http_x_forwarded_proto$sent_http_x_local_proto$cookie_respimg";

I guess the problem is that fastcgi_cache_key is not hardcoded in the configuration but uses only dynamic variables which are available as a response to request and not on config check at daemon start.

Change History (3)

comment:1 Changed 5 years ago by vbart

First of all, the patch you mentioned cannot prevent nginx from starting. It only adds warning. And the second, you are wrong about what the check does (it doesn't try to evaluate variables, it checks existence of raw directive value instead).

I suppose your problem is described here: https://github.com/FRiCKLE/ngx_cache_purge/issues/22

comment:2 Changed 5 years ago by omega8cc@…

Ah, so I was apparently confused by this warning while the real reason of failed start was the segfault:

v165q:~# service nginx configtest
nginx: [warn] no "fastcgi_cache_key" for "fastcgi_cache" in /etc/nginx/nginx.conf:23
/etc/init.d/nginx: line 128: 32183 Segmentation fault $DAEMON -t -c $NGINX_CONF_FILE
v165q:~#

Thanks for pointing this out!

comment:3 Changed 5 years ago by vbart

  • Resolution set to invalid
  • Status changed from new to closed

Ok. So I close this, since the issue is caused by segmentation fault in the 3-rd party module.

Note: See TracTickets for help on using tickets.