No NZB upload & Couchpotato integration with 0.7.10 and .11

Get help with all aspects of SABnzbd
Forum rules
Help us help you:
  • Are you using the latest stable version of SABnzbd? Downloads page.
  • Tell us what system you run SABnzbd on.
  • Adhere to the forum rules.
  • Do you experience problems during downloading?
    Check your connection in Status and Interface settings window.
    Use Test Server in Config > Servers.
    We will probably ask you to do a test using only basic settings.
  • Do you experience problems during repair or unpacking?
    Enable +Debug logging in the Status and Interface settings window and share the relevant parts of the log here using [ code ] sections.
Post Reply
xenonism
Newbie
Newbie
Posts: 22
Joined: December 17th, 2012, 1:18 pm

No NZB upload & Couchpotato integration with 0.7.10 and .11

Post by xenonism »

Like I said in the subject, after upgrading to 0.7.10 I am unable to manually upload NZB files from the file system and Couchpotato integration doesn't work anymore. 0.7.11 shows the same behaviour, while downgrading to 0.7.9 fixes the issues. I run Linux and I believe I can rule out distro-specific problems.

The NZB upload form hangs infinitely, while the Couchpotato call to the API returns:

Code: Select all

"error: expected one parameter"
with a 200 HTTP status (I replicated it with curl).

In the log, sabnzbd has to say the following:

Code: Select all

2013-02-07 23:57:14,402::INFO::[_cplogging:201] [07/Feb/2013:23:57:14] HTTP 
Request Headers:
  AUTHORIZATION: Basic [omitted]
  REFERER: https://127.0.0.1:10090/
  Remote-Addr: 127.0.0.1
  Content-Length: 28974
  USER-AGENT: Mozilla/5.0 (X11; Linux x86_64; rv:19.0) Gecko/20100101 Firefox/19.0
  CONNECTION: keep-alive
  COOKIE: plushContainerWidth=100%25; plushNoTopMenu=0; wanted_view=list; plushQueuePerPage=9999999; advanced_toggle_checked=1; plushHistPerPage=9999999; plushMultiOps=0
  DNT: 1
  HOST: 127.0.0.1:10090
  ACCEPT: text/html,application/xhtml+xml,application/xml;q=0.9,*/*;q=0.8
  ACCEPT-LANGUAGE: en-US,en;q=0.5
  Content-Type: multipart/form-data; boundary=---------------------------4728197949388888521593965850
  ACCEPT-ENCODING: gzip, deflate
2013-02-07 23:57:14,402::ERROR::[_cplogging:201] [07/Feb/2013:23:57:14] HTTP Traceback (most recent call last):
  File "/usr/lib64/python2.7/site-packages/cherrypy/_cprequest.py", line 649, in respond
    self.body.process()
  File "/usr/lib64/python2.7/site-packages/cherrypy/_cpreqbody.py", line 949, in process
    super(RequestBody, self).process()
  File "/usr/lib64/python2.7/site-packages/cherrypy/_cpreqbody.py", line 515, in process
    proc(self)
  File "/usr/lib64/python2.7/site-packages/cherrypy/_cpreqbody.py", line 214, in process_multipart_form_data
    process_multipart(entity)
  File "/usr/lib64/python2.7/site-packages/cherrypy/_cpreqbody.py", line 208, in process_multipart
    part.process()
  File "/usr/lib64/python2.7/site-packages/cherrypy/_cpreqbody.py", line 513, in process
    self.default_proc()
  File "/usr/lib64/python2.7/site-packages/cherrypy/_cpreqbody.py", line 677, in default_proc
    self.file = self.read_into_file()
  File "/usr/lib64/python2.7/site-packages/cherrypy/_cpreqbody.py", line 689, in read_into_file
    self.read_lines_to_boundary(fp_out=fp_out)
  File "/usr/lib64/python2.7/site-packages/cherrypy/_cpreqbody.py", line 620, in read_lines_to_boundary
    line = self.fp.readline(1<<16)
  File "/usr/lib64/python2.7/site-packages/cherrypy/_cpreqbody.py", line 824, in readline
    data = self.read(chunksize)
  File "/usr/lib64/python2.7/site-packages/cherrypy/_cpreqbody.py", line 788, in read
    data = self.fp.read(chunksize)
  File "/usr/lib64/python2.7/site-packages/cherrypy/wsgiserver/wsgiserver2.py", line 329, in read
    data = self.rfile.read(size)
  File "/usr/lib64/python2.7/site-packages/cherrypy/wsgiserver/wsgiserver2.py", line 1052, in read
    assert n <= left, "recv(%d) returned %d bytes" % (left, n)
AssertionError: recv(15) returned 13282 bytes
I'll be happy to help debugging the issue if given instructions or tests to perform.

Thanks for the attention!
User avatar
sander
Release Testers
Release Testers
Posts: 9062
Joined: January 22nd, 2008, 2:22 pm

Re: No NZB upload & Couchpotato integration with 0.7.10 and

Post by sander »

So, just checking: when you manual upload a NZB using Firefox, it doesn't work in SABnzbd 0.7.10+ ?

Questions:
- does it happen to all NZBs you try to upload? Small, big, etc ...
- what happens when you use Chrome / Chromium?
User avatar
shypike
Administrator
Administrator
Posts: 19774
Joined: January 18th, 2008, 12:49 pm

Re: No NZB upload & Couchpotato integration with 0.7.10 and

Post by shypike »

xenonism wrote:(I replicated it with curl).
Please list your CURL command.
xenonism
Newbie
Newbie
Posts: 22
Joined: December 17th, 2012, 1:18 pm

Re: No NZB upload & Couchpotato integration with 0.7.10 and

Post by xenonism »

sander wrote:So, just checking: when you manual upload a NZB using Firefox, it doesn't work in SABnzbd 0.7.10+ ?
Exactly.
sander wrote: Questions:
- does it happen to all NZBs you try to upload? Small, big, etc ...
- what happens when you use Chrome / Chromium?
Size doesn't seem to matter, most of my attempts were done with very small NZBS anyway (between 10 and 200MB). Chromium shows the exact same behaviour as Firefox.

When I try to upload an NZB, this shows up in the log:

Code: Select all

[08/Feb/2013:14:50:09] HTTP Traceback (most recent call last): File "/usr/lib64/python2.7/site-packages/cherrypy/_cprequest.py", line 649, in respond self.body.process() File "/usr/lib64/python2.7/site-packages/cherrypy/_cpreqbody.py", line 949, in process super(RequestBody, self).process() File "/usr/lib64/python2.7/site-packages/cherrypy/_cpreqbody.py", line 515, in process proc(self) File "/usr/lib64/python2.7/site-packages/cherrypy/_cpreqbody.py", line 214, in process_multipart_form_data process_multipart(entity) File "/usr/lib64/python2.7/site-packages/cherrypy/_cpreqbody.py", line 196, in process_multipart b = entity.readline() File "/usr/lib64/python2.7/site-packages/cherrypy/_cpreqbody.py", line 458, in readline return self.fp.readline(size) File "/usr/lib64/python2.7/site-packages/cherrypy/_cpreqbody.py", line 824, in readline data = self.read(chunksize) File "/usr/lib64/python2.7/site-packages/cherrypy/_cpreqbody.py", line 788, in read data = self.fp.read(chunksize) File "/usr/lib64/python2.7/site-packages/cherrypy/wsgiserver/wsgiserver2.py", line 329, in read data = self.rfile.read(size) File "/usr/lib64/python2.7/site-packages/cherrypy/wsgiserver/wsgiserver2.py", line 1052, in read assert n <= left, "recv(%d) returned %d bytes" % (left, n) AssertionError: recv(8192) returned 16384 bytes 
xenonism
Newbie
Newbie
Posts: 22
Joined: December 17th, 2012, 1:18 pm

Re: No NZB upload & Couchpotato integration with 0.7.10 and

Post by xenonism »

shypike wrote:
xenonism wrote:(I replicated it with curl).
Please list your CURL command.
Here it is. I took the URL straight from the Couchpotato log, adding the correct API key. I omitted the NZB name

Code: Select all

curl -vvvv -k 'https://127.0.0.1:10090/api?nzbname=NZB_NAME_HERE&apikey=XXX&mode=addfile&cat=Movies'
I have to add that when using 0.7.9, Couchpotato manages to send the NZB to sab, but the curl call still fails with the "error: expect one parameter" response, so I'm not sure my curl test are meaningful after all. Is it supposed to be a sort of mixed GET/POST call (better, a POST call with a query string)?
User avatar
shypike
Administrator
Administrator
Posts: 19774
Joined: January 18th, 2008, 12:49 pm

Re: No NZB upload & Couchpotato integration with 0.7.10 and

Post by shypike »

Your curl command is not correct, this one is:

Code: Select all

curl http://localhost:8080/sabnzbd/api -F apikey=APIKEY -F mode=addfile -v -F output=json -F "name=@d:\path\my show.nzb" -F "cat=tv"
I don't what CP does, but it seems to do it wrong.
xenonism
Newbie
Newbie
Posts: 22
Joined: December 17th, 2012, 1:18 pm

Re: No NZB upload & Couchpotato integration with 0.7.10 and

Post by xenonism »

shypike wrote:Your curl command is not correct, this one is:

Code: Select all

curl http://localhost:8080/sabnzbd/api -F apikey=APIKEY -F mode=addfile -v -F output=json -F "name=@d:\path\my show.nzb" -F "cat=tv"
I don't what CP does, but it seems to do it wrong.
Quick reply, since I was in front of the computer. I tried the curl command you gave me (just added -vvvv for verbosity and -k to accept the self-signed SSL certificate). No problem with 0.7.9, NZB queued and downloaded. With 0.7.10, the exact same curl call fails - here's the response:

Code: Select all

> POST /sabnzbd/api HTTP/1.1
> User-Agent: curl/7.29.0
> Host: localhost:10090
> Accept: */*
> Content-Length: 6479
> Expect: 100-continue
> Content-Type: multipart/form-data; boundary=----------------------------09c4eededc51
> 
< HTTP/1.1 100 Continue
< HTTP/1.1 500 Internal Server Error
< Date: Fri, 08 Feb 2013 19:26:17 GMT
< Content-Length: 1635
< Content-Type: text/html;charset=utf-8
< Server: CherryPy/3.2.2
* HTTP error before end of send, stop sending
< 
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN"
"http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=utf-8"></meta>
    <title>500 Internal Server Error</title>
    <style type="text/css">
    #powered_by {
        margin-top: 20px;
        border-top: 2px solid black;
        font-style: italic;
    }

    #traceback {
        color: red;
    }
    </style>
</head>
    <body>
        <h2>500 Internal Server Error</h2>
        <p>The server encountered an unexpected condition which prevented it from fulfilling the request.</p>
        <pre id="traceback">Traceback (most recent call last):
  File "/usr/lib64/python2.7/site-packages/cherrypy/_cprequest.py", line 656, in respond
    response.body = self.handler()
  File "/usr/lib64/python2.7/site-packages/cherrypy/lib/encoding.py", line 188, in __call__
    self.body = self.oldhandler(*args, **kwargs)
  File "/usr/lib64/python2.7/site-packages/cherrypy/_cpdispatch.py", line 34, in __call__
    return self.callable(*self.args, **self.kwargs)
  File "/usr/share/sabnzbd/sabnzbd/interface.py", line 424, in api
    return api_handler(kwargs)
  File "/usr/share/sabnzbd/sabnzbd/api.py", line 100, in api_handler
    response = _api_table.get(mode, _api_undefined)(name, output, kwargs)
  File "/usr/share/sabnzbd/sabnzbd/api.py", line 297, in _api_addfile
    size = len(name.value)
TypeError: object of type 'NoneType' has no len()
</pre>
    <div id="powered_by">
    <span>Powered by <a href="http://www.cherrypy.org">CherryPy 3.2.2</a></span>
    </div>
    </body>
</html>
* Closing connection 0
* SSLv3, TLS alert, Client hello (1):
At this point Couchpotato can be left out, since both the curl call and the manual NZB upload relate to sabnzbd alone. Could it be a CherryPy problem? I noticed that sabnzbd 0.7.9 bundles CherryPy 3.2.0, while 0.7.10 bundles 3.2.2. Please let me know if I can be of more help by performing other tests.
User avatar
shypike
Administrator
Administrator
Posts: 19774
Joined: January 18th, 2008, 12:49 pm

Re: No NZB upload & Couchpotato integration with 0.7.10 and

Post by shypike »

Server: CherryPy/3.2.2

I don't know what you're up to, but you're not using the CherryPy that we distribute with SABnzbd.
Due to its many bugs and lack of compatibility you cannot just use any version.
xenonism
Newbie
Newbie
Posts: 22
Joined: December 17th, 2012, 1:18 pm

Re: No NZB upload & Couchpotato integration with 0.7.10 and

Post by xenonism »

shypike wrote:Server: CherryPy/3.2.2

I don't know what you're up to, but you're not using the CherryPy that we distribute with SABnzbd.
Due to its many bugs and lack of compatibility you cannot just use any version.
I'm not sure I understand what you mean. I'm not up to anything :)
I install sabnzbd through my distro and they do not replace the cherrypy component (I just checked). What version of CherryPy are you bundling and what do you think I am running?
xenonism
Newbie
Newbie
Posts: 22
Joined: December 17th, 2012, 1:18 pm

Re: No NZB upload & Couchpotato integration with 0.7.10 and

Post by xenonism »

All right, I apologize for causing all the fuzz. This is a distro-related issue, not sabnzbd's fault. I'll bring it to the distro bug tracker. Thanks for trying to help anyway.
User avatar
shypike
Administrator
Administrator
Posts: 19774
Joined: January 18th, 2008, 12:49 pm

Re: No NZB upload & Couchpotato integration with 0.7.10 and

Post by shypike »

That we use our own patched version is a point of contention with packagers.
Sadly we have no choice due to CherryPy's issues.
We'd love to use a standard version...
User avatar
sander
Release Testers
Release Testers
Posts: 9062
Joined: January 22nd, 2008, 2:22 pm

Re: No NZB upload & Couchpotato integration with 0.7.10 and

Post by sander »

xenonism wrote:All right, I apologize for causing all the fuzz. This is a distro-related issue, not sabnzbd's fault. I'll bring it to the distro bug tracker. Thanks for trying to help anyway.
Which Linux distro are you using?

If you download the SABnzbd source package, unpack it and run it, it should work. With in the SAB built-in version of Cherrypy. :) That's what I use on my Ubuntu

Can you verify that?
xenonism
Newbie
Newbie
Posts: 22
Joined: December 17th, 2012, 1:18 pm

Re: No NZB upload & Couchpotato integration with 0.7.10 and

Post by xenonism »

shypike wrote:That we use our own patched version is a point of contention with packagers.
Sadly we have no choice due to CherryPy's issues.
We'd love to use a standard version...
Yes, that's the case with Gentoo, my distro. Their general policy is to unbundle as much as possible, and it seems they did a good job with sabnzbd and CherryPy... until version 0.7.10. Anyway, i wrote on the bug tracker to let the package maintainer know about the issue.
xenonism
Newbie
Newbie
Posts: 22
Joined: December 17th, 2012, 1:18 pm

Re: No NZB upload & Couchpotato integration with 0.7.10 and

Post by xenonism »

sander wrote:
xenonism wrote:All right, I apologize for causing all the fuzz. This is a distro-related issue, not sabnzbd's fault. I'll bring it to the distro bug tracker. Thanks for trying to help anyway.
Which Linux distro are you using?

If you download the SABnzbd source package, unpack it and run it, it should work. With in the SAB built-in version of Cherrypy. :) That's what I use on my Ubuntu

Can you verify that?
I use Gentoo, a source-based distro. What I did in the end to make 0.7.10 and 0.7.11 work is to take the package manager install profile (ebuild) from 0.7.9 and manually bump the version, instead of using the updated profile. No side effects for now, waiting for feedback from the package maintainers at the distro. Thanks for the hint, though! :)
Post Reply