5

EDIT: System ran out of disk space so the compiler couldnt create the files. The output of varnishd doesnt tell you this.

Always check your disk quota if you get weird errors with no obvious reason :)

will answer myself after 6 hours.

I am running varnish which is controlled by supervisor.

Varnish was running slow and no changes were made when I used supervisor to restart varnish.

But the restart failed, after manually executing sbin/varnishd -F -f etc/varnish/ourconfig.vcl -a localhost -p thread_pool_min=10 -p thread_pool_max=50 -s malloc,250M

i get the following error

Running VCC-compiler failed, exit 1

VCL compilation failed

nothing more.

This is our vcl file:

backend default {
    .host = "127.0.0.1";
    .port = "8002";
    .first_byte_timeout = 300s;
}

sub vcl_recv {
     if (req.request == "BAN") {
        ban("obj.http.X-Keywords ~ " + req.http.X-Ban-Keywords);
     }

     if (req.request != "GET" && req.request != "HEAD") {
        return (pass);
     }

     // Remove has_js and Google Analytics __* cookies.
     set req.http.Cookie = regsuball(req.http.Cookie, "(^|;\s*)(__(ut|at)[a-z]+|has_js)=[^;]*", "");
     // Remove a ";" prefix, if present.
     set req.http.Cookie = regsub(req.http.Cookie, "^;\s*", "");

     set req.grace = 5m;

     if (req.url ~".*(jpg|gif|kss|css|js|png|svg|woff)$") {
        unset req.http.Authorization;
        unset req.http.Cookie;
     }

     if (req.http.Authorization || req.http.Cookie ~ "__ac") {
         return (pass);
     }

     return (lookup);
}

sub vcl_fetch {

  if (req.url ~".*(jpg|gif|kss|css|js|png|svg|woff)$") {
    set beresp.ttl = 86400s;
  }

  if (req.url ~ "/login_form$" || req.http.Cookie ~ "__ac") {
      return (hit_for_pass);
  }
  set beresp.grace = 5m;
  unset beresp.http.Set-Cookie;
  unset beresp.http.Pragma;
  unset beresp.http.Cache-Control;

  if (beresp.ttl < 15m) {
      set beresp.ttl = 15m;
  }

  # images should live one day
  if (req.url ~ "\/(image|image_thumb|image_mini|cover_image|image_small|image_preview)$") {
      set beresp.ttl = 1209600s;
      set beresp.http.cache-control = "max-age=1209600;s-maxage=1209600";
      set beresp.http.max-age = "1209600";
      set beresp.http.s-maxage = "1209600";
      set beresp.http.expires = "1209600";
  }
  if (req.url ~ "\.(png|gif|jpg|swf|otf|ttf|woff|svg)$") {
      set beresp.ttl = 1209600s;
      set beresp.http.cache-control = "max-age=1209600;s-maxage=1209600";
      set beresp.http.max-age = "1209600";
      set beresp.http.s-maxage = "1209600";
      set beresp.http.expires = "1209600";
  }
  # resource files should live 14 days to make google happy
  if (req.url ~ "\.(css|js|kss)$") {
      set beresp.ttl = 1209600s;
      set beresp.http.cache-control = "max-age=1209600;s-maxage=1209600";
      set beresp.http.max-age = "1209600";
      set beresp.http.s-maxage = "1209600";
      set beresp.http.expires = "1209600";
  }

  if (beresp.status >= 500 || beresp.status == 403 || beresp.status == 302) {
      set beresp.ttl = 0s;
  }

  return (deliver);
}

sub vcl_deliver {
  set resp.http.X-Hits = obj.hits;
}

Any help would be appreciated. Thanks a lot!

user2040627
  • 53
  • 1
  • 4
  • Usually it gives the line number where the VCL compilation failed. Didn't u get anything like that. It would be great help if you can post the same, if seeing that – Napster_X Mar 19 '13 at 16:02
  • 3
    No, the problem was the disk ran full. So there was no space left to compile the files. After cleaning up everything worked fine again. That was also the reason for the slowdown, dummy me. :) Thanks for the advice anyways! – user2040627 Mar 19 '13 at 16:23
  • Saved my day, tks, mate. – weynhamz Jul 17 '17 at 09:05

1 Answers1

0

Just so that this is registered as an answer, OP found the solution was;

No, the problem was the disk ran full. So there was no space left to compile the files. After cleaning up everything worked fine again. That was also the reason for the slowdown, dummy me. :) Thanks for the advice anyways! –

Kirrus
  • 482
  • 2
  • 11