Varnish 500 Backend Fetch Failed when varnish is started as service

Debraj Manna subharaj.manna at gmail.com
Wed Dec 30 10:27:18 CET 2015


Hi,

I am new to varnish. Whenever I am trying to acess our backend via varnish
I am getting the below error:-
<!DOCTYPE html>
<html>
  <head>
    <title>503 Backend fetch failed</title>
  </head>
  <body>
    <h1>Error 503 Backend fetch failed</h1>
    <p>Backend fetch failed</p>
    <h3>Guru Meditation:</h3>
    <p>XID: 3</p>
    <hr>
    <p>Varnish cache server</p>
  </body>
</html>

My vcl looks like below:-
vcl 4.0;
backend default {
    .host = "146.88.25.40";
    .port = "8080";
}

Directly requesting to the backend from the host in which varnish is
installed works fine.

I also tried setting .connect_timeout = 60s; first_byte_timeout = 60s;
.between_bytes_timeout = 60s; But no luck.

varnishlog looks something like below:-
*   << BeReq    >> 3
-   Begin          bereq 2 fetch
-   Timestamp      Start: 1451466805.152313 0.000000 0.000000
-   BereqMethod    GET
-   BereqURL
/rde_server/res/feea8d0b3d50/recomm/home/sid/jb55653bbd980baaf37484ef70bcfcef9b84d7c680ad1b487aed1fb21ac6779025?home_tsFilter=&cat_tsFilter=%28conc.item.brand+not+in+%2836%2C4187%2C4201%2C3721%2C4103%2C4101%2C4199%2C4075%29%29%28conc.item.param1+in+%28+a
-   BereqProtocol  HTTP/1.1
-   BereqHeader    User-Agent: curl/7.38.0
-   BereqHeader    Host: localhost:6081
-   BereqHeader    Accept: */*
-   BereqHeader    X-Forwarded-For: ::1
-   BereqHeader    Accept-Encoding: gzip
-   BereqHeader    X-Varnish: 3
-   VCL_call       BACKEND_FETCH
-   VCL_return     fetch
-   FetchError     no backend connection
-   Timestamp      Beresp: 1451466805.152502 0.000189 0.000189
-   Timestamp      Error: 1451466805.152511 0.000198 0.000009
-   BerespProtocol HTTP/1.1
-   BerespStatus   503
-   BerespReason   Service Unavailable
-   BerespReason   Backend fetch failed
-   BerespHeader   Date: Wed, 30 Dec 2015 09:13:25 GMT
-   BerespHeader   Server: Varnish
-   VCL_call       BACKEND_ERROR
-   BerespHeader   Content-Type: text/html; charset=utf-8
-   BerespHeader   Retry-After: 5
-   VCL_return     deliver
-   Storage        malloc Transient
-   ObjProtocol    HTTP/1.1
-   ObjStatus      503
-   ObjReason      Backend fetch failed
-   ObjHeader      Date: Wed, 30 Dec 2015 09:13:25 GMT
-   ObjHeader      Server: Varnish
-   ObjHeader      Content-Type: text/html; charset=utf-8
-   ObjHeader      Retry-After: 5
-   Length         278
-   BereqAcct      0 0 0 0 0 0
-   End

*   << Request  >> 2
-   Begin          req 1 rxreq
-   Timestamp      Start: 1451466805.152189 0.000000 0.000000
-   Timestamp      Req: 1451466805.152189 0.000000 0.000000
-   ReqStart       ::1 44193
-   ReqMethod      GET
-   ReqURL
/rde_server/res/feea8d0b3d50/recomm/home/sid/jb55653bbd980baaf37484ef70bcfcef9b84d7c680ad1b487aed1fb21ac6779025?home_tsFilter=&cat_tsFilter=%28conc.item.brand+not+in+%2836%2C4187%2C4201%2C3721%2C4103%2C4101%2C4199%2C4075%29%29%28conc.item.param1+in+%28+a
-   ReqProtocol    HTTP/1.1
-   ReqHeader      User-Agent: curl/7.38.0
-   ReqHeader      Host: localhost:6081
-   ReqHeader      Accept: */*
-   ReqHeader      X-Forwarded-For: ::1
-   VCL_call       RECV
-   VCL_return     hash
-   VCL_call       HASH
-   VCL_return     lookup
-   VCL_call       MISS
-   VCL_return     fetch
-   Link           bereq 3 fetch
-   Timestamp      Fetch: 1451466805.152650 0.000461 0.000461
-   RespProtocol   HTTP/1.1
-   RespStatus     503
-   RespReason     Backend fetch failed
-   RespHeader     Date: Wed, 30 Dec 2015 09:13:25 GMT
-   RespHeader     Server: Varnish
-   RespHeader     Content-Type: text/html; charset=utf-8
-   RespHeader     Retry-After: 5
-   RespHeader     X-Varnish: 2
-   RespHeader     Age: 0
-   RespHeader     Via: 1.1 varnish-v4
-   VCL_call       DELIVER
-   VCL_return     deliver
-   Timestamp      Process: 1451466805.152718 0.000529 0.000068
-   RespHeader     Content-Length: 278
-   Debug          "RES_MODE 2"
-   RespHeader     Connection: keep-alive
-   Timestamp      Resp: 1451466805.152773 0.000584 0.000055
-   ReqAcct        386 0 386 235 278 513
-   End

*   << Session  >> 1
-   Begin          sess 0 HTTP/1
-   SessOpen       ::1 44193 :6081 ::1 6081 1451466805.152117 14
-   Link           req 2 rxreq
-   SessClose      REM_CLOSE 0.001
-   End

If I start varnish as below then also everything works fine. I am facing
problem only when I start varnish via sudo service varnish start
sudo varnishd -n foo -f /etc/varnish/prudsys.vcl -s malloc,1G -T
localhost:6082  -a 0.0.0.0:6081

Can some one let me know what is going wrong? I am using varnish 4.1 on
Debian 8.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-misc/attachments/20151230/cb35d7ec/attachment.html>


More information about the varnish-misc mailing list