Re: Possible to disable/inactivate a backend using VCL?

2023-04-19 Thread Batanun B
Hi Guillaume, > I'm curious, if it's completely deactivated what's the benefit of having it > in the vcl? It is only intended to be deactivated in production (until we go live). Our test and staging environments have the backend active. > if (false) { >   set req.backend_hint =

Varnish won't start because backend host resolves to too many addresses, but they are all identical IPs

2023-04-19 Thread Batanun B
All of the sudden Varnish fails to start in my development environment, and gives me the following error message: Message from VCC-compiler: Backend host "redacted-hostname": resolves to too many addresses. Only one IPv4 and one IPv6 are allowed. Please specify which exact address you want to

Re: Strange Broken Pipe error from Varnish health checks

2023-04-19 Thread Batanun B
Couldn't a HEAD request solve this? Then nginx wouldn't bother with the body at all, right? This is what we do with our health checks. For example: backend someBackend { .host = "[redacted]"; .port = "80"; .probe = { .interval = 9s; .request = "HEAD

Re: Varnish won't start because backend host resolves to too many addresses, but they are all identical IPs

2023-04-19 Thread Guillaume Quintard
The fact the IPs are identical is weird, but I wouldn't be surprised if the dns entry actually contained 3 identical IPs. > Shouldn't Varnish be able to figure out that in that case it can just choose any one and it will work as expected? Shouldn't your DNS entries be clean? ;-) Honestly, if

Re: Varnish won't start because backend host resolves to too many addresses, but they are all identical IPs

2023-04-19 Thread Dridi Boukelmoune
On Wed, Apr 19, 2023 at 2:44 PM Guillaume Quintard wrote: > > The fact the IPs are identical is weird, but I wouldn't be surprised if the > dns entry actually contained 3 identical IPs. > > > Shouldn't Varnish be able to figure out that in that case it can just > > choose any one and it will

Re: Varnish won't start because backend host resolves to too many addresses, but they are all identical IPs

2023-04-19 Thread Batanun B
> Shouldn't your DNS entries be clean? ;-) Preferably, but I blame Microsoft here  The problem went away by itself when I tried starting again like half an hour later or so, so I guess it was a temporary glitch in the matrix. As far as I understand it, the IPs of these machines only change if

Re: Possible to disable/inactivate a backend using VCL?

2023-04-19 Thread Guillaume Quintard
Thank, I think I get it now. How about: backend theBackend none; Here's the relevant documentation: https://varnish-cache.org/docs/trunk/users-guide/vcl-backends.html#the-none-backend It was added in 6.4. Hope that helps. -- Guillaume Quintard On Wed, Apr 19, 2023 at 1:36 AM Batanun B

Re: Possible to disable/inactivate a backend using VCL?

2023-04-19 Thread Batanun B
> backend theBackend none; > Here's the relevant documentation: > https://varnish-cache.org/docs/trunk/users-guide/vcl-backends.html#the-none-backend > It was added in 6.4. Look like exactly what we need! Sadly we are "stuck" on 6.0 until the next LTS version comes. So I think that until then I

Is there any "try catch" functionality in VCL? If not, how to handle runtime errors in vcl_init?

2023-04-19 Thread Batanun B
Hi, We use the vmod crypto to verify cryptographic signatures for some of our traffic. When testing, the public key was hard coded in the VCL, but before we start using this feature in production we will switch to reading the public key from a file on disk. This file is generated on server

Re: Is there any "try catch" functionality in VCL? If not, how to handle runtime errors in vcl_init?

2023-04-19 Thread Dridi Boukelmoune
On Wed, Apr 19, 2023 at 4:25 PM Batanun B wrote: > > Hi, > > We use the vmod crypto to verify cryptographic signatures for some of our > traffic. When testing, the public key was hard coded in the VCL, but before > we start using this feature in production we will switch to reading the >

Re: Possible to disable/inactivate a backend using VCL?

2023-04-19 Thread Batanun B
> It was back-ported to 6.0, which is not an LTS branch limited to bug fixes ;) > > https://varnish-cache.org/docs/6.0/users-guide/vcl-backends.html Thanks! Wow, I can't believe that I could miss that. I thought I read that specific page, as well as searched on Google, but I guess I was too

Re: Is there any "try catch" functionality in VCL? If not, how to handle runtime errors in vcl_init?

2023-04-19 Thread Batanun B
> It's the VMOD author you should ask to have an option to ignore public > key errors. Well, I'm usually of the mindset that if a problem can be handled in a generic way by the language/platform/framework, then one should avoid requiring each and every custom vmod/plugin/library to handle it

Re: Varnish won't start because backend host resolves to too many addresses, but they are all identical IPs

2023-04-19 Thread Batanun B
> https://github.com/nigoroll/libvmod-dynamic/blob/master/src/vmod_dynamic.vcc#L538-L583 > maybe? > > I'm sure Nils will pipe up here if you need help, and if you want more > synchronous assistance, there's always the discord channel > . Thanks! :)

Re: Is there any "try catch" functionality in VCL? If not, how to handle runtime errors in vcl_init?

2023-04-19 Thread Batanun B
Just to explain my concern a bit. The worst case scenario in production, that I very much would like to avoid, could look something like this: 1. Something happens with our public key, so that Varnish won't be able to start after getting the new faulty key. Already running servers will continue

Re: Possible to disable/inactivate a backend using VCL?

2023-04-19 Thread Dridi Boukelmoune
On Wed, Apr 19, 2023 at 3:45 PM Batanun B wrote: > > > backend theBackend none; > > Here's the relevant documentation: > > https://varnish-cache.org/docs/trunk/users-guide/vcl-backends.html#the-none-backend > > It was added in 6.4. > > Look like exactly what we need! Sadly we are "stuck" on 6.0

Re: Varnish won't start because backend host resolves to too many addresses, but they are all identical IPs

2023-04-19 Thread Guillaume Quintard
> The documentation seems a bit lacking (no full VCL example), but I guess I could use their test cases as examples. https://github.com/nigoroll/libvmod-dynamic/blob/master/src/vmod_dynamic.vcc#L538-L583 maybe? I'm sure Nils will pipe up here if you need help, and if you want more synchronous