Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backend Selection is broken for vcl_version 4 #31

Open
kwisatz opened this issue Jul 6, 2023 · 0 comments
Open

Backend Selection is broken for vcl_version 4 #31

kwisatz opened this issue Jul 6, 2023 · 0 comments

Comments

@kwisatz
Copy link

kwisatz commented Jul 6, 2023

The current code for backend selection is broken with templates for vcl version 4.
It seems this fork has been created from an early state of maxchk's repository before all of this took place: https://github.com/maxchk/puppet-varnish/commits/develop/templates/includes/backendselection4.vcl.erb

Affected Puppet, Ruby, OS and module versions/distributions

  • Puppet: 7
  • Ruby: 2.1.5p273
  • Distribution: Debian 11
  • Module version: 4.0.0

What are you seeing

if (req.http.host ~ "^my-host\.com$") {
  set req.backend_hint = director_name;
}

What behavior did you expect instead

if (req.http.host ~ "^my-host\.com$") {
  set req.backend_hint = director_name.backend();
}

OR

if (req.http.host ~ "^my-host\.com$") {
  set req.backend_hint = backend_name;
}

Output log

Jul 06 15:24:08 lb-ng varnishd[215185]: Message from VCC-compiler:
Jul 06 15:24:08 lb-ng varnishd[215185]: Expression has type directors.round_robin, expected BACKEND
Jul 06 15:24:08 lb-ng varnishd[215185]: ('/etc/varnish/includes/backendselection.vcl' Line 3 Pos 26) -- (Pos 28)
Jul 06 15:24:08 lb-ng varnishd[215185]:   set req.backend_hint = director_name;
Jul 06 15:24:08 lb-ng varnishd[215185]: -------------------------###-
Jul 06 15:24:08 lb-ng varnishd[215185]: Running VCC-compiler failed, exited with 2

Any additional information you'd like to impart

See https://varnish-cache.org/docs/6.0/users-guide/vcl-backends.html#directors for varnish documentation.

I wonder if this has never been tested with version 4 templates?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant