2

Cutting a longish story short, we have managed to get a more precise error out of Varnishlog.

Varnishlog tells us that we are sending a

31 TxRequest    - POST
31 TxHeader     - Content-Type: application/x-www-form-urlencoded

but we are getting

    9 FetchError   c backend write error: 11
   31 BackendClose - [backend name]
    9 VCL_call     c error
    9 VCL_return   c deliver
    9 Length       c 488
    9 VCL_call     c deliver
    9 VCL_return   c deliver
    9 TxProtocol   c HTTP/1.1
    9 TxStatus     c 503

We still do not know what this is exactly, but apparently Content-Type: application/x-www-form-urlencoded is not getting through as it should. Help still needed, please!

Original message below.

The title was "Varnish not letting Joomla users to log in - 503 guru meditation error", but I changed it to get more attention to the problem and not to the symptoms.


Hello,

We have a production site for a local newspaper which is currently behind an Apache reverse proxy, basicly the site on one server and the other being reserved as a reverse proxy only (well, there is more but that has no relevance here). Apache as a reverse proxy works, but could be faster.

We want to change the reverse proxy to use Varnish instead of Apache on an Ubuntu 10.4 Server. The Varnish is version 2.10 installed directly from Ubuntu repos. Ubuntu 10.4 uses PHP 5.3.2.

For anonymous surfers the site works wonderfully with Varnish. So far we can get very good speed out of Varnish, we just have a few problems with logging in or out.

The big one is, that the users cannot log in: they get a Varnish 503 error page every time. The logs do not reveal the cause. It feels as if the request would never leave Varnish. So we are merely guessing - not a strong starting point.

We have gone through what has been suggested on various plces on the web. We have increased the timeouts to

backend xxx {
        .host = "xxx.xx";
        .port = "http";
        .connect_timeout = 60s;
        .first_byte_timeout = 60s;
        .between_bytes_timeout = 60s;
}

but we seem to get the 503 guru error page much faster than that, as in approx. 5 seconds.

We have increased the Varnish headers size to 128 in daemon.

In vcl_recv we have

if (req.http.Authenticate || req.http.Authorization) {
         return(pass);
        }

and in vcl_fetch

## auhtentication handling
         if (req.http.Authenticate || req.http.Authorization) {
           return(pass);
         }

We do not strip cookies.

We have tried to make sure that error pages are not cached. As said above, we cannot see anything in the backend Apache logs, apparently it never gets asked for Joomla user authentication.

Varnish does not seem to get much mentioning with connection to Joomla. (We cannot dump Joomla, that selection has been done and we just have to live with what we have been given) Has anyone a working Varnish - Joomla combination?

Thanks for reading. Please help. We need some hints - desperately. Any suggestions?

ompap

2 Answers 2

3

This bug report seems to suggest a workaround to your problem; you should give it a try.

https://www.varnish-cache.org/trac/ticket/849

0
if (req.http.Authenticate || req.http.Authorization) {
     pass;
    }

Last time I was working with Varnish, you didn't use return(pass);, just pass; Dunno if that'll cause errors, or probably, cause varnish to ignore those bits of syntax.

The reason for doing this, is because pass; causes the varnish engine to switch directly to pass mode, which then just hands stuff directly from backend to client.
Seriously. I'm starting to think more and more that those return statements are just buggering it up.

edit2: I just re-read the VCL docs, and couldn't find anything about a return keyword.

3
  • Thank you, Tom. We actually had no return(pass) originally, just pass, in the first version of our vcl -file. Varnish 2.1.0 then refused to compile the vcl to runtime bin file, but instructed itself to replace pass with return(pass) pinpointing every row and column where it existed. I have played with earlier versions of Varnish about a year ago in an other project and used pass alone at that time (version 1.x , I still have the files on one of my disks). So I fear it seems to be something else than this. But perhaps you are on the trails - our vcl most likely has something to correct.
    – ompap
    Dec 12, 2010 at 19:22
  • If somebody else has a working Varnish-Joomla combo, I will try to persuade the management to allow us to publish ours for comparison. Configuration to a site which has not mentioned by name should not be out of question.
    – ompap
    Dec 12, 2010 at 19:22
  • I've had it working in $job-1 with Varnish/Drupal. Very similar, application wise. Dec 12, 2010 at 20:08

You must log in to answer this question.

Not the answer you're looking for? Browse other questions tagged .