machawk1 / wail

:whale2: Web Archiving Integration Layer: One-Click User Instigated Preservation
https://matkelly.com/wail
MIT License
353 stars 35 forks source link

Bad status code in service accessbility checking causes UI to fail #186

Closed machawk1 closed 9 years ago

machawk1 commented 9 years ago

e.g., leaving both the FIX and KILL buttons clickable.

Trying to access Heritrix service at https://127.0.0.1:8443
Failed to access Heritrix service at https://127.0.0.1:8443
Trying to access Wayback service at http://localhost:8080/wayback/
Unhandled exception in thread started by <bound method GeneralPanel.updateServiceStatuses of <__main__.GeneralPanel; proxy of <Swig Object of type 'wxPanel *' at 0x1036d7c70> >>
Traceback (most recent call last):
  File "bundledApps/WAIL.py", line 467, in updateServiceStatuses
    waybackAccessible = serviceEnabled[Wayback().accessible()]
  File "bundledApps/WAIL.py", line 921, in accessible
    handle = urllib2.urlopen(self.uri, None, 3)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 154, in urlopen
    return opener.open(url, data, timeout)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 431, in open
    response = self._open(req, data)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 449, in _open
    '_open', req)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 409, in _call_chain
    result = func(*args)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 1227, in http_open
    return self.do_open(httplib.HTTPConnection, req)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 1200, in do_open
    r = h.getresponse(buffering=True)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 1132, in getresponse
    response.begin()
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 453, in begin
    version, status, reason = self._read_status()
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 417, in _read_status
    raise BadStatusLine(line)
httplib.BadStatusLine: ''
Trying to access Heritrix service at https://127.0.0.1:8443
Failed to access Heritrix service at https://127.0.0.1:8443
Trying to access Wayback service at http://localhost:8080/wayback/
Unhandled exception in thread started by <bound method GeneralPanel.updateServiceStatuses of <__main__.GeneralPanel; proxy of <Swig Object of type 'wxPanel *' at 0x1036d7c70> >>
Traceback (most recent call last):
  File "bundledApps/WAIL.py", line 467, in updateServiceStatuses
    waybackAccessible = serviceEnabled[Wayback().accessible()]
  File "bundledApps/WAIL.py", line 921, in accessible
    handle = urllib2.urlopen(self.uri, None, 3)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 154, in urlopen
    return opener.open(url, data, timeout)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 431, in open
    response = self._open(req, data)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 449, in _open
    '_open', req)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 409, in _call_chain
    result = func(*args)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 1227, in http_open
    return self.do_open(httplib.HTTPConnection, req)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 1200, in do_open
    r = h.getresponse(buffering=True)
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 1132, in getresponse
    response.begin()
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 453, in begin
    version, status, reason = self._read_status()
  File "/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 417, in _read_status
    raise BadStatusLine(line)
httplib.BadStatusLine: ''
machawk1 commented 9 years ago

This looks to be a bug in not having a catchall catch statement in Service().