I have been running Varnish on my production server successfully for several weeks now. Now I'm trying to configure Varnish to use a second backend for certain requests. My original working VCL (/etc/varnish/default.vcl) begins like this:

backend default {
  .host = "";
  .port = "8080";

...rest of VCL...

And I'm changing it to:

backend default {
  .host = "";
  .port = "8080";

backend backend2 {
  .host = "";
  .port = "80";

...rest of VCL...

When I reload the VCL file, I get the following:

Command failed with error code 106
Failed to reload /etc/varnish/default.vcl.

Any idea what the error could be, or how I can get more information on the problem?

(Note: To reload the VCL, I'm using the script found here: http://kristian.blog.linpro.no/2009/02/18/easy-reloading-of-varnish-vcl/)


I've not seen that specific error, but, when putting a backend in, I have noticed if the backend isn't referenced within the config, it has given me problems when restarting on our development servers.

storage_file: filename: /var/lib/varnish/devel/varnish_storage.bin size 1024 MB.
Message from VCC-compiler:
Unused backend default2, defined:
(input Line 11 Pos 9)
backend default2 {
Running VCC-compiler failed, exit 1
VCL compilation failed

So, is it possible that you have no rule referencing the backend?

| improve this answer | |
  • Thank you for the suggestion. I've tried it both ways -- with and without the relevant rule referencing the backend but to no avail. Also, how do you view the VCC-compiler output? If I could see that, it might give me the clue I need. – Andy Mar 27 '10 at 23:14
  • Interestingly, it turns out that my problem was related to your suggestion. When I reloaded the VCL without referencing the backend in the config, I got the error. When I reloaded the VCL with a reference to the backend, I still got the error -- but that was because I had a syntax error in the line referencing the backend (I put "req.backend = backend2;" instead of "set req.backend = backend2;". When I corrected the syntax error, the VCL reloaded normally and now works as expected. Thanks! – Andy Mar 28 '10 at 4:47
  • telnet to the admin interface: telnet localhost 6082 vcl.load -C /etc/varnish/default.vcl or, if you restart the daemon through most init scripts, they shouldn't hide STDERR. – deleted Mar 28 '10 at 5:03

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.