Login | Register For Free | Help
Search for: (Advanced)

Mailing List Archive: Varnish: Bugs

#919: 503 error from varish while apache returns 200

 

 

Varnish bugs RSS feed   Index | Next | Previous | View Threaded


varnish-bugs at varnish-cache

May 18, 2011, 2:32 AM

Post #1 of 6 (595 views)
Permalink
#919: 503 error from varish while apache returns 200

#919: 503 error from varish while apache returns 200
------------------------+---------------------------------------------------
Reporter: damol | Type: defect
Status: new | Priority: normal
Milestone: | Component: build
Version: trunk | Severity: normal
Keywords: 503 centos |
------------------------+---------------------------------------------------
in one of 10000 requests i am recieving an 503 error. with mostly this
rule in my varnishlog:
{{{
30 FetchError c http read error: 11
}}}
my varnish.vcl:

{{{
# This is the configuration of varnish this file contains several checks
that decides to cache a page or not.
# Author: Daan Molenaar
C{
#include <stdio.h>
#include <stdlib.h>
#include <string.h>
}C
# first we tell how we can talk to the default webserver
backend default {
.host = "127.0.0.1";
.port = "8080";
.connect_timeout = 600s;
.first_byte_timeout = 600s;
.between_bytes_timeout = 600s;
}

sub vcl_recv {
## check the custom configuration file if the url is allowed to be
handled by varnish
C{
FILE * pFile;
long lSize;
char * buffer;
size_t result;

pFile = fopen ( "/etc/varnish/websites.cfg" , "rb" );
if (pFile==NULL) {fputs ("File error",stderr); exit (1);}

// obtain file size:
fseek (pFile , 0 , SEEK_END);
lSize = ftell (pFile);
rewind (pFile);

// allocate memory to contain the whole file:
buffer = (char*) malloc (sizeof(char)*lSize);
if (buffer == NULL) {fputs ("Memory error",stderr); exit
(2);}

// copy the file into the buffer:
result = fread (buffer,1,lSize,pFile);
if (result != lSize) {fputs ("Reading error",stderr); exit
(3);}

/* the whole file is now loaded in the memory buffer. */
char *host = VRT_GetHdr(sp, HDR_REQ, "\005Host:");
char * pch;
// add a < and > to be sure you get the complete host
char new_host[80];
strcpy (new_host,"<");
strcat (new_host,host);
strcat (new_host,">");
pch = strstr (buffer, new_host);
if(pch){
VRT_SetHdr(sp, HDR_REQ, "\014X-May-Cache:", "YES",
vrt_magic_string_end);
}
// terminate
fclose (pFile);
free (buffer);
}C

# if caching for this website is not enabled
if (req.http.X-May-Cache !~ "YES") {
return(pass);
}
## Default request checks
if (req.request != "GET" &&
req.request != "HEAD" &&
req.request != "PUT" &&
req.request != "POST" &&
req.request != "TRACE" &&
req.request != "OPTIONS" &&
req.request != "DELETE") {
# Non-RFC2616 or CONNECT which is weird.
return (pipe);
}
if (req.request != "GET" && req.request != "HEAD") {
# We only deal with GET and HEAD by default
return (pass);
}

## Remove has_js and Google Analytics cookies.
set req.http.Cookie = regsuball(req.http.Cookie,
"(^|;\s*)(__[a-z]+)=[^;]*", "");

## set the browser to IE because the content does not differ
set req.http.user-agent = "MSIE";


## Remove a ";" prefix, if present.
set req.http.Cookie = regsub(req.http.Cookie, "^;\s*", "");
## Remove empty cookies.
if (req.http.Cookie ~ "^\s*$") {
unset req.http.Cookie;
}
## Let's have a little grace
set req.grace = 60s;

## Normalize the Accept-Encoding header
## as per: http://varnish-cache.org/wiki/FAQ/Compression
if (req.http.Accept-Encoding) {
if (req.url ~ "\.(jpg|png|gif|gz|tgz|bz2|tbz|mp3|ogg)$" ||
req.url ~ "robots\.txt") {
# No point in compressing these
remove req.http.Accept-Encoding;
} elsif (req.http.Accept-Encoding ~ "gzip") {
set req.http.Accept-Encoding = "gzip";
} elsif (req.http.Accept-Encoding ~ "deflate") {
set req.http.Accept-Encoding = "deflate";
} else {
# unkown encoding algorithm
remove req.http.Accept-Encoding;
}
}
## cache css js and images always also when no user is logged in
if (req.url ~ "\.(css|js|jpg|jpeg|gif|ico|png)$") {
lookup;
}

## No varnish for install,update.php or cron.php
if (req.url ~ "install\.php|update\.php|cron\.php") {
return (pass);
}


if (req.http.Cookie ~ "NO_CACHE=Y") {
# there is no "no-cache" cookie set in the site
return (pass);
}
lookup;
}
sub vcl_fetch {
// set the time to live to one hour
set obj.ttl = 3600s;
set obj.grace = 60s;
}
### vcl_hash creates the key for varnish under which the object is stored.
It is
### possible to store the same url under 2 different keys, by making
vcl_hash
### create a different hash.
sub vcl_hash {

## these 2 entries are the default ones used for vcl. Below we add our
own.
set req.hash += req.url;
set req.hash += req.http.host;
## cache css js and images always
#if(req.url !~ "\.(css|js|jpg|jpeg|gif|ico|png)$"){
## Remove the SESSION cookie from the cookie and save it
in the Hash
set req.http.X-SYNETIC-COOKIE-NO-SESS =
regsuball(req.http.Cookie, "(^|; ) *SESS[A-Za-z0-9=]+;? *", "\1");
set req.hash += req.http.X-SYNETIC-COOKIE-NO-SESS;
#}
hash;
}


sub vcl_error {
// Let's deliver a slightly more friedly error page.
// You can customize this as you wish.

set obj.http.Content-Type = "text/html; charset=utf-8";
synthetic {"
<?xml version="1.0" encoding="utf-8"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html>
<head>
<title>"} obj.status " " obj.response {"</title>
<style type="text/css">
#page {width: 400px; padding: 10px; margin: 20px auto; border: 1px
solid black; background-color: #FFF;}
p {margin-left:20px;}
body {background-color: #DDD; margin: auto;}
</style>
</head>
<body>
<div id="page">
<h1>Page Could Not Be Loaded</h1>
<p>We're very sorry, but the page could not be loaded
properly. This should be fixed very soon, and we apologize for any
inconvenience.</p>
<hr />
<h4>Debug Info:</h4>
<pre>
Status: "} obj.status {"
Response: "} obj.response {"
XID: "} req.xid {"
</pre>
<address><a href="http://www.varnish-
cache.org/">Varnish</a></address>
</div>
</body>
</html>
"};
deliver;
}

sub vcl_deliver {
return (deliver);
}

}}}


i am running centos 5.5 64x

--
Ticket URL: <http://varnish-cache.org/trac/ticket/919>
Varnish <http://varnish-cache.org/>
The Varnish HTTP Accelerator

_______________________________________________
varnish-bugs mailing list
varnish-bugs [at] varnish-cache
http://www.varnish-cache.org/lists/mailman/listinfo/varnish-bugs


varnish-bugs at varnish-cache

May 23, 2011, 3:11 AM

Post #2 of 6 (552 views)
Permalink
Re: #919: 503 error from varish while apache returns 200 [In reply to]

#919: 503 error from varish while apache returns 200
--------------------+-------------------------------------------------------
Reporter: damol | Owner: kristian
Type: defect | Status: new
Priority: normal | Milestone:
Component: build | Version: trunk
Severity: normal | Keywords: 503 centos
--------------------+-------------------------------------------------------
Changes (by tfheen):

* owner: => kristian


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

_______________________________________________
varnish-bugs mailing list
varnish-bugs [at] varnish-cache
http://www.varnish-cache.org/lists/mailman/listinfo/varnish-bugs


varnish-bugs at varnish-cache

Jun 6, 2011, 3:08 AM

Post #3 of 6 (532 views)
Permalink
Re: #919: 503 error from varish while apache returns 200 [In reply to]

#919: 503 error from varish while apache returns 200
----------------------+-----------------------------------------------------
Reporter: damol | Owner: kristian
Type: defect | Status: new
Priority: normal | Milestone:
Component: varnishd | Version: trunk
Severity: normal | Keywords: 503 centos
----------------------+-----------------------------------------------------
Changes (by kristian):

* component: build => varnishd


Comment:

Do you have any more information on this?

We will probably need the entire varnishlog of a request that fails and a
good chump of requests that _don't_ fail.

Also: Which version is this?

This can easily be an issue related to backend communication failures, but
we wont know until we have more data.

It can also easily be influenced by the in-line C, which looks somewhat
hazardous. Can you check if syslog has any information from varnishd?

--
Ticket URL: <http://www.varnish-cache.org/trac/ticket/919#comment:2>
Varnish <http://varnish-cache.org/>
The Varnish HTTP Accelerator

_______________________________________________
varnish-bugs mailing list
varnish-bugs [at] varnish-cache
http://www.varnish-cache.org/lists/mailman/listinfo/varnish-bugs


varnish-bugs at varnish-cache

Jun 6, 2011, 3:39 AM

Post #4 of 6 (537 views)
Permalink
Re: #919: 503 error from varish while apache returns 200 [In reply to]

#919: 503 error from varish while apache returns 200
----------------------+-----------------------------------------------------
Reporter: damol | Owner: kristian
Type: defect | Status: new
Priority: normal | Milestone:
Component: varnishd | Version: trunk
Severity: normal | Keywords: 503 centos
----------------------+-----------------------------------------------------

Comment(by damol):

My varnish version: varnish-2.0.6

I looked in the syslog but couldn't find something relevant.

I am running a varnish -w on the server now waiting for another error and
will post that log when an error occurs.

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

_______________________________________________
varnish-bugs mailing list
varnish-bugs [at] varnish-cache
http://www.varnish-cache.org/lists/mailman/listinfo/varnish-bugs


varnish-bugs at varnish-cache

Jun 14, 2011, 3:20 AM

Post #5 of 6 (506 views)
Permalink
Re: #919: 503 error from varish while apache returns 200 [In reply to]

#919: 503 error from varish while apache returns 200
------------------------+---------------------------------------------------
Reporter: damol | Owner: kristian
Type: defect | Status: closed
Priority: normal | Milestone:
Component: varnishd | Version: trunk
Severity: normal | Resolution: invalid
Keywords: 503 centos |
------------------------+---------------------------------------------------
Changes (by kristian):

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


Comment:

You need to test this on 2.1.5, or now 3.0.0 since that'll be out before
you get any relevant data.

If you can reproduce this on 3.0.0, feel free to re-open the ticket.

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

_______________________________________________
varnish-bugs mailing list
varnish-bugs [at] varnish-cache
http://www.varnish-cache.org/lists/mailman/listinfo/varnish-bugs


varnish-bugs at varnish-cache

Apr 22, 2014, 1:58 PM

Post #6 of 6 (112 views)
Permalink
Re: #919: 503 error from varish while apache returns 200 [In reply to]

#919: 503 error from varish while apache returns 200
------------------------+-----------------------
Reporter: damol | Owner: kristian
Type: defect | Status: closed
Priority: normal | Milestone:
Component: varnishd | Version: trunk
Severity: normal | Resolution: invalid
Keywords: 503 centos |
------------------------+-----------------------

Comment (by keretamalam):

I am about to leave and cannot look into this further right now, but I do
want to mention that relying on pkg-config itself is not a problem (as you
said, we also use it later), the problem is that on some systems, the .pc
file for pkg-config is supplying wrong information (whereas on yours, it's
botan-config that is wrong), so that's why I'm trying to make it work with
both (while one of them is bad).
[http://maskodoq.blogspot.com/2014/03/unit-link-terbaik-di-indonesia.html
Unit Link Terbaik di Indonesia Commonwealth Life Investra Link]
[http://maskodoq.blogspot.com/2013/07/CiptoJunaedy.html Cipto Junaedy]
[http://etnisjawa.blogspot.com/2013/08/apakah-cipto-junaedy-bohong.html
Cipto Junaedy]

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

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

Varnish bugs RSS feed   Index | Next | Previous | View Threaded
 
 


Interested in having your list archived? Contact Gossamer Threads
 
  Web Applications & Managed Hosting Powered by Gossamer Threads Inc.