I am running SABnzbd v0.7.3 on OS X 10.7.5.
SABnzbd is hitting 100% cpu usage and then crashes with a segmentation fault when an api call is made with mode=history. (See test urls below.) This is directly related to the amount of download history. I have (had) a significant amount of history. If I had to guess, I'd say well over 500 downloads between failed and completed. If limits are placed on the api call then it returns successfully up to "some sweet number". I tried with limits of 2, 10, 15, 20, 50 and 200. 0-50 worked fine, but 200 crashed. I did not try anything in between those limits. Once I purged my completed download history, I no longer faced the crashing problem regardless of limiting the resultset. This also means I cannot recreate the problem again. (Without restoring from backup...)
I tested with both output=json and output=xml. XML output spiked the CPU and caused SABnzbd to hang, but did not end in a segmentation fault. I had to kill the process.
Test URLs:
Code: Select all
http://localhost:8080/api?output=json&apikey=MyApiKey&mode=queue
http://localhost:8080/api?output=json&apikey=MyApiKey&mode=history
http://localhost:8080/api?output=json&apikey=MyApiKey&mode=history&start=0&limit=2
http://localhost:8080/api?output=xml&apikey=MyApiKey&mode=queue
http://localhost:8080/api?output=xml&apikey=MyApiKey&mode=history
http://localhost:8080/api?output=xml&apikey=MyApiKey&mode=history&start=0&limit=2
Sample SABnzbd Console :
Code: Select all
DEBUG:root:API-call from ::1 {'output': 'json', 'apikey': '&myapikey', 'mode': 'queue'}
INFO:cherrypy.access.4479998864:::1 - - [21/Sep/2012:00:36:14] "GET /api?output=json&apikey=&myapikey&mode=queue HTTP/1.1" 200 1219 "localhost" "Mozilla/5.0 (Macintosh; Intel Mac OS X 10.7; rv:10.0.2) Gecko/20100101 Firefox/10.0.2"
DEBUG:root:API-call from ::1 {'output': 'json', 'apikey': '&myapikey', 'mode': 'history'}
Segmentation fault: 11
Code: Select all
2012-09-21 00:36:14,759::DEBUG::[interface:400] API-call from ::1 {'output': 'json', 'apikey': '&myapikey', 'mode': 'queue'}
2012-09-21 00:36:14,769::DEBUG::[interface:400] API-call from ::1 {'output': 'json', 'apikey': '&myapikey', 'mode': 'history'}
Code: Select all
09-21 00:36:14 INFO [0m[.core.downloaders.sabnzbd] Checking download status of "Foobar 1" at SABnzbd.[0m
09-21 00:36:14 INFO [0m[hpotato.core.plugins.base] Opening url: http://localhost:8080/api?output=json&apikey=xxx&mode=queue, params: [][0m
09-21 00:36:14 INFO [0m[hpotato.core.plugins.base] Opening url: http://localhost:8080/api?output=json&apikey=xxx&mode=history, params: [][0m
09-21 00:36:41 ERROR [31m[.core.downloaders.sabnzbd] Failed getting history: Traceback (most recent call last):
File "/Applications/CouchPotatoServer/couchpotato/core/downloaders/sabnzbd/main.py", line 108, in getDownloadStatus
sab = self.urlopen(url, timeout = 60, show_error = False)
File "/Applications/CouchPotatoServer/couchpotato/core/plugins/base.py", line 141, in urlopen
response = urllib2.urlopen(request, timeout = timeout)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 126, in urlopen
return _opener.open(url, data, timeout)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 394, in open
response = self._open(req, data)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 412, in _open
'_open', req)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 372, in _call_chain
result = func(*args)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 1199, in http_open
return self.do_open(httplib.HTTPConnection, req)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 1170, in do_open
r = h.getresponse(buffering=True)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 1013, in getresponse
response.begin()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 402, in begin
version, status, reason = self._read_status()
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/httplib.py", line 366, in _read_status
raise BadStatusLine(line)
BadStatusLine: ''
[0m
09-21 00:36:41 INFO [0m[.core.downloaders.sabnzbd] Checking download status of "Foobar 2" at SABnzbd.[0m
09-21 00:36:41 INFO [0m[hpotato.core.plugins.base] Opening url: http://localhost:8080/api?output=json&apikey=xxx&mode=queue, params: [][0m
09-21 00:36:41 ERROR [31m[.core.downloaders.sabnzbd] Failed checking status: Traceback (most recent call last):
File "/Applications/CouchPotatoServer/couchpotato/core/downloaders/sabnzbd/main.py", line 82, in getDownloadStatus
sab = self.urlopen(url, timeout = 60, show_error = False)
File "/Applications/CouchPotatoServer/couchpotato/core/plugins/base.py", line 141, in urlopen
response = urllib2.urlopen(request, timeout = timeout)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 126, in urlopen
return _opener.open(url, data, timeout)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 394, in open
response = self._open(req, data)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 412, in _open
'_open', req)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 372, in _call_chain
result = func(*args)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 1199, in http_open
return self.do_open(httplib.HTTPConnection, req)
File "/System/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/urllib2.py", line 1174, in do_open
raise URLError(err)
URLError: <urlopen error [Errno 61] Connection refused>
[0m