<html><head><meta http-equiv="Content-Type" content="text/html charset=us-ascii"></head><body style="word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div>Hi,</div><div><br></div><div>I am having a problem with a varnish cache installation that I cannot find the answer to... I'm getting 503 (Service Unavailable) errors when trying to view an image served from a drupal 7 backend. </div><div><br></div><div>Here are details (ips, names are changed for privacy):</div><div><br></div><div> varnish cache -> <a href="http://foo.gatech.edu">foo.gatech.edu</a> (192.168.0.1), RHEL6, varnish-3.0.4-4.el6.art.x86_64 from the atomicorp repo</div><div> drupal server -> <a href="http://bar.gatech.edu">bar.gatech.edu</a> (192.168.0.2), RHEL6, apache 2.2, drupal 7, defined in vcl as backend 'bar', has '<a href="http://foo.gatech.edu">foo.gatech.edu</a>' as a ServerAlias</div><div> web client (Chrome) -> 10.10.10.1</div><div><br></div><div>Users can access the site via <a href="http://foo.gatech.edu/">http://foo.gatech.edu/</a> , which goes through the varnish cache, and works well, generally. The admins of the site can access the site via <a href="http://bar.gatech.edu/">http://bar.gatech.edu/</a> , which does not go through the cache. </div><div><br></div><div><br></div><div>When I use my web browser to try an fetch a JPEG image from <a href="http://foo.gatech.edu/home/images/50384">http://foo.gatech.edu/home/images/50384</a> , I get a 503 error from varnish. </div><div><br></div><div>This is odd for several reasons:</div><div><br></div><div> - I can see a successful (HTTP 200 result) request for the image both in apache logs of <a href="http://bar.gatech.edu">bar.gatech.edu</a>, and in the back-end (b) entries from the varnishlog on <a href="http://foo.gatech.edu">foo.gatech.edu</a></div><div> - It happens for any default-sized being served from the drupal application on <a href="http://bar.gatech.edu">bar.gatech.edu</a>, so it's not specific to one image. Images in the /home/images/ directory are served via the "Adaptive Image Styles" varnish module</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>- I can always successfully fetch the image via <a href="http://bar.gatech.edu/home/images/50384">http://bar.gatech.edu/home/images/50384</a> , bypassing the cache</div><div> - It does *not* happen for smaller versions of the same image. So, <a href="http://foo.gatech.edu/home/images/50384/thumbnail_scaled">http://foo.gatech.edu/home/images/50384/thumbnail_scaled</a> returns a smaller jpeg version of the image, through the cache, successfully every time. Using HTTPFox (similar to HTTP Live Headers) on Firefox shows nothing significantly different between fetching the original image and the thumbnail version of the image from <a href="http://bar.gatec.edu">bar.gatec.edu</a> directly</div><div><br></div><div>Things I've tried:</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>- restarting varnish, rebooting the box, etc.</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>- using both file and malloc storage options in /etc/sysconfig/varnish</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>- upping the backend-timeouts to very large values</div><div><span class="Apple-tab-span" style="white-space:pre"> </span>- eliminate any vhosts/hostname issues by changing my /etc/hosts so that <a href="http://foo.gatech.edu">foo.gatech.edu</a> resolves to 198.168.0.2, and then verifying <a href="http://foo.gatech.edu/home/images/50384">http://foo.gatech.edu/home/images/50384</a> returns a good image to my browser</div><div><span class="Apple-tab-span" style="white-space:pre"> </span></div><div><span class="Apple-tab-span" style="white-space:pre"> </span></div><div>Here is the varnishlog output from a failed request... The key line is "11 FetchError c straight insufficient bytes" :</div><div><br></div><div>-----------------------------------</div><div><br></div><div> 13 BackendOpen b bar 192.168.0.1 44950 192.168.0.2 80</div><div> 13 TxRequest b GET</div><div> 13 TxURL b /home/images/50384</div><div> 13 TxProtocol b HTTP/1.1</div><div> 13 TxHeader b Host: <a href="http://foo.gatech.edu">foo.gatech.edu</a></div><div> 13 TxHeader b Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8</div><div> 13 TxHeader b Pragma: no-cache</div><div> 13 TxHeader b User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.101 Safari/537.36</div><div> 13 TxHeader b DNT: 1</div><div> 13 TxHeader b Accept-Language: en-US,en;q=0.8</div><div> 13 TxHeader b X-Forwarded-For: 10.10.10.1</div><div> 13 TxHeader b X-Varnish: 1892649961</div><div> 13 TxHeader b Accept-Encoding: gzip</div><div> 13 RxProtocol b HTTP/1.1</div><div> 13 RxStatus b 200</div><div> 13 RxResponse b OK</div><div> 13 RxHeader b Date: Wed, 16 Oct 2013 20:17:23 GMT</div><div> 13 RxHeader b Server: Apache/2.2.3 (Red Hat)</div><div> 13 RxHeader b X-Powered-By: PHP/5.3.14 ZendServer/5.0</div><div> 13 RxHeader b X-Drupal-Cache: MISS</div><div> 13 RxHeader b Expires: Sun, 19 Nov 1978 05:00:00 GMT</div><div> 13 RxHeader b Last-Modified: Wed, 16 Oct 2013 20:17:23 +0000</div><div> 13 RxHeader b Cache-Control: public, max-age=21600</div><div> 13 RxHeader b ETag: "1381954643-1"</div><div> 13 RxHeader b Content-Length: 55293</div><div> 13 RxHeader b Content-Language: en</div><div> 13 RxHeader b Vary: Accept-Encoding</div><div> 13 RxHeader b Content-Encoding: gzip</div><div> 13 RxHeader b Connection: close</div><div> 13 RxHeader b Content-Type: image/jpeg</div><div> 13 Fetch_Body b 4(length) cls -1 mklen 1</div><div> 13 BackendClose b bar</div><div> 11 SessionOpen c 10.10.10.1 64106 :80</div><div> 11 ReqStart c 10.10.10.1 64106 1892649961</div><div> 11 RxRequest c GET</div><div> 11 RxURL c /home/images/50384</div><div> 11 RxProtocol c HTTP/1.1</div><div> 11 RxHeader c Host: <a href="http://foo.gatech.edu">foo.gatech.edu</a></div><div> 11 RxHeader c Connection: keep-alive</div><div> 11 RxHeader c Cache-Control: no-cache</div><div> 11 RxHeader c Accept: text/html,application/xhtml+xml,application/xml;q=0.9,image/webp,*/*;q=0.8</div><div> 11 RxHeader c Pragma: no-cache</div><div> 11 RxHeader c User-Agent: Mozilla/5.0 (Macintosh; Intel Mac OS X 10_8_5) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/30.0.1599.101 Safari/537.36</div><div> 11 RxHeader c DNT: 1</div><div> 11 RxHeader c Accept-Encoding: gzip,deflate,sdch</div><div> 11 RxHeader c Accept-Language: en-US,en;q=0.8</div><div> 11 VCL_call c recv</div><div> 11 VCL_return c lookup</div><div> 11 VCL_call c hash</div><div> 11 Hash c /home/images/50384</div><div> 11 Hash c <a href="http://foo.gatech.edu">foo.gatech.edu</a></div><div> 11 VCL_return c hash</div><div> 11 VCL_call c miss fetch</div><div> 11 Backend c 13 bar bar</div><div> 11 TTL c 1892649961 RFC 21600 -1 -1 1381954643 0 1381954643 280299600 21600</div><div> 11 VCL_call c fetch deliver</div><div> 11 ObjProtocol c HTTP/1.1</div><div> 11 ObjResponse c OK</div><div> 11 ObjHeader c Date: Wed, 16 Oct 2013 20:17:23 GMT</div><div> 11 ObjHeader c Server: Apache/2.2.3 (Red Hat)</div><div> 11 ObjHeader c X-Powered-By: PHP/5.3.14 ZendServer/5.0</div><div> 11 ObjHeader c X-Drupal-Cache: MISS</div><div> 11 ObjHeader c Expires: Sun, 19 Nov 1978 05:00:00 GMT</div><div> 11 ObjHeader c Last-Modified: Wed, 16 Oct 2013 20:17:23 +0000</div><div> 11 ObjHeader c Cache-Control: public, max-age=21600</div><div> 11 ObjHeader c ETag: "1381954643-1"</div><div> 11 ObjHeader c Content-Language: en</div><div> 11 ObjHeader c Vary: Accept-Encoding</div><div> 11 ObjHeader c Content-Encoding: gzip</div><div> 11 ObjHeader c Content-Type: image/jpeg</div><div> 11 ObjHeader c X-Varnish-IP: 192.168.0.1</div><div> 11 FetchError c straight insufficient bytes</div><div> 11 Gzip c u F - 29537 55293 80 80 236227</div><div> 11 VCL_call c error deliver</div><div> 11 VCL_call c deliver deliver</div><div> 11 TxProtocol c HTTP/1.1</div><div> 11 TxStatus c 503</div><div> 11 TxResponse c Service Unavailable</div><div> 11 TxHeader c Server: Varnish</div><div> 11 TxHeader c Content-Type: text/html; charset=utf-8</div><div> 11 TxHeader c Content-Length: 829</div><div> 11 TxHeader c Accept-Ranges: bytes</div><div> 11 TxHeader c Date: Wed, 16 Oct 2013 20:17:23 GMT</div><div> 11 TxHeader c X-Varnish: 1892649961</div><div> 11 TxHeader c Age: 0</div><div> 11 TxHeader c Via: 1.1 varnish</div><div> 11 TxHeader c Connection: close</div><div> 11 TxHeader c X-Cache: MISS</div><div> 11 Length c 829</div><div> 11 ReqEnd c 1892649961 1381954643.203719378 1381954643.275374174 0.000027418 0.071626902 0.000027895</div><div> 11 SessionClose c error</div><div> 11 StatSess c 10.10.10.1 64106 0 1 1 0 0 0 256 829</div><div><br></div><div>-----------------------------------</div><div><br></div><div>As I mentioned, I've Goolged around for this error "straight insufficient bytes" and didn't find any solution. I can find the line that returns that error in the varnish cache source code, but without knowning the internals of the src, it's Greek to me.</div><div><br></div><div>Anyone got any guesses/suggestions? Any help will be greatly appreciated.</div><div><br></div><div>Thanks,</div><div>Adam A</div><div><br></div><div apple-content-edited="true">
<div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><div style="color: rgb(0, 0, 0); font-family: Helvetica; font-size: medium; font-style: normal; font-variant: normal; font-weight: normal; letter-spacing: normal; line-height: normal; orphans: 2; text-align: -webkit-auto; text-indent: 0px; text-transform: none; white-space: normal; widows: 2; word-spacing: 0px; -webkit-text-size-adjust: auto; -webkit-text-stroke-width: 0px; word-wrap: break-word; -webkit-nbsp-mode: space; -webkit-line-break: after-white-space; "><br>-- <br>:: Adam Arrowood :: <a href="mailto:adam.arrowood@oit.gatech.edu">adam.arrowood@oit.gatech.edu</a><br>:: Office of Information Technology/A&I<br>:: Georgia Institute of Technology, Atlanta, GA USA</div></div>
</div>
<br></body></html>