Couchpotato fails to send nzb to SabNZBd when nzb is coming from Spotweb #1134

Closed
mishie opened this Issue Dec 13, 2012 · 19 comments

9 participants

@mishie

Since nzbmatrix has closed, i switched to spotweb. Couchpotato is having difficulties pushing the nzb files to SabNZB.

INFO [hpotato.core.plugins.base] Opening url: http://10.20.30.248/api?t=get&id=tpItqqjcbXAq6aGTgADxa@spot.net&apikey=xxx
INFO [.core.downloaders.sabnzbd] Sending "The Art of Flight (2011) 720p.Bluray.x264-MOMENTUM" to SABnzbd.
INFO [hpotato.core.plugins.base] Opening multipart url: http://10.20.30.248:8080/api?nzbname=The+Art+of+Flight+%282011%29+720p.Bluray.x264-MOMENTUM.cp%28tt1907668%29&apikey=xxx&mode=addfile&cat=movies, params: ['nzbfile']
ERROR [.core.downloaders.sabnzbd] Failed sending release, use API key, NOT the NZB key: Traceback (most recent call last):
UnicodeDecodeError: 'ascii' codec can't decode byte 0xa3 in position 12: ordinal not in range(128)

INFO [ato.core.plugins.searcher] Tried to download, but none of the downloaders are enabled

The API key is correct, so I think it's an encoding issue. I can give you access to my spotweb if you'd like. Send me an email.

@clinton-hall

In settings, general, enable debug and development then restart and try downloading.

The log entries now show the full URL passed (with the full api key). Check that the key is definitely correct and not being modified somewhere.

@mishie

Just checked, API keys are ok!

@blueacid

I've got the same issue. The API keys seem to be fine as far as searching is concerned; CP can search my Spotweb provider. However, it seems that upon trying to download an NZB it fails to retrieve it from Spotweb. It looks like the API key is not being passed correctly, instead it passes 'xxx'. If I open the URL in my browser and change 'xxx' for my Spotweb API key, the NZB file is returned.

12-15 13:32:19 INFO [hpotato.core.plugins.base] Opening url: http://192.168.34.20:22220/spotweb/api?t=get&id=JLxA1yAINEgsKFYUAAAba@spot.net&apikey=xxx
12-15 13:32:19 ERROR [ couchpotato.core.event] Error in event "searcher.single", that wasn't caught: Traceback (most recent call last):
File "/array/blueacid/Documents/bin/couchpotato/couchpotato/core/event.py", line 12, in runHandler
return handler(args, *kwargs)
File "/array/blueacid/Documents/bin/couchpotato/couchpotato/core/plugins/searcher/main.py", line 219, in single
downloaded = self.download(data = nzb, movie = movie)
File "/array/blueacid/Documents/bin/couchpotato/couchpotato/core/plugins/searcher/main.py", line 245, in download
filedata = data.get('download')(url = data.get('url'), nzb_id = data.get('id'))
File "/array/blueacid/Documents/bin/couchpotato/couchpotato/core/providers/nzb/newznab/main.py", line 209, in download
data = self.urlopen(url, show_error = False)
File "/array/blueacid/Documents/bin/couchpotato/couchpotato/core/plugins/base.py", line 145, in urlopen
response = urllib2.urlopen(request, timeout = timeout)
File "/usr/lib/python2.6/urllib2.py", line 126, in urlopen
return _opener.open(url, data, timeout)
File "/usr/lib/python2.6/urllib2.py", line 397, in open
response = meth(req, response)
File "/usr/lib/python2.6/urllib2.py", line 510, in http_response
'http', request, response, code, msg, hdrs)
File "/usr/lib/python2.6/urllib2.py", line 429, in error
result = self._call_chain(args)
File "/usr/lib/python2.6/urllib2.py", line 369, in _call_chain
result = func(
args)
File "/usr/lib/python2.6/urllib2.py", line 605, in http_error_302
return self.parent.open(new, timeout=req.timeout)
File "/usr/lib/python2.6/urllib2.py", line 391, in open
response = self._open(req, data)
File "/usr/lib/python2.6/urllib2.py", line 409, in _open
'_open', req)
File "/usr/lib/python2.6/urllib2.py", line 369, in _call_chain
result = func(*args)
File "/usr/lib/python2.6/urllib2.py", line 1170, in http_open
return self.do_open(httplib.HTTPConnection, req)
File "/usr/lib/python2.6/urllib2.py", line 1145, in do_open
raise URLError(err)
URLError:
encoding=UTF-8 debug=True args=[] app_dir=/array/blueacid/Documents/bin/couchpotato data_dir=/home/blueacid/.couchpotato desktop=None options=Namespace(config_file='/home/blueacid/.couchpotato/settings.conf', console_log=False, daemon=False, data_dir=None, debug=False, pid_file='/home/blueacid/.couchpotato/couchpotato.pid', quiet=False)

@clinton-hall

ok... XXX is done in the logger for your own privacy when posting logs.

To see what is actually being passed, in settings, general, enable both debug and development options. then restart and try a search...

The logs will now show the actual url... check the api keys carefully, and don't post the full logs here ;)

@blueacid

My log was taken with both of those already enabled.. Could this perhaps be the root cause? If you want I could grab the access logs from Apache to be completely sure?

@thufke

If i copy paste the url with the api, it downloads the NZB.... Strange, this is what it tries:

[hpotato.core.plugins.base] Opening url: http://pierbb.webhop.org:55/spotweb/api?t=get&id=C7qIfp5lir4wLXIUAAatQ@spot.net&apikey=xxx, params: []

I changed the api-key for obvious reasons ;)

Then i get this error (big one)

[ couchpotato.core.event]
Error in event "searcher.single", that wasn't caught: Traceback (most recent call last):
File "/volume1/@appstore/couchpotatoserver/share/CouchPotatoServer/couchpotato/core/event.py", line 12, in runHandler return handler(args, *kwargs)
File "/volume1/@appstore/couchpotatoserver/share/CouchPotatoServer/couchpotato/core/plugins/searcher/main.py", line 219, in single downloaded = self.download(data = nzb, movie = movie)
File "/volume1/@appstore/couchpotatoserver/share/CouchPotatoServer/couchpotato/core/plugins/searcher/main.py", line 245, in download filedata = data.get('download')(url = data.get('url'), nzb_id = data.get('id'))
File "/volume1/@appstore/couchpotatoserver/share/CouchPotatoServer/couchpotato/core/providers/nzb/newznab/main.py", line 209, in download data = self.urlopen(url, show_error = False)
File "/volume1/@appstore/couchpotatoserver/share/CouchPotatoServer/couchpotato/core/plugins/base.py", line 145, in urlopen response = urllib2.urlopen(request, timeout = timeout)
File "/usr/local/python/lib/python2.7/urllib2.py", line 126, in urlopen return _opener.open(url, data, timeout) File "/usr/local/python/lib/python2.7/urllib2.py", line 406, in open response = meth(req, response)
File "/usr/local/python/lib/python2.7/urllib2.py", line 519, in http_response 'http', request, response, code, msg, hdrs)
File "/usr/local/python/lib/python2.7/urllib2.py", line 438, in error result = self._call_chain(args) File "/usr/local/python/lib/python2.7/urllib2.py", line 378, in _call_chain result = func(args)
File "/usr/local/python/lib/python2.7/urllib2.py", line 625, in http_error_302 return self.parent.open(new, timeout=req.timeout)
File "/usr/local/python/lib/python2.7/urllib2.py", line 400, in open response = self._open(req, data) File "/usr/local/python/lib/python2.7/urllib2.py", line 418, in _open '_open', req)
File "/usr/local/python/lib/python2.7/urllib2.py", line 378, in _call_chain result = func(*args)
File "/usr/local/python/lib/python2.7/urllib2.py", line 1207, in http_open return self.do_open(httplib.HTTPConnection, req)
File "/usr/local/python/lib/python2.7/urllib2.py", line 1177, in do_open raise URLError(err)
URLError:
encoding=UTF-8 debug=True args=['--daemon', '--pid_file', '/usr/local/couchpotatoserver/var/couchpotatoserver.pid', '--config_file', '/usr/local/couchpotatoserver/var/settings.conf'] app_dir=/usr/local/couchpotatoserver/share/CouchPotatoServer data_dir=/usr/local/couchpotatoserver/var/ desktop=None options=Namespace(config_file='/usr/local/couchpotatoserver/var/settings.conf', console_log=False, daemon=True, data_dir=None, debug=False, pid_file='/usr/local/couchpotatoserver/var/couchpotatoserver.pid', quiet=False)

@smeetst

I have the same error: (So it isn't a single case and hopefully you can fix it)

12-16 15:25:15 INFO �[0m[hpotato.core.plugins.base] Opening url: http://localhost:5050/api?t=get&id=npPIMVzewH49u1UTgAIGu@spot.net&apikey=7ed7643c31c5f34532ec1797df70b3d3, params: []�[0m
12-16 15:25:17 ERROR �[31m[ couchpotato.core.event] Error in event "searcher.download", that wasn't caught: Traceback (most recent call last):
File "C:\CouchPotato\couchpotato\core\event.py", line 12, in runHandler
return handler(args, *kwargs)
File "C:\CouchPotato\couchpotato\core\plugins\searcher\main.py", line 245, in download
filedata = data.get('download')(url = data.get('url'), nzb_id = data.get('id'))
File "C:\CouchPotato\couchpotato\core\providers\nzb\newznab\main.py", line 209, in download
data = self.urlopen(url, show_error = False)
File "C:\CouchPotato\couchpotato\core\plugins\base.py", line 145, in urlopen
response = urllib2.urlopen(request, timeout = timeout)
File "C:\Python27\lib\urllib2.py", line 126, in urlopen
return _opener.open(url, data, timeout)
File "C:\Python27\lib\urllib2.py", line 406, in open
response = meth(req, response)
File "C:\Python27\lib\urllib2.py", line 519, in http_response
'http', request, response, code, msg, hdrs)
File "C:\Python27\lib\urllib2.py", line 438, in error
result = self._call_chain(args)
File "C:\Python27\lib\urllib2.py", line 378, in _call_chain
result = func(
args)
File "C:\Python27\lib\urllib2.py", line 625, in http_error_302
return self.parent.open(new, timeout=req.timeout)
File "C:\Python27\lib\urllib2.py", line 400, in open
response = self._open(req, data)
File "C:\Python27\lib\urllib2.py", line 418, in _open
'_open', req)
File "C:\Python27\lib\urllib2.py", line 378, in _call_chain
result = func(*args)
File "C:\Python27\lib\urllib2.py", line 1207, in http_open
return self.do_open(httplib.HTTPConnection, req)
File "C:\Python27\lib\urllib2.py", line 1177, in do_open
raise URLError(err)
URLError:
encoding=cp1252 debug=True args=[] app_dir=C:\CouchPotato data_dir=C:\Users\Administrator\AppData\Roaming\CouchPotato desktop=None options=Namespace(config_file='C:\Users\Administrator\AppData\Roaming\CouchPotato\settings.conf', console_log=False, daemon=False, data_dir=None, debug=False, pid_file='C:\Users\Administrator\AppData\Roaming\CouchPotato\couchpotato.pid', quiet=False) �[0m

@Begall

I was getting this error, but it fixed itself. I tried overwriting one of the named newznab providers with my Spotweb info, but I'm not certain that was the key.

However, the next problem is that nzb's snatched by CP off Spotweb do not show up in Sab. In the log it's sent, with debug turned on in CP you get 'Result text from SAB: ok' but it doesn't appear in the queue.

In the sab log this entry appears:
2012-12-16 18:01:20,989::INFO::[init:606] Adding The Lord Of The Rings The Return of the King 2003 NTSC 720p AC3 DTS-BITBURGER.cp(tt0167260).rar

But nothing before or after. If you take the URL CP is getting from Spotweb and put it into Sab directly, it works fine.

@Leander2403

I also have this issue. I think adding the nzb to sabnzbd is not the issue, but that couchpotato is not able to retrieve the nzb form spotweb.

  • opening the api link directly and replacing xxx with the api key works. spotweb returs the proper nzb wich i can than manually add to sab.
  • tried setting couchpotato to download the nzb to a blackhole. This gives the same result, no nzb is retrieved from spotweb.
  • I am using the same spotweb installation for sickbeard. This is working without any issues. More than once checked the settings and api keys etc. I dont think settings are the issue.
  • tried multiple movies, all with the same result.
  • both couchpotato (windos installer) and spotweb (manual iis/php/mysql installation) are on a windows server host.

here is the red part of the log, replaced the hostname:

12-17 03:37:29 INFO [hpotato.core.plugins.base] Opening url: http://hostname:8070/api?t=get&id=WlzjvgyT3vsZsWkUAAeWL@spot.net&apikey=xxx

12-17 03:37:30 ERROR Failed encoding stuff to log: Traceback (most recent call last): File "E:\CouchPotatoV2\appdata\CouchPotato-2.0.1.1.win32\couchpotato\core\logger.py", line 47, in safeMessage TypeError: not all arguments converted during string formatting

12-17 03:37:30 ERROR [ore.providers.nzb.newznab] Failed download from %s

12-17 03:37:30 ERROR [ato.core.plugins.searcher] Search failed for tt1345836: Traceback (most recent call last): File "E:\CouchPotatoV2\appdata\CouchPotato-2.0.1.1.win32\couchpotato\core\plugins\searcher\main.py", line 100, in allMovies File "E:\CouchPotatoV2\appdata\CouchPotato-2.0.1.1.win32\couchpotato\core\plugins\searcher\main.py", line 215, in single File "E:\CouchPotatoV2\appdata\CouchPotato-2.0.1.1.win32\couchpotato\core\plugins\searcher\main.py", line 241, in download File "E:\CouchPotatoV2\appdata\CouchPotato-2.0.1.1.win32\couchpotato\core\providers\nzb\newznab\main.py", line 208, in download File "E:\CouchPotatoV2\appdata\CouchPotato-2.0.1.1.win32\couchpotato\core\plugins\base.py", line 142, in urlopen File "urllib2.pyc", line 126, in urlopen File "urllib2.pyc", line 400, in open File "urllib2.pyc", line 513, in http_response File "urllib2.pyc", line 432, in error File "urllib2.pyc", line 372, in _call_chain File "urllib2.pyc", line 619, in http_error_302 File "urllib2.pyc", line 400, in open File "urllib2.pyc", line 513, in http_response File "urllib2.pyc", line 438, in error File "urllib2.pyc", line 372, in _call_chain File "urllib2.pyc", line 521, in http_error_default HTTPError: HTTP Error 404: Not Found.

Please let me know if you need any more information!

@smeetst

I have a fix. Somehow the handler from urllib2 isn't in the correct format. I didn't make the time to check what was wrong with it. I removed headers from the code and it worked with the default header from python.

Change the following file if you want a quick fix:
File "...\couchpotato\core\plugins\base.py", line 140
LINE: request = urllib2.Request(url, data, headers)
Convert into: request = urllib2.Request(url, data)

This way the default will be used!

I have a windows machine and use firefox, and run from latest source (18-12)

@Leander2403

I can confirm replacing the line has fixed the issue for me. Thanks!

@smeetst

in some occasions, i do not now which ones, there is a request to the couchpotato api on wan.
His api needs the headers file, so i added this code to bypass it.
It is not a real solution but it works for me...

So previous line, from mu previous comment, request = urllib2.Request(url, data, headers) replaced by this:

            if url.find('couchpota') <> -1:
                request = urllib2.Request(url, data, headers)
            else:
                request = urllib2.Request(url, data)
@avdstelt

mmm changed it but still getting the error where this post started with.

[.core.downloaders.sabnzbd] Failed sending release, use API key, NOT the NZB key: Traceback (most recent call last): UnicodeDecodeError: 'ascii' codec can't decode byte 0xae in position 12: ordinal not in range(128)

@mishie

same here.. ran the first fix smeetst gave us, but it didn't fix it :(

@RuudBurger
CouchPotato member

I'm looking into this now.
Has spotweb always returned a zip instead of a nzb file?

@mishie
@RuudBurger
CouchPotato member

Ok it was a user setting.. got it fixed I think.
Just need to check some other code as I changed the file handling.

@avdstelt

Ah found it you can change the nzb handeling with multiple nzb files there are two options merge nzb files and compress them to one zip file changed my settings to merge nzb files and it works.

@RuudBurger
CouchPotato member

Ok it was indeed just that setting. And here I was creating a hole new uploader that could upload the zip.
The problem with SABNZBd is when uploading a zip it will use the NZB name within the zip, which removed the ".cp(tt1231231)" tag.

I'm closing this as the setting should be enough.

@RuudBurger RuudBurger closed this Dec 18, 2012
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment