[Varnish] #1826: 503 backend error after response with 204 without a body, varnish 4.1

Varnish varnish-bugs at varnish-cache.org
Wed Dec 2 11:57:34 CET 2015


#1826: 503 backend error after response with 204 without a body, varnish 4.1
--------------------------+--------------------
 Reporter:  xrowkristina  |       Owner:
     Type:  defect        |      Status:  new
 Priority:  high          |   Milestone:
Component:  build         |     Version:  4.1.0
 Severity:  normal        |  Resolution:
 Keywords:                |
--------------------------+--------------------
Description changed by aondio:

Old description:

> Hey guys,
>
> there is a bug in varnish if a response is sending 204 without a body.
> Look at this http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html, in
> case of 204 a body is not allowed.
>
> Here is an example request without varnish:
>
> {{{
> [11:11:24] root at webxyz.de # curl
> 'http://localhost/sso/linksubscription?access_token=MmRkYWNmNTY0NTJhZTFhMjNiMjExNGI1MGMyMzcxZmEzMjg0ZmI0YTZmMjJhYzZiMDJmMmUxMjlmMTFlNjVmYg&abonummer=324223424242324'
> -H 'Host: kundenkonto-test.wuv.de' -H 'Cookie:
> eZSESSID=bgocrn0dk4uaibnknlu7n46ht7;' -H 'Connection: keep-alive' -H
> 'Pragma: no-cache' -H 'Cache-Control: no-cache' -I
> }}}
>
> '''Response:'''
>
> {{{
> HTTP/1.1 204 No Content
> Date: Fri, 06 Nov 2015 10:11:51 GMT
> Server: Apache/2.4.7 (Ubuntu)
> X-Powered-By: PHP/5.5.9-1ubuntu4.9
> Cache-Control: max-age=0, must-revalidate, public, s-maxage=0
> X-Cache-Debug: 1
> Keep-Alive: timeout=5, max=100
> Connection: Keep-Alive
> Content-Type: text/html; charset=utf-8
> }}}
>

> Here is the same request with varnish:
>
> {{{
> [11:11:24] root at webxyz.de # curl 'http://kundenkonto-
> test.wuv.de/sso/linksubscription?access_token=MmRkYWNmNTY0NTJhZTFhMjNiMjExNGI1MGMyMzcxZmEzMjg0ZmI0YTZmMjJhYzZiMDJmMmUxMjlmMTFlNjVmYg&abonummer=324223424242324'
> -H 'Host: kundenkonto-test.wuv.de' -H 'Cookie:
> eZSESSID=bgocrn0dk4uaibnknlu7n46ht7;' -H 'Connection: keep-alive' -H
> 'Pragma: no-cache' -H 'Cache-Control: no-cache' -I
> }}}
>
> '''Response:'''
>
> {{{
> HTTP/1.1 503 Backend fetch failed
> Date: Fri, 06 Nov 2015 10:12:26 GMT
> Age: 0
> X-Powered-By: xrow GmbH
> X-Cache: wuvtest-web-1:MISS:Grace:none:TTL:-52924.482:User-
> Hash:b1731d46b0e7a375a5b024e950fdb8d49dd25af85a5c7dd5116ad2a18cda82cb
> Connection: keep-alive
> Set-Cookie: wuv-p=1678581420.49431.0000; path=/
> }}}
>

> And here is the varnishlog to the second request:
>

> *   << BeReq    >> 134065
>
> -   Begin          bereq 134064 fetch
>
> -   Timestamp      Start: 1446807850.981084 0.000000 0.000000
>
> -   BereqMethod    HEAD
>
> -   BereqURL
> /sso/linksubscription?abonummer=324223424242324&access_token=NDZhMDU5NTU5Y2E3MzgwZTg4YTQwODViZTI4ZTUwZDVmOTcyNGIwMWJkYjNmNDVjMzFiZDkwY2YyMjkxOTY5ZA
>
> -   BereqProtocol  HTTP/1.1
>
> -   BereqHeader    User-Agent: curl/7.35.0
>
> -   BereqHeader    Pragma: no-cache
>
> -   BereqHeader    X-Forwarded-For: 10.111.120.28, 10.111.120.28
>
> -   BereqHeader    X-TTL: 247.535
>
> -   BereqHeader    X-User-Hash:
> b1731d46b0e7a375a5b024e950fdb8d49dd25af85a5c7dd5116ad2a18cda82cb
>
> -   BereqHeader    X-grace: none
>
> -   BereqHeader    Host: kundenkonto-test.wuv.de
>
> -   BereqHeader    Surrogate-Capability: abc=ESI/1.0
>
> -   BereqHeader    accept: */*
>
> -   BereqHeader    cookie: eZSESSID=o2dumlbgq09e4g0sotinkevo71;
>
> -   BereqMethod    GET
>
> -   BereqHeader    Accept-Encoding: gzip
>
> -   BereqHeader    X-Varnish: 134065
>
> -   VCL_call       BACKEND_FETCH
>
> -   VCL_return     fetch
>
> -   BackendOpen    18 boot.default1 127.0.0.1 80 127.0.0.1 32876
>
> -   Timestamp      Bereq: 1446807850.981164 0.000081 0.000081
>
> -   Timestamp      Beresp: 1446807853.044470 2.063386 2.063306
>
> -   BerespProtocol HTTP/1.1
>
> -   BerespStatus   204
>
> -   BerespReason   No Content
>
> -   BerespHeader   Date: Fri, 06 Nov 2015 11:04:10 GMT
>
> -   BerespHeader   Server: Apache/2.4.7 (Ubuntu)
>
> -   BerespHeader   X-Powered-By: PHP/5.5.9-1ubuntu4.9
>
> -   BerespHeader   Cache-Control: max-age=0, must-revalidate, public,
> s-maxage=0
>
> -   BerespHeader   Vary: X-User-Hash
>
> -   BerespHeader   Content-Length: 0
>
> -   BerespHeader   Content-Type: text/html; charset=utf-8
>
> -   BackendClose   18 boot.default1
>
> -   Error          Body cannot be fetched
>
> -   Timestamp      Error: 1446807853.044513 2.063429 0.000043
>
> -   BerespProtocol HTTP/1.1
>
> -   BerespStatus   503
>
> -   BerespReason   Service Unavailable
>
> -   BerespReason   Backend fetch failed
>
> -   BerespHeader   Date: Fri, 06 Nov 2015 11:04:13 GMT
>
> -   BerespHeader   Server: Varnish
>
> -   VCL_call       BACKEND_ERROR
>
> -   VCL_return     deliver
>
> -   Storage        malloc Transient
>
> -   ObjProtocol    HTTP/1.1
>
> -   ObjStatus      503
>
> -   ObjReason      Backend fetch failed
>
> -   ObjHeader      Date: Fri, 06 Nov 2015 11:04:13 GMT
>
> -   ObjHeader      Server: Varnish
>
> -   Length         0
>
> -   BereqAcct      531 0 531 272 0 272
>
> -   End
>
> This guy has also the same problem: http://www.gossamer-
> threads.com/lists/varnish/misc/37386?page=last
>
> Thanks for help
>
> Best regards
> Kristina

New description:

 Hey guys,

 there is a bug in varnish if a response is sending 204 without a body.
 Look at this http://www.w3.org/Protocols/rfc2616/rfc2616-sec4.html, in
 case of 204 a body is not allowed.

 Here is an example request without varnish:

 {{{
 [11:11:24] root at webxyz.de # curl
 'http://localhost/sso/linksubscription?access_token=MmRkYWNmNTY0NTJhZTFhMjNiMjExNGI1MGMyMzcxZmEzMjg0ZmI0YTZmMjJhYzZiMDJmMmUxMjlmMTFlNjVmYg&abonummer=324223424242324'
 -H 'Host: kundenkonto-test.wuv.de' -H 'Cookie:
 eZSESSID=bgocrn0dk4uaibnknlu7n46ht7;' -H 'Connection: keep-alive' -H
 'Pragma: no-cache' -H 'Cache-Control: no-cache' -I
 }}}

 '''Response:'''

 {{{
 HTTP/1.1 204 No Content
 Date: Fri, 06 Nov 2015 10:11:51 GMT
 Server: Apache/2.4.7 (Ubuntu)
 X-Powered-By: PHP/5.5.9-1ubuntu4.9
 Cache-Control: max-age=0, must-revalidate, public, s-maxage=0
 X-Cache-Debug: 1
 Keep-Alive: timeout=5, max=100
 Connection: Keep-Alive
 Content-Type: text/html; charset=utf-8
 }}}


 Here is the same request with varnish:

 {{{
 [11:11:24] root at webxyz.de # curl 'http://kundenkonto-
 test.wuv.de/sso/linksubscription?access_token=MmRkYWNmNTY0NTJhZTFhMjNiMjExNGI1MGMyMzcxZmEzMjg0ZmI0YTZmMjJhYzZiMDJmMmUxMjlmMTFlNjVmYg&abonummer=324223424242324'
 -H 'Host: kundenkonto-test.wuv.de' -H 'Cookie:
 eZSESSID=bgocrn0dk4uaibnknlu7n46ht7;' -H 'Connection: keep-alive' -H
 'Pragma: no-cache' -H 'Cache-Control: no-cache' -I
 }}}

 '''Response:'''

 {{{
 HTTP/1.1 503 Backend fetch failed
 Date: Fri, 06 Nov 2015 10:12:26 GMT
 Age: 0
 X-Powered-By: xrow GmbH
 X-Cache: wuvtest-web-1:MISS:Grace:none:TTL:-52924.482:User-
 Hash:b1731d46b0e7a375a5b024e950fdb8d49dd25af85a5c7dd5116ad2a18cda82cb
 Connection: keep-alive
 Set-Cookie: wuv-p=1678581420.49431.0000; path=/
 }}}


 And here is the varnishlog to the second request:

 {{{
 *   << BeReq    >> 134065
 -   Begin          bereq 134064 fetch

 -   Timestamp      Start: 1446807850.981084 0.000000 0.000000

 -   BereqMethod    HEAD

 -   BereqURL
 /sso/linksubscription?abonummer=324223424242324&access_token=NDZhMDU5NTU5Y2E3MzgwZTg4YTQwODViZTI4ZTUwZDVmOTcyNGIwMWJkYjNmNDVjMzFiZDkwY2YyMjkxOTY5ZA

 -   BereqProtocol  HTTP/1.1

 -   BereqHeader    User-Agent: curl/7.35.0

 -   BereqHeader    Pragma: no-cache

 -   BereqHeader    X-Forwarded-For: 10.111.120.28, 10.111.120.28

 -   BereqHeader    X-TTL: 247.535

 -   BereqHeader    X-User-Hash:
 b1731d46b0e7a375a5b024e950fdb8d49dd25af85a5c7dd5116ad2a18cda82cb

 -   BereqHeader    X-grace: none

 -   BereqHeader    Host: kundenkonto-test.wuv.de

 -   BereqHeader    Surrogate-Capability: abc=ESI/1.0

 -   BereqHeader    accept: */*

 -   BereqHeader    cookie: eZSESSID=o2dumlbgq09e4g0sotinkevo71;

 -   BereqMethod    GET

 -   BereqHeader    Accept-Encoding: gzip

 -   BereqHeader    X-Varnish: 134065

 -   VCL_call       BACKEND_FETCH

 -   VCL_return     fetch

 -   BackendOpen    18 boot.default1 127.0.0.1 80 127.0.0.1 32876

 -   Timestamp      Bereq: 1446807850.981164 0.000081 0.000081

 -   Timestamp      Beresp: 1446807853.044470 2.063386 2.063306

 -   BerespProtocol HTTP/1.1

 -   BerespStatus   204

 -   BerespReason   No Content

 -   BerespHeader   Date: Fri, 06 Nov 2015 11:04:10 GMT

 -   BerespHeader   Server: Apache/2.4.7 (Ubuntu)

 -   BerespHeader   X-Powered-By: PHP/5.5.9-1ubuntu4.9

 -   BerespHeader   Cache-Control: max-age=0, must-revalidate, public,
 s-maxage=0

 -   BerespHeader   Vary: X-User-Hash

 -   BerespHeader   Content-Length: 0

 -   BerespHeader   Content-Type: text/html; charset=utf-8

 -   BackendClose   18 boot.default1

 -   Error          Body cannot be fetched

 -   Timestamp      Error: 1446807853.044513 2.063429 0.000043

 -   BerespProtocol HTTP/1.1

 -   BerespStatus   503

 -   BerespReason   Service Unavailable

 -   BerespReason   Backend fetch failed

 -   BerespHeader   Date: Fri, 06 Nov 2015 11:04:13 GMT

 -   BerespHeader   Server: Varnish

 -   VCL_call       BACKEND_ERROR

 -   VCL_return     deliver

 -   Storage        malloc Transient

 -   ObjProtocol    HTTP/1.1

 -   ObjStatus      503

 -   ObjReason      Backend fetch failed

 -   ObjHeader      Date: Fri, 06 Nov 2015 11:04:13 GMT

 -   ObjHeader      Server: Varnish

 -   Length         0

 -   BereqAcct      531 0 531 272 0 272

 -   End
 }}}

 This guy has also the same problem: http://www.gossamer-
 threads.com/lists/varnish/misc/37386?page=last

 Thanks for help

 Best regards
 Kristina

--

-- 
Ticket URL: <https://www.varnish-cache.org/trac/ticket/1826#comment:1>
Varnish <https://varnish-cache.org/>
The Varnish HTTP Accelerator



More information about the varnish-bugs mailing list