Opened 12 years ago

Closed 12 years ago

Last modified 22 months ago

#203 closed defect (invalid)

The gzip module doesn't produce a useful error on wrong syntax

Reported by: Bryan Seitz Owned by: somebody
Priority: minor Milestone:
Component: nginx-module Version: 1.2.x
Keywords: gzip mime Cc:
uname -a: Linux download-001 2.6.32-279.1.1.el6.x86_64 #1 SMP Tue Jul 10 13:47:21 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux
nginx -V: nginx version: nginx/1.2.2
built by gcc 4.4.6 20120305 (Red Hat 4.4.6-4) (GCC)
TLS SNI support enabled
configure arguments: --user=nginx --group=nginx --prefix=/usr/share/nginx --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 --http-client-body-temp-path=/var/lib/nginx/tmp/client_body --http-proxy-temp-path=/var/lib/nginx/tmp/proxy --http-fastcgi-temp-path=/var/lib/nginx/tmp/fastcgi --http-uwsgi-temp-path=/var/lib/nginx/tmp/uwsgi --http-scgi-temp-path=/var/lib/nginx/tmp/scgi --pid-path=/var/run/ --lock-path=/var/lock/subsys/nginx --with-http_ssl_module --with-http_realip_module --with-http_addition_module --with-http_xslt_module --with-http_image_filter_module --with-http_geoip_module --with-http_sub_module --with-http_dav_module --with-http_flv_module --with-http_gzip_static_module --with-http_random_index_module --with-http_secure_link_module --with-http_degradation_module --with-http_stub_status_module --with-http_perl_module --add-module=/usr/src/ngx-fancyindex --with-mail --with-file-aio --with-mail_ssl_module --with-ipv6 --with-cc-opt='-O2 -g' --with-ld-opt=-Wl,-E


If you do:

gzip_types application/javascript,application/json,application/xml,text/css,text/html;


gzip_types application/javascript application/json application/xml text/css text/html;

You get the following error:

Starting nginx: nginx: [emerg] could not build the test_types_hash, you should increase test_types_hash_bucket_size: 64

It would be good to actually say parse error on line X, etc...

Change History (2)

comment:1 by Maxim Dounin, 12 years ago

Resolution: invalid
Status: newclosed

There is no syntax error in the provided configuration.

The message shown is a generic error produced by a hash construction code due to too long line being added to a hash, which suggests to tune appropriate *_bucket_size directive (see here). For types testing the directive doesn't exists, but if there will be some real demand (i.e. there will be such a long types for real) we'll add one.

comment:2 by Maxim Dounin, 22 months ago

Keywords: mime added

See also #1537.

Note: See TracTickets for help on using tickets.