urllib2.py:527:http_error_default:HTTPError: HTTP Error 503: Service Unavailable

Bug #1041856 reported by Jan Klepek
8
This bug affects 1 person
Affects Status Importance Assigned to Milestone
SubDownloader
Status tracked in Trunk
Trunk
Fix Committed
Undecided
Alessandro Losavio

Bug Description

How to reproduce:
1] turn off/overload opensubtitles.org (or put entry in hosts file to translate opensubtitles to 127.0.0.1)
2] search for a movie
3] get error

expected behavior:
search is not working or return error that opensubtitles server is not available

backtrace:
:urllib2.py:527:http_error_default:HTTPError: HTTP Error 503: Service Unavailable
:
:Traceback (most recent call last):
: File "/usr/lib/python2.7/site-packages/subdownloader/gui/main.py", line 1517, in onButtonSearchByTitle
: movies = s.search_movie(search_text,'all')
: File "/usr/lib/python2.7/site-packages/subdownloader/modules/search.py", line 52, in search_movie
: xml_page = urllib2.urlopen(xml_url)
: File "/usr/lib64/python2.7/urllib2.py", line 126, in urlopen
: return _opener.open(url, data, timeout)
: File "/usr/lib64/python2.7/urllib2.py", line 406, in open
: response = meth(req, response)
: File "/usr/lib64/python2.7/urllib2.py", line 519, in http_response
: 'http', request, response, code, msg, hdrs)
: File "/usr/lib64/python2.7/urllib2.py", line 444, in error
: return self._call_chain(*args)
: File "/usr/lib64/python2.7/urllib2.py", line 378, in _call_chain
: result = func(*args)
: File "/usr/lib64/python2.7/urllib2.py", line 527, in http_error_default
: raise HTTPError(req.get_full_url(), code, msg, hdrs, fp)
:HTTPError: HTTP Error 503: Service Unavailable
:
:Local variables in innermost frame:
:fp: <addinfourl at 20537072 whose fp = <socket._fileobject object at 0x1390f50>>
:code: 503
:hdrs: <httplib.HTTPMessage instance at 0x1395e60>
:self: <urllib2.HTTPDefaultErrorHandler instance at 0x138c8c0>
:req: <urllib2.Request instance at 0x1395ea8>
:msg: 'Service Unavailable'

Revision history for this message
Alessandro Losavio (alo21) wrote :

What do you mean with: 'turn off/overload opensubtitles.org (or put entry in hosts file to translate' ?

This bug is not very clear. If you 'turn off/overload opensubtitles.org', then it should give you 'error 503'. looking at the log, seems to be all OK Could you be more clear please.

Revision history for this message
Jan Klepek (jan-klepek-gmail) wrote :

error 503 is not visible to user (or any other error indicating that opensubtitles is overloaded or down) and any error is just 'dumped' as backtrace because urlopen is not properly handled (there is no try/expect block to handle URL/HTTP errors)

Revision history for this message
Alessandro Losavio (alo21) wrote :

I cannot still reproduce the bug. I really did not understand what the first step mean.
Could you split the first step into more steps, please

Revision history for this message
Jan Klepek (jan-klepek-gmail) wrote :

if you insert into /etc/hosts following line to simulate downtime on opensubtitles:
127.0.0.1 www.opensubtitles.org opensubtitles.org

then when you run subdownloader and try to search for some movie, you get nasty backtrace (in background, not visible to user) without user knowing that something is wrong with opensubtitles server.

Changed in subdownloader:
status: New → Triaged
Changed in subdownloader:
status: Triaged → In Progress
assignee: nobody → Alessandro Losavio (alo21)
Changed in subdownloader:
milestone: none → 2.0.16
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.