Details
-
Bug
-
Resolution: Fixed
-
High
-
2.4.1
Description
It's not possible to use the default Varnish template on Varnish versions lower than 5.1. Varnish service fails to start with:
varnish.service - Varnish HTTP accelerator Loaded: loaded (/lib/systemd/system/varnish.service; enabled; vendor preset: enabled) Drop-In: /etc/systemd/system/varnish.service.d └─override.conf Active: failed (Result: exit-code) since Wed 2019-02-06 13:43:16 GMT; 4s ago Docs: https://www.varnish-cache.org/docs/4.1/ man:varnishd Process: 3453 ExecStart=/usr/sbin/varnishd -j none -F -a :80 -T localhost:6082 -f /etc/varnish/default.vcl -S /etc/varnish/secret -s malloc,1024m (code=exited, status=2) Main PID: 3453 (code=exited, status=2) Feb 06 13:43:16 varnish varnishd[3453]: Message from VCC-compiler: Feb 06 13:43:16 varnish varnishd[3453]: Expression has type DURATION, expected BOOL Feb 06 13:43:16 varnish varnishd[3453]: ('/etc/varnish/default.vcl' Line 268 Pos 17) -- ('/etc/varnish/default.vcl' Line 268 Pos 23) Feb 06 13:43:16 varnish varnishd[3453]: if (obj.ttl) { Feb 06 13:43:16 varnish varnishd[3453]: ----------------#######--- Feb 06 13:43:16 varnish varnishd[3453]: Running VCC-compiler failed, exited with 2 Feb 06 13:43:16 varnish varnishd[3453]: VCL compilation failed Feb 06 13:43:16 varnish systemd[1]: varnish.service: Main process exited, code=exited, status=2/INVALIDARGUMENT Feb 06 13:43:16 varnish systemd[1]: varnish.service: Unit entered failed state. Feb 06 13:43:16 varnish systemd[1]: varnish.service: Failed with result 'exit-code'.
Looks like it's related to this change:
https://github.com/ezsystems/ezplatform-http-cache/commit/fc6117d4435d28907429b686fae3d7d103028b9f
Seems like implicit casting has been added in 5.1 (5.1.3 doc mentions it https://varnish-cache.org/docs/5.1/reference/vcl.html?highlight=vcl#booleans , but 4.1.10 does not: https://varnish-cache.org/docs/4.1/reference/vcl.html?highlight=vcl#booleans ).
katarzyna.zawada@ez.no encountered this issue on varnish-5.0.0.