You are viewing a plain text version of this content. The canonical link for it is here.
Posted to users@httpd.apache.org by Carl Brewer <ca...@vivitec.com.au> on 2003/10/15 05:08:26 UTC

[users@httpd] apache 2.0.47 mod_proxy : proxy: error reading status line from remote server

Hello

I'm in the process of moving a large web hosting site from
apache 1.3 to 2.0, and we use a lot of reverse proxying.

Our backend server's running mod_perl and other goodies, and
is 1.3.x, OS is RedHat linux 7.3 on i386.  The proxy
server and the backend server are running on the same box.

I'm seeing some interesting behaviour with mod_proxy on 2.0.47
connecting to the backend server.  I don't see this with
our 1.3.x mod_proxy server.

Occasionally attempts to connect to the backend server give me
an error I can't work out.

I see this in the error logs :

[Wed Oct 15 12:32:40 2003] [error] [client xx.xx.xx.xx] proxy: error 
reading status line from remote server www.foo.bar
[Wed Oct 15 12:32:40 2003] [error] [client xx.xx.xx.xx] proxy: Error 
reading from remote server returned by /content/content.pl

And the browser displays :

Proxy Error

The proxy server received an invalid response from an upstream server.
The proxy server could not handle the request GET /content/content.pl.

Reason: Error reading from remote server

Apache/2.0.47 (Unix) mod_ssl/2.0.47 OpenSSL/0.9.6b Server at www.foo.bar 
Port 80

(relax about the openssl version, it's patched :) )

A reload then sees the correct page loaded - it's happening maybe
every 20 or 30 connections?

I did a google search for the error string and found some references
to some bugs in 2.0.32, and a config issue for enhydra, but they both
seemed unrelated to this issue.  Could this be a problem with the
backend server misbehaving moreso than the proxy?  One reason we're
moving to 2.0 is for some of the better granularity with
control of mod_proxy (timeouts and such) as we sometimes see
erratic behaviour (load induced, we suspect) and a number of
proxy errors connecting to the backend server.



my apache2 is compiled with :

  $ ./configure --enable-deflate --enable-proxy --enable-proxy-connect 
--enable-proxy-http --enable-ssl --enable-rewrite --enable-cache 
--enable-mem-cache

and is configured as follows for the virtual host in question :

     RewriteEngine     on
     RewriteLogLevel     0
     # RewriteLogLevel   1
     # RewriteLog /tmp/a2_rewrite.log
     RewriteRule       ^/errorreporting - [last]

     # Skip info still on old (non-mod_perl) Admin system
     RewriteCond       %{REQUEST_URI} !^/admin/admin2
     RewriteRule       ^/(.*\.pl)$  http://www.foo.bar:10080/$1   [P,L]
#    RewriteRule       ^/index.html(.*)$ 
http://www.foo.bar:10080/index.pl$1   [P,L]
     RewriteRule       ^/S.{16}/(.*)$  /$1
     #NoCache           *
     CacheDisable        /
     ProxyPassReverse  /  http://www.foo.bar:10080/




Has anyone seen this before and knows what I'm doing wrong?  Is
there any more info I need to provide in this question?

thanks

Carl

-- 
=======================
Vivitec Pty. Ltd.
Suite 6, 51-55 City Rd.
Southbank, 3006.
Ph. +61 3 8626 5626
Fax +61 3 9682 1000
=======================


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] apache 2.0.47 mod_proxy : proxy: error reading status line from remote server

Posted by Joe Orton <jo...@redhat.com>.
On Mon, Oct 20, 2003 at 11:44:36AM +1000, Carl Brewer wrote:
> I'm answering my own question after groveling through the
> source to mod_proxy.c, can anyone confirm if I'm on
> the right track please?

Yes, mod_proxy in 2.0 does not handle any of the edge cases in
persistent connection support which you need to avoid this kind of
error when a persistent connection times out.  I'm not sure if there 
is a bugzilla entry on this already, can you file one?

Regards,

joe

---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org


Re: [users@httpd] apache 2.0.47 mod_proxy : proxy: error reading status line from remote server

Posted by Carl Brewer <ca...@vivitec.com.au>.
I'm answering my own question after groveling through the
source to mod_proxy.c, can anyone confirm if I'm on
the right track please?


Carl Brewer wrote:

> 
> Hello
> 
> I'm in the process of moving a large web hosting site from
> apache 1.3 to 2.0, and we use a lot of reverse proxying.
> 
> Our backend server's running mod_perl and other goodies, and
> is 1.3.x, OS is RedHat linux 7.3 on i386.  The proxy
> server and the backend server are running on the same box.
> 
> I'm seeing some interesting behaviour with mod_proxy on 2.0.47
> connecting to the backend server.  I don't see this with
> our 1.3.x mod_proxy server.
> 
> Occasionally attempts to connect to the backend server give me
> an error I can't work out.
> 
> I see this in the error logs :
> 
> [Wed Oct 15 12:32:40 2003] [error] [client xx.xx.xx.xx] proxy: error 
> reading status line from remote server www.foo.bar
> [Wed Oct 15 12:32:40 2003] [error] [client xx.xx.xx.xx] proxy: Error 
> reading from remote server returned by /content/content.pl

This is coming from proxy_http.c, line 730 -
     while (received_continue) {
         apr_brigade_cleanup(bb);

         len = ap_getline(buffer, sizeof(buffer), rp, 0);
         if (len == 0) {
             /* handle one potential stray CRLF */
             len = ap_getline(buffer, sizeof(buffer), rp, 0);
         }
         if (len <= 0) {
             apr_socket_close(p_conn->sock);
             backend->connection = NULL;
             ap_log_rerror(APLOG_MARK, APLOG_ERR, 0, r,
                           "proxy: error reading status line from remote "
                           "server %s", p_conn->name);
             return ap_proxyerror(r, HTTP_BAD_GATEWAY,
                                  "Error reading from remote server");
         }



So I think this is just telling me that the back end server returned
an error of some form, maybe connection refused?  It's taking some
time to find where ap_getline() is defined to find out what
it's returning, any suggestions for where to look?

Has anyone thought of having mod_proxy have a "retry' option for
failed connections?  Something like :

proxy_retry_interval = 5
proxy_retry_attempts = 5

or something? :)

Carl

-- 
=======================
Vivitec Pty. Ltd.
Suite 6, 51-55 City Rd.
Southbank, 3006.
Ph. +61 3 8626 5626
Fax +61 3 9682 1000
=======================


---------------------------------------------------------------------
The official User-To-User support forum of the Apache HTTP Server Project.
See <URL:http://httpd.apache.org/userslist.html> for more info.
To unsubscribe, e-mail: users-unsubscribe@httpd.apache.org
   "   from the digest: users-digest-unsubscribe@httpd.apache.org
For additional commands, e-mail: users-help@httpd.apache.org