Mailing List Archive

#1826: 503 backend error after response with 204 without a body, varnish 4.1
#1826: 503 backend error after response with 204 without a body, varnish 4.1
--------------------------+--------------------
Reporter: xrowkristina | Type: defect
Status: new | Priority: high
Milestone: | Component: build
Version: 4.1.0 | Severity: normal
Keywords: |
--------------------------+--------------------
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@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@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>
Varnish <https://varnish-cache.org/>
The Varnish HTTP Accelerator

_______________________________________________
varnish-bugs mailing list
varnish-bugs@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-bugs
Re: #1826: 503 backend error after response with 204 without a body, varnish 4.1 [ In reply to ]
#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@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@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@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@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

_______________________________________________
varnish-bugs mailing list
varnish-bugs@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-bugs
Re: #1826: 503 backend error after response with 204 without a body, varnish 4.1 [ In reply to ]
#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@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@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@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@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:2>
Varnish <https://varnish-cache.org/>
The Varnish HTTP Accelerator

_______________________________________________
varnish-bugs mailing list
varnish-bugs@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-bugs
Re: #1826: 503 backend error after response with 204 without a body, varnish 4.1 [ In reply to ]
#1826: 503 backend error after response with 204 without a body, varnish 4.1
--------------------------+----------------------
Reporter: xrowkristina | Owner:
Type: defect | Status: closed
Priority: high | Milestone:
Component: build | Version: 4.1.0
Severity: normal | Resolution: invalid
Keywords: |
--------------------------+----------------------
Changes (by fgsch):

* status: new => closed
* resolution: => invalid


Comment:

Your backend is returning a Content-Length. This is invalid for 204
responses.

As per rfc7230 3.3.2 p31:

{{{
A server MUST NOT send a Content-Length header field in any response
with a status code of 1xx (Informational) or 204 (No Content). A
server MUST NOT send a Content-Length header field in any 2xx
(Successful) response to a CONNECT request (Section 4.3.6 of
[RFC7231]).
}}}

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

_______________________________________________
varnish-bugs mailing list
varnish-bugs@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-bugs
Re: #1826: 503 backend error after response with 204 without a body, varnish 4.1 [ In reply to ]
#1826: 503 backend error after response with 204 without a body, varnish 4.1
--------------------------+-----------------------
Reporter: xrowkristina | Owner:
Type: defect | Status: reopened
Priority: high | Milestone:
Component: build | Version: 4.1.0
Severity: normal | Resolution:
Keywords: |
--------------------------+-----------------------
Changes (by xrowkristina):

* status: closed => reopened
* resolution: invalid =>


Comment:

Ok, is this maybe a bug in our VCL? Because if I sent a request via curl I
didn't get Content-Length:

{{{

/var/www/www.wuv.de # curl
'http://localhost/sso/linksubscription?access_token=ZDQxY2E2N2IxZGM1MTlmZDRjOGVjYTA2NmJiMGVjNjE2MGUxNDFlNjhiODM1MDY3YmQxZmU1YmNkMzUyYmYzNg&abonummer=43433443534535345'
-H 'Host: kundenkonto-test.wuv.de' -H 'Accept-Language: de-DE,de;q=0.8,en-
US;q=0.6,en;q=0.4' -H 'Upgrade-Insecure-Requests: 1' -H 'User-Agent:
Mozilla/5.0 (Windows NT 6.3; WOW64) AppleWebKit/537.36 (KHTML, like Gecko)
Chrome/46.0.2490.71 Safari/537.36' -H 'Accept:
text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8'
-H 'Cache-Control: max-age=0' -H 'Cookie: BIGipServerlb-
varnish.wuvtest.de_6081=1678581420.49431.0000;
eZSESSID=qrp3li6mn4rcq9kj4778sd2cn6; wuv-p=1678581420.49431.0000' -I

}}}

{{{
HTTP/1.1 204 No Content
Date: Thu, 03 Dec 2015 17:19:12 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
Vary:
X-Debug-Token: fd8676
X-Debug-Token-Link: /_profiler/fd8676
Content-Type: text/html; charset=utf-8
}}}

Thanks a lot

Kristina

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

_______________________________________________
varnish-bugs mailing list
varnish-bugs@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-bugs
Re: #1826: 503 backend error after response with 204 without a body, varnish 4.1 [ In reply to ]
#1826: 503 backend error after response with 204 without a body, varnish 4.1
--------------------------+----------------------
Reporter: xrowkristina | Owner:
Type: defect | Status: closed
Priority: high | Milestone:
Component: build | Version: 4.1.0
Severity: normal | Resolution: invalid
Keywords: |
--------------------------+----------------------
Changes (by fgsch):

* status: reopened => closed
* resolution: => invalid


Comment:

It might be, however this is not a bug to be handled in the bug tracker.
Please use the different support options available at https://www.varnish-
cache.org/support.

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

_______________________________________________
varnish-bugs mailing list
varnish-bugs@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-bugs
Re: #1826: 503 backend error after response with 204 without a body, varnish 4.1 [ In reply to ]
#1826: 503 backend error after response with 204 without a body, varnish 4.1
--------------------------+----------------------
Reporter: xrowkristina | Owner:
Type: defect | Status: closed
Priority: high | Milestone:
Component: build | Version: 4.1.0
Severity: normal | Resolution: invalid
Keywords: |
--------------------------+----------------------

Comment (by Tom Anheyer):

We have the same issue with piwik/piwik.php responses. Dirty workaround
after migration from 3.0.7 to 4.1 for us is:

{{{
sub vcl_recv {
…
elsif ( req.http.host == "piwik.…" && req.url ~ "^/piwik\.php" ) {
…
return (pipe);
}
…
}}}

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

_______________________________________________
varnish-bugs mailing list
varnish-bugs@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-bugs
Re: #1826: 503 backend error after response with 204 without a body, varnish 4.1 [ In reply to ]
#1826: 503 backend error after response with 204 without a body, varnish 4.1
--------------------------+----------------------
Reporter: xrowkristina | Owner:
Type: defect | Status: closed
Priority: high | Milestone:
Component: build | Version: 4.1.0
Severity: normal | Resolution: invalid
Keywords: |
--------------------------+----------------------

Comment (by xrowkristina):

Thanks a lot Tom Anheyer.

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

_______________________________________________
varnish-bugs mailing list
varnish-bugs@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-bugs
Re: #1826: 503 backend error after response with 204 without a body, varnish 4.1 [ In reply to ]
#1826: 503 backend error after response with 204 without a body, varnish 4.1
--------------------------+----------------------
Reporter: xrowkristina | Owner:
Type: defect | Status: closed
Priority: high | Milestone:
Component: build | Version: 4.1.0
Severity: normal | Resolution: invalid
Keywords: |
--------------------------+----------------------

Comment (by xrow):

Dear fgsch,

Thanks for your time. We will double check again. The Content-Length
header is not delivered in the apache response (Response) that Kristina
provided. But I do see it in the varnish debug output. You are most likely
correct.

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

_______________________________________________
varnish-bugs mailing list
varnish-bugs@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-bugs
Re: #1826: 503 backend error after response with 204 without a body, varnish 4.1 [ In reply to ]
#1826: 503 backend error after response with 204 without a body, varnish 4.1
--------------------------+----------------------
Reporter: xrowkristina | Owner:
Type: defect | Status: closed
Priority: high | Milestone:
Component: build | Version: 4.1.0
Severity: normal | Resolution: invalid
Keywords: |
--------------------------+----------------------

Comment (by Tom Anheyer):

Thank you very mutch for your patience.

Our piwik is running on apache-2.4.10/php-fpm. The apache is adding the
Content-Length to EVERY request and it's impossible to fix this by

{{{
Header always unset Content-Length "expr=%{REQUEST_STATUS} == 204"
}}}

Ignoring the not rfc compliant headers would be very nice. In my opinion
varnish shouldt not be "katholischer als der Pabst" (more catholic as the
pope).

best regards
tom

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

_______________________________________________
varnish-bugs mailing list
varnish-bugs@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-bugs
Re: #1826: 503 backend error after response with 204 without a body, varnish 4.1 [ In reply to ]
#1826: 503 backend error after response with 204 without a body, varnish 4.1
--------------------------+----------------------
Reporter: xrowkristina | Owner:
Type: defect | Status: closed
Priority: high | Milestone:
Component: build | Version: 4.1.0
Severity: normal | Resolution: invalid
Keywords: |
--------------------------+----------------------

Comment (by xrow):

Hi,

this sounds like an php-fpm bug or apache bug. We had the same issue as
you, but it was an symfony php bug. I don´t mind varnish being strict. Now
we have this sencond issue, but we don´t know yet where it belongs to.

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

_______________________________________________
varnish-bugs mailing list
varnish-bugs@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-bugs
Re: #1826: 503 backend error after response with 204 without a body, varnish 4.1 [ In reply to ]
#1826: 503 backend error after response with 204 without a body, varnish 4.1
--------------------------+----------------------
Reporter: xrowkristina | Owner:
Type: defect | Status: closed
Priority: high | Milestone:
Component: build | Version: 4.1.0
Severity: normal | Resolution: invalid
Keywords: |
--------------------------+----------------------

Comment (by Tom Anheyer):

Hi,

It's a apache issue, but no client cares about the "Content-Length: 0"
header but varnish 4.1 does.

tom

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

_______________________________________________
varnish-bugs mailing list
varnish-bugs@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-bugs
Re: #1826: 503 backend error after response with 204 without a body, varnish 4.1 [ In reply to ]
#1826: 503 backend error after response with 204 without a body, varnish 4.1
--------------------------+-----------------------
Reporter: xrowkristina | Owner:
Type: defect | Status: reopened
Priority: high | Milestone:
Component: build | Version: 4.1.0
Severity: normal | Resolution:
Keywords: |
--------------------------+-----------------------
Changes (by fgsch):

* status: closed => reopened
* resolution: invalid =>


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

_______________________________________________
varnish-bugs mailing list
varnish-bugs@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-bugs
Re: #1826: 503 backend error after response with 204 without a body, varnish 4.1 [ In reply to ]
#1826: 503 backend error after response with 204 without a body, varnish 4.1
--------------------------+-----------------------
Reporter: xrowkristina | Owner:
Type: defect | Status: reopened
Priority: high | Milestone:
Component: build | Version: 4.1.0
Severity: normal | Resolution:
Keywords: |
--------------------------+-----------------------

Comment (by fgsch):

Ok. We've discussed this and we will ignore a zero C-L in the next
release.

Reopening the ticket until the workaround is committed.

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

_______________________________________________
varnish-bugs mailing list
varnish-bugs@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-bugs
Re: #1826: 503 backend error after response with 204 without a body, varnish 4.1 [ In reply to ]
#1826: 503 backend error after response with 204 without a body, varnish 4.1
--------------------------+---------------------------------------------
Reporter: xrowkristina | Owner: Federico G. Schwindt <fgsch@…>
Type: defect | Status: closed
Priority: high | Milestone:
Component: build | Version: 4.1.0
Severity: normal | Resolution: fixed
Keywords: |
--------------------------+---------------------------------------------
Changes (by Federico G. Schwindt <fgsch@…>):

* status: reopened => closed
* owner: => Federico G. Schwindt <fgsch@…>
* resolution: => fixed


Comment:

In [271e1c5299c5b32ee636e4a7e009fbbb5080569f]:
{{{
#!CommitTicketReference repository=""
revision="271e1c5299c5b32ee636e4a7e009fbbb5080569f"
Ignore 0 Content-Lengths in 204 responses

Broken implementations do it contrary to what the RFC mandates.

Fixes #1826.
}}}

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

_______________________________________________
varnish-bugs mailing list
varnish-bugs@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-bugs
Re: #1826: 503 backend error after response with 204 without a body, varnish 4.1 [ In reply to ]
#1826: 503 backend error after response with 204 without a body, varnish 4.1
--------------------------+---------------------------------------------
Reporter: xrowkristina | Owner: Federico G. Schwindt <fgsch@…>
Type: defect | Status: closed
Priority: high | Milestone:
Component: build | Version: 4.1.0
Severity: normal | Resolution: fixed
Keywords: |
--------------------------+---------------------------------------------

Comment (by Lasse Karstensen <lkarsten@…>):

In [368280d4c30f28175d38dbdd9e587d0f80ed7631]:
{{{
#!CommitTicketReference repository=""
revision="368280d4c30f28175d38dbdd9e587d0f80ed7631"
Ignore 0 Content-Lengths in 204 responses

Broken implementations do it contrary to what the RFC mandates.

Fixes #1826.
}}}

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

_______________________________________________
varnish-bugs mailing list
varnish-bugs@varnish-cache.org
https://www.varnish-cache.org/lists/mailman/listinfo/varnish-bugs