Uploaded image for project: 'eZ Publish / Platform'
  1. eZ Publish / Platform
  2. EZP-30116

Unable to use default VCL template on Varnish versions lower than 5.1

    Details

      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 encountered this issue on varnish-5.0.0.

        Activity

        Hide
        Massimiliano Giovagnoli added a comment -

        I'm experiencing the same issue

        Show
        Massimiliano Giovagnoli added a comment - I'm experiencing the same issue
        Hide
        André Rømcke added a comment - - edited

        0.8.2 is herby out for that Massimiliano Giovagnoli:
        https://github.com/ezsystems/ezplatform-http-cache/releases/tag/v0.8.2

        In short it comments out the debug VCL for ttl, as neither 4.1 nor 5.0 supports it.
        If you are on Varnish 5.0.0 be aware it's starting to be rather out of date, 4.1 and 6.0 are the "LTS" versions of Varnish.

        Show
        André Rømcke added a comment - - edited 0.8.2 is herby out for that Massimiliano Giovagnoli : https://github.com/ezsystems/ezplatform-http-cache/releases/tag/v0.8.2 In short it comments out the debug VCL for ttl, as neither 4.1 nor 5.0 supports it. If you are on Varnish 5.0.0 be aware it's starting to be rather out of date, 4.1 and 6.0 are the "LTS" versions of Varnish.
        Hide
        Massimiliano Giovagnoli added a comment -

        Thank you André

        Show
        Massimiliano Giovagnoli added a comment - Thank you André

          People

          • Assignee:
            Unassigned
            Reporter:
            Marek Nocoń
          • Votes:
            0 Vote for this issue
            Watchers:
            4 Start watching this issue

            Dates

            • Created:
              Updated:
              Resolved: