Why Body cannot be fetched?

Gonçalo Silva goncalo.silva at muzzley.com
Tue Dec 15 16:57:19 CET 2015


Hello,

There is one type of requests that Varnish (using version 4.1.0) only works
if i put return(pipe) for them on the vcl_recv. If i change it to
return(pass) i receive:

-   VCL_call       BACKEND_FETCH
-   VCL_return     fetch
-   BackendOpen    18 boot.server_api1 10.10.140.206 4050 10.10.140.250
43725
-   Timestamp      Bereq: 1450191336.453558 0.000820 0.000820
-   Timestamp      Beresp: 1450191336.461059 0.008320 0.007500
-   BerespProtocol HTTP/1.1
-   BerespStatus   200
-   BerespReason   OK
-   BerespHeader   media-type: application/json;v=1
-   BerespHeader   content-type: application/json; charset=utf-8
-   BerespHeader   cache-control: no-cache
-   BerespHeader   content-length: 698
-   BerespHeader   trailer: server-authorization
-   BerespHeader   transfer-encoding: chunked
-   BerespHeader   accept-ranges: bytes
-   BerespHeader   Date: Tue, 15 Dec 2015 14:55:36 GMT
-   BerespHeader   Connection: keep-alive
-   BackendClose   18 boot.server_api1
-   Error          Body cannot be fetched
-   Timestamp      Error: 1450191336.461100 0.008361 0.000041
-   BerespProtocol HTTP/1.1
-   BerespStatus   503


If i do the request directly to the backend, i get this response:

root at Reverse:/etc/varnish# curl -v -X 'GET' -H 'Authorization: Hawk
id="xxx", ts="1450192889", nonce="J9wb_l",
mac="HU+dyFe3PJQx7kEpQBUhDknUGQdqFPIlIoKokxxxxxx="' -H 'host:
xxx.mydomain.com' -H 'User-agent: com.muzzley.stag/2.5.7-STAG (Android
4.4.2 ; WIKO GETAWAY)' -H 'content-type: application/json' '
http://10.10.140.206:4050/profiles/d1921c94-a4a3-4cf1-ade8-16a3041238dc'
* Hostname was NOT found in DNS cache
*   Trying 10.10.140.206...
* Connected to 10.10.140.206 (10.10.140.206) port 4050 (#0)
> GET /profiles/d1921c94-a4a3-4cf1-ade8-16a3041238dc HTTP/1.1
> Accept: */*
> Authorization: Hawk id="xxx", ts="1450192889", nonce="J9wb_l",
mac="HU+dyFe3PJQx7kEpQBUhDknUGQdqFPIlIoKokxxxxx="
> host: xxx.mydomain.com
> User-agent: com.muzzley.stag/2.5.7-STAG (Android 4.4.2 ; WIKO GETAWAY)
> content-type: application/json
>
< HTTP/1.1 200 OK
< media-type: application/json;v=1
< content-type: application/json; charset=utf-8
< cache-control: no-cache
< content-length: 698
< trailer: server-authorization
< transfer-encoding: chunked
< accept-ranges: bytes
< Date: Tue, 15 Dec 2015 15:21:52 GMT
< Connection: keep-alive
<
* Connection #0 to host 10.10.140.206 left intact
{"id":"5669b89707955b9996cxxxxx","uuid":"d1921c94-a4a3-4cf1-ade8-16a3041xxxxx","kind":"device","name":"mymanagertest","provider":"teste","resourceUrl":"
http://demo-manager.office.mydomain.com/channels","authorizationUrl":"
http://demo-manager.office.mydomain.com/authorization","subscriptionUrl":"
http://demo-manager.office.mydomain.com/subscriptions","photoUrl":"
http://demo-manager.office.mydomain.com/images/profile2.jpg
","channelPhotoUrl":"http://mydomain.com/teste.jpg
","interface":"baa1766d-d1a2-440b-8ed7-af8296fxxxxx","requiredCapability":"discovery-webview","requiredCapabilityVersion":1,"accessList":[],"auth":{"inbound":{},"outbound":{}},"globalManagerAccess":false,"openOauthInBrowser":false}


I notice that the response arrives with the header "transfer-encoding:
chunked", and i'm guessing this might be the problem. Do you have any clue
what is happening, and how can i use return(pass) for these requests?

Thanks
Gonçalo Silva
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://www.varnish-cache.org/lists/pipermail/varnish-misc/attachments/20151215/b0b0b5e1/attachment.html>


More information about the varnish-misc mailing list