crash on execution of EMail.py

Get help, report and discuss bugs.
Post Reply
harrim4n
Posts: 9
Joined: 21 Jul 2013, 01:23

crash on execution of EMail.py

Post by harrim4n » 21 Jul 2013, 01:30

Hello there,
I recently got around to update my NZBGet installtion and tried using the EMail.py, but whenever it is executed nzbget crashes and when I restart nzbget the download is stuck in the queue with the invalid state in postprocessor message.
In the log are a few messages:

Code: Select all

Sun Jul 21 02:54:58 2013	INFO	Queueing XXX for post-processing
Sun Jul 21 02:54:58 2013	INFO	Pausing queue before unpack
Sun Jul 21 02:54:58 2013	INFO	Nothing to unpack for XXX
Sun Jul 21 02:54:58 2013	INFO	Unpausing queue after unpack
Sun Jul 21 02:54:58 2013	INFO	Executing post-process-script EMail.py for XXX
Sun Jul 21 02:55:01 2013	DETAIL	EMail: Script successfully started
Sun Jul 21 02:55:01 2013	INFO	EMail: Traceback (most recent call last):
Sun Jul 21 02:55:01 2013	INFO	EMail:   File "/usr/share/nzbget/ppscripts/EMail.py", line 180, in <module>
Sun Jul 21 02:55:01 2013	INFO	EMail:     postqueue = server.postqueue(10000)
Sun Jul 21 02:55:01 2013	INFO	EMail:   File "/usr/lib/python2.7/xmlrpclib.py", line 1224, in __call__
Sun Jul 21 02:55:01 2013	INFO	EMail:     return self.__send(self.__name, args)
Sun Jul 21 02:55:01 2013	INFO	EMail:   File "/usr/lib/python2.7/xmlrpclib.py", line 1578, in __request
Sun Jul 21 02:55:01 2013	INFO	EMail:     verbose=self.__verbose
Sun Jul 21 02:55:01 2013	INFO	EMail:   File "/usr/lib/python2.7/xmlrpclib.py", line 1264, in request
Sun Jul 21 02:55:01 2013	INFO	EMail:     return self.single_request(host, handler, request_body, verbose)
Sun Jul 21 02:55:01 2013	INFO	EMail:   File "/usr/lib/python2.7/xmlrpclib.py", line 1284, in single_request
Sun Jul 21 02:55:01 2013	INFO	EMail:     h = self.make_connection(host)
Sun Jul 21 02:55:01 2013	INFO	EMail:   File "/usr/lib/python2.7/xmlrpclib.py", line 1370, in make_connection
Sun Jul 21 02:55:01 2013	INFO	EMail:     self._connection = host, httplib.HTTPConnection(chost)
Sun Jul 21 02:55:01 2013	INFO	EMail:   File "/usr/lib/python2.7/httplib.py", line 704, in __init__
Sun Jul 21 02:55:01 2013	INFO	EMail:     self._set_hostport(host, port)
Sun Jul 21 02:55:01 2013	INFO	EMail:   File "/usr/lib/python2.7/httplib.py", line 732, in _set_hostport
I tried reinstalling nzbget and I tried using python3. During the crash the use of RAM suddenly spikes and my DockStar turns irresponsive for a few seconds. It also seems as if there are spawning two new threads of nzbget, I don't know if that is normal.
I use ArchLinux Arm.

Thanks in advance.

harrim4n

hugbug
Developer & Admin
Posts: 7533
Joined: 09 Sep 2008, 11:58
Location: Germany

Re: crash on execution of EMail.py

Post by hugbug » 21 Jul 2013, 12:20

Can you please try the latest testing version from svn?
See Build the latest development version from svn.

I have recently found and fixed a bug which could crash the program if certain characters were printed by pp-script. It's possible that this bug is related to your crahses, if the printed callstack on failure in EMail.py includes such dangerous characters.

This however will not change the failure of EMail.py, but this is another issue. Try to change the line:

Code: Select all

postqueue = server.postqueue(10000)
to

Code: Select all

postqueue = server.postqueue(100)
The parameter 10000 (100) defines how much lines of the pp-log at maximum should be obtained from nzbget to be put into e-mail.

harrim4n
Posts: 9
Joined: 21 Jul 2013, 01:23

Re: crash on execution of EMail.py

Post by harrim4n » 23 Jul 2013, 14:06

Thanks for the reply.
I tried your suggestions, sadly to no avail. The script still crashes, but this time it is a different problem. The error occours during the connection of the script to NZBGet when trying to obtain the log. This is due to some escape error, as my password contains the characters -/* in this order. As you can see in the log for some reason it uses part of the password as the port (?) but the part after the - is missing. Plesase not that I replaced the part of my real password which comes before the -/* with ******, but left the - as it is in he real log.

Code: Select all

Tue Jul 23 15:49:49 2013	INFO	Queueing XXX for post-processing
Tue Jul 23 15:49:49 2013	INFO	Executing post-process-script EMail.py for XXX
Tue Jul 23 15:49:52 2013	DETAIL	EMail: Script successfully started
Tue Jul 23 15:49:53 2013	INFO	EMail: Traceback (most recent call last):
Tue Jul 23 15:49:53 2013	INFO	EMail:   File "/usr/share/nzbget/ppscripts/EMail.py", line 180, in <module>
Tue Jul 23 15:49:53 2013	INFO	EMail:     postqueue = server.postqueue(100)
Tue Jul 23 15:49:53 2013	INFO	EMail:   File "/usr/lib/python2.7/xmlrpclib.py", line 1224, in __call__
Tue Jul 23 15:49:53 2013	INFO	EMail:     return self.__send(self.__name, args)
Tue Jul 23 15:49:53 2013	INFO	EMail:   File "/usr/lib/python2.7/xmlrpclib.py", line 1578, in __request
Tue Jul 23 15:49:53 2013	INFO	EMail:     verbose=self.__verbose
Tue Jul 23 15:49:53 2013	INFO	EMail:   File "/usr/lib/python2.7/xmlrpclib.py", line 1264, in request
Tue Jul 23 15:49:53 2013	INFO	EMail:     return self.single_request(host, handler, request_body, verbose)
Tue Jul 23 15:49:53 2013	INFO	EMail:   File "/usr/lib/python2.7/xmlrpclib.py", line 1284, in single_request
Tue Jul 23 15:49:53 2013	INFO	EMail:     h = self.make_connection(host)
Tue Jul 23 15:49:53 2013	INFO	EMail:   File "/usr/lib/python2.7/xmlrpclib.py", line 1370, in make_connection
Tue Jul 23 15:49:53 2013	INFO	EMail:     self._connection = host, httplib.HTTPConnection(chost)
Tue Jul 23 15:49:53 2013	INFO	EMail:   File "/usr/lib/python2.7/httplib.py", line 704, in __init__
Tue Jul 23 15:49:53 2013	INFO	EMail:     self._set_hostport(host, port)
Tue Jul 23 15:49:53 2013	INFO	EMail:   File "/usr/lib/python2.7/httplib.py", line 732, in _set_hostport
Tue Jul 23 15:49:53 2013	INFO	EMail:     raise InvalidURL("nonnumeric port: '%s'" % host[i+1:])
Tue Jul 23 15:49:53 2013	INFO	EMail: httplib.InvalidURL: nonnumeric port: '******-'
Tue Jul 23 15:49:53 2013	ERROR	Post-process-script EMail.py for XXX failed (terminated with unknown status)
Tue Jul 23 15:49:53 2013	INFO	Collection XXX added to history
EDIT: I totally forgot to mention that nzbget doesn't crash anymore, so that problem was already resolved.

hugbug
Developer & Admin
Posts: 7533
Joined: 09 Sep 2008, 11:58
Location: Germany

Re: crash on execution of EMail.py

Post by hugbug » 23 Jul 2013, 14:51

You've found a bug in the script. When it builds an URL to connect to NZBGet it just ignores the fact that certain characters in the URL must be specially encoded:

Code: Select all

	rpcUrl = 'http://%s:%s@%s:%s/xmlrpc' % (username, password, host, port);
I'll fix this. In the meantime you can use a password without "crashing" characters.

harrim4n
Posts: 9
Joined: 21 Jul 2013, 01:23

Re: crash on execution of EMail.py

Post by harrim4n » 23 Jul 2013, 16:25

Alright. Thanks for the quick help!

Post Reply

Who is online

Users browsing this forum: No registered users and 6 guests