Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 600404 - =net-nntp/sabnzbd-1.1.1 requires python-2.7 but doesn't enforce it at runtime
Summary: =net-nntp/sabnzbd-1.1.1 requires python-2.7 but doesn't enforce it at runtime
Status: RESOLVED UPSTREAM
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal (vote)
Assignee: Justin Bronder (RETIRED)
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2016-11-21 14:59 UTC by Oleh
Modified: 2016-12-07 15:42 UTC (History)
2 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
sabnzbd.error.log (sabnzbd.error.log,2.69 KB, text/x-log)
2016-11-22 07:06 UTC, Oleh
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Oleh 2016-11-21 14:59:03 UTC
init script unable to start due to PID not  created.

Reproducible: Always

Steps to Reproduce:
1. emerge sabnzbd
2. rc-update add sabnzbd default
3. rc
Actual Results:  
oleg2 # rc
 * Caching service dependencies ...                                                                                               [ ok ]
 * Starting SABnzbd ...
 * start-stop-daemon: did not create a valid pid in `/run/sabnzbd/sabnzbd.pid'                                                    [ !! ]
 * ERROR: sabnzbd failed to start
oleg2 #
Comment 1 Ben Kohler gentoo-dev 2016-11-21 15:30:12 UTC
Looks like this application only works with python-2.7, but its shebang calls "#!/usr/bin/python -OO" so it'll only run if you happen to have python-2.7 set as your system default.

The ebuild should use some python eclass stuff to enforce the 2.7 requirement.
Comment 2 Justin Bronder (RETIRED) gentoo-dev 2016-11-21 16:13:05 UTC

*** This bug has been marked as a duplicate of bug 600356 ***
Comment 3 Oleh 2016-11-21 16:19:55 UTC
i'm sorry but this doesnt look as any duplicate. #600356 indeed is about python2, which is solved. This one is about PID creation failure. Can such duplicate close explained somehow? Also, if #600356 supposed to fix start-up when default python is 3.x, then it's not fixed at all.
Comment 4 Justin Bronder (RETIRED) gentoo-dev 2016-11-21 16:35:12 UTC
Did you sync your tree and try?  Pidfile creation failure is most likely because sabnzbd failed to start due to not calling the correct python via the shebang as Ben pointed out.  This was fixed.  You can verify you have the changes locally with:

$ head -n1 /usr/share/sabnzbd/SABnzbd.py
#!/usr/bin/python2.7 -OO
Comment 5 Oleh 2016-11-21 16:39:01 UTC
oleg2 # head -n1 /usr/share/sabnzbd/SABnzbd.py
#!/usr/bin/python2.7 -OO
Comment 6 Oleh 2016-11-21 16:40:25 UTC
its up-to-date:
https://gitweb.gentoo.org/repo/gentoo.git/log/net-nntp/sabnzbd
Comment 7 Oleh 2016-11-21 17:09:23 UTC
revbump does not change anything:

1. rc-update del sabnzbd default
2. emerge -C sabnzbd
3. rm -rf /run/sabnzbd

4. emerge =sabnzbd-1.1.1-r1
5. rc-update add sabnzbd-1.1.1-r1
6. rc-update add sabnzbd default
7. rc

oleg2 # rc
 * Caching service dependencies ...                                                                                        [ ok ]
 * Starting SABnzbd ...
 * start-stop-daemon: did not create a valid pid in `/run/sabnzbd/sabnzbd.pid'                                             [ !! ]
 * ERROR: sabnzbd failed to start
oleg2 #

oleg2 # ls -l /var/db/pkg/net-nntp/
total 4.0K
drwxr-xr-x 2 root root 4.0K Nov 21 17:05 sabnzbd-1.1.1-r1/
oleg2 #
Comment 8 Ben Kohler gentoo-dev 2016-11-21 17:37:52 UTC
There's a checkpath call in /etc/init.d/sabnzbd which should create /run/sabnzbd/ before the service starts, so your #3 rm step *shouldn't* be causing any problem... what version of openrc do you have?
Comment 9 Sébastien P. 2016-11-21 20:41:28 UTC
Patch of bug 600356 works for me.

PID is created at startup:
fixe ~ # ls -l /run/sabnzbd/sabnzbd.pid 
-rw------- 1 sabnzbd sabnzbd 6 21 nov.  21:20 /run/sabnzbd/sabnzbd.pid

“/run” is a tmpfs so init have to create the folder at each startup.

Do you have something in /var/log/sabnzbd?
Comment 10 Oleh 2016-11-22 07:03:33 UTC
(In reply to Ben Kohler from comment #8)
> There's a checkpath call in /etc/init.d/sabnzbd which should create
> /run/sabnzbd/ before the service starts, so your #3 rm step *shouldn't* be
> causing any problem... what version of openrc do you have?

I removed it to have a clean test. 
0.18.3
Comment 11 Oleh 2016-11-22 07:06:02 UTC
(In reply to Sébastien P. from comment #9)
> Patch of bug 600356 works for me.
> 
> PID is created at startup:
> fixe ~ # ls -l /run/sabnzbd/sabnzbd.pid 
> -rw------- 1 sabnzbd sabnzbd 6 21 nov.  21:20 /run/sabnzbd/sabnzbd.pid
> 
> “/run” is a tmpfs so init have to create the folder at each startup.
> 
> Do you have something in /var/log/sabnzbd?

i know this "tmpfs" stuff, thx.
yes, i have log in /var/log/sabnzbd.
Comment 12 Oleh 2016-11-22 07:06:58 UTC
Created attachment 454010 [details]
sabnzbd.error.log
Comment 13 Oleh 2016-11-22 13:16:54 UTC
looks upstream broke ipv6 in:
 https://github.com/sabnzbd/sabnzbd/commit/8e97097dfdcc81c0945fad869b8b7d04ee1e74a5#diff-04b3dd2f1c0744dada13dfa5cf487d9eR532
commenting ipv6 in /etc/hosts make sabnzbd start fine.
Comment 14 Sébastien P. 2016-11-22 21:02:24 UTC
I tried several different /etc/sabnzbd/sabnzbd.ini with variant of ipv6_servers, no_ipv6, ipv6_hosting and host.
I did not manage to reproduce your “TypeError: argument of type 'int' is not iterable”.
Maybe you have an unsual combination of *ipv6* parameters/host.

Since It seems to be an upstream bug, could you open it on their github?
Comment 15 Justin Bronder (RETIRED) gentoo-dev 2016-12-07 15:42:55 UTC
Closing as upstream as this seems to require a particular set of configuration options (I'm also unable to reproduce).

Oleg, if you report this upstream and get a patch, feel free to reopen and I'll add the patch to the ebuild.