Varnish POST problem “9 FetchError c backend write error: 11” for application/x-www-form-urlencoded content


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.


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) {

and in vcl_fetch

## auhtentication handling
         if (req.http.Authenticate || req.http.Authorization) {

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?


Best Answer

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