When using Varnish Cache in an Alpine Linux 3.11 container, I suddenly found out that the reload functionality does not work.

The system log had the following entries:

Illegal character in VCL name error was confusing to me: I know I didn’t use any colons in file names nor procedure names. To find out what is wrong< I looked at the init script. reload() function was

To see what exactly happens, I added set -x to the function and ran /etc/init.d/varnishd reload. The output was:

And if you look at this line:

You will see the colons. I reran that command manually, and got the error:

OK, so the suspected issue is that the parameter to varnish.load contains colons. Let us try the same command but without colons:

Issue confirmed. Now let us fix the code. What we need to change is the call to date +%FT%H:%M:%S. We can replace it with date +%s. The %s format specifier means “seconds since 1970-01-01 00:00:00 UTC”.

Here is the patch:

Alpine 3.11 and Varnish Reload Issue
Tagged on:     

Leave a Reply

Your email address will not be published. Required fields are marked *