Page 1 of 1

HTTP 408 with apache mod_proxy setup

Posted: December 30th, 2009, 7:27 pm
by nunofgs
Ever since I switched to the beta version I have a problem with sabnzbd + apache proxy redirect + mod_proxy.

Since I want one place to access all my webservices, I set up my apache server with mod_proxy as advised on the wiki.

Here's my apache config:

Code: Select all

<Location /sabnzbd>
	order deny,allow
	deny from all
	allow from all
	
	ProxyPass http://localhost:8123/sabnzbd
	ProxyPassReverse http://localhost:8123/sabnzbd
</Location>
This has worked fine until the day I upgraded to the beta version. Now I have intermittent loading issues.
When I try to navigate to http://server/sabnzbd, it will simply show a blank page. Viewing the html source shows an empty file (literally, 0 characters).
If I refresh 5 or 6 times, it will finally work, but only for about 20 seconds. Then I'll have to refresh multiple times again.

I checked my apache access logs and I can see that apache gives out an error HTTP 408 for each of these failed page loads.

HTTP 408 is Request Timeout.

From my google searches, the only thing I could find related to mod_proxy and http 408 is a project called CherryPy which describes exactly the problem I am having. Here is a link to the relevant ticket in their bugtracker: link.

Can anyone help me with this?

Version: 0.5.0 beta 4
OS: Ubuntu Karmic
Install-type: custom ubuntu ppa repo
Skin: Just switched to Plush (problem exists on default skin, if it helps)
Firewall Software: None
Are you using IPV6? no
Is the issue reproducible? god yes

Re: HTTP 408 with apache mod_proxy setup

Posted: December 31st, 2009, 5:42 am
by shypike
It's caused by the CherryPy webserver we use.
We are using an unofficial release of it.
Their official 3.1.0 doesn't do what we need.
Their 3.2.0RC1 is (again) incompatible with 3.1.0 and the
one we are using now.
For 0.5.0 we don;t want to take the risk of upgrading to 3.2.0RC1.
We are aware that using the current CherryPy causes
the problems you mention.
Not a nice dilemma.
When we sort out the problems during development of 0.6.0,
we'll probably release an 0.5.1 to solve it.

Re: HTTP 408 with apache mod_proxy setup

Posted: January 1st, 2010, 4:55 pm
by auslander
I changed line 1047 of ./SABnzbd.py to the following:

Code: Select all

                            'tools.gzip.on' : False,
And it fixed my problem with SABnzbd+ & mod_proxy.

It looks like it might be gzip compression causing the issue.  If that's the case, i don't see much of an issue with turning page compression off in a mod-proxy environment, since the page will just be re-compressed by apache on the way out the the browser.

Re: HTTP 408 with apache mod_proxy setup

Posted: January 1st, 2010, 7:12 pm
by nunofgs
auslander wrote: I changed line 1047 of ./SABnzbd.py to the following:

Code: Select all

                            'tools.gzip.on' : False,
And it fixed my problem with SABnzbd+ & mod_proxy.

It looks like it might be gzip compression causing the issue.  If that's the case, i don't see much of an issue with turning page compression off in a mod-proxy environment, since the page will just be re-compressed by apache on the way out the the browser.
It worked! AWESOME. It'll do until the problem is fixed. Thanks!

EDIT: I take that back. It doesn't work, but it does seem to help. The problem occurs less frequently but is definitely still there.

Re: HTTP 408 with apache mod_proxy setup

Posted: January 2nd, 2010, 11:11 am
by shypike
I have patched one cherrypy file with the solution discussed in the CherryPy defect tracker.
Would you like to test this?
Just overwrite this cherrypy file in SABnzbd's sub folder: cherrypy/wsgiserver/__init__.py

Re: HTTP 408 with apache mod_proxy setup

Posted: January 2nd, 2010, 10:08 pm
by nunofgs
FINALLY. It worked! It really worked this time. Been testing a lot and it has not failed a single time. You are a god.

Re: HTTP 408 with apache mod_proxy setup

Posted: January 3rd, 2010, 3:14 pm
by shypike
Good to hear that (that it works, I mean).
This patch will be added to the next Beta.

Thanks for your testing and perseverance.

Re: HTTP 408 with apache mod_proxy setup

Posted: January 6th, 2010, 5:35 am
by ganralf
WOOT!

I have been having this problem for months now, glad to see it is not just me :D

Unfortunately I run the windows version so I cannot patch my own files... bloody noob...

Anyway, looking forward to the next release.

P.S. Happy New Year all!

Re: HTTP 408 with apache mod_proxy setup

Posted: January 11th, 2010, 8:03 am
by ganralf
I have been using beta6 for two days now, not a single proxy error. (Used to get an error about once every 3rd request or so)

Thanks guys :D