Page 1 of 1

par2 on solaris fails on * [partial fix now]

Posted: August 5th, 2013, 5:54 pm
by ljw1
Hi!
Since updating to 0.7.14 my sabnzbd install is failing on most downloads. The par2 command compiled for solaris doesn't appear to be able to have wildcards. Does anyone have any suggestions of how to fix this?

Re: par2 on solaris fails on *

Posted: August 6th, 2013, 1:33 pm
by shypike
There's no fix currently.
Unless you want to write a wrapper script called "par2" and have that call the original par2 program
with the wildcard character removed.

Re: par2 on solaris fails on *

Posted: August 6th, 2013, 5:43 pm
by ljw1
The problem is with how the '*' is interpreted. In normal cases it globs all the files and directories except those with a . at the beginning. A simple solution is to rename the __ADMIN__ folder to something like .__ADMIN__.

Another solution is to enable a shell extension in bash to allow for exlusions.

shopt -s extglob
par2 repair *.par2 !(__ADMIN__)
shopt -u extglob

Both of these methods should work on any system that is using bash as the command interpreter.

Before I implement a solution do you have any suggestions about which way is better? I don't want to put something in place that breaks next time I update.

Re: par2 on solaris fails on *

Posted: August 9th, 2013, 5:27 am
by shypike
Using a hidden folder (.admin) is the better solution.
Implementing it in a new version is a bit of an issue
because already existing queue entries should keep working.
I suggest you use the wrapper script until I find a way to implement a better solution.

Re: par2 on solaris fails on *

Posted: August 23rd, 2013, 4:33 pm
by ljw1
I have made a script in the interim which works when using the command line, but it doesn't work when integrated with Sabnzbd. It gives the following error -
Error [Errno 8] Exec format error while running par2_repair on set

The script is as follows :-
#/bin/bash!
# Script to wrap around par2 binary
# The wrapper removes the __ADMIN__ folder only
IFS_OLD="$IFS"
IFS="\n"

shopt -s extglob
IGNOREVAR="!(__ADMIN__)"
COMMAND="$1"
shift
PARPATH="$1"
DIRPATH=${1%/*}
shift
IGNOREVAR="$DIRPATH/!(__ADMIN__)"
echo "This is where the echo starts"
printf "\n"
echo "par2cmd $COMMAND $PARPATH $IGNOREVAR"
echo "This is where the command starts"
printf "\n"
par2 $COMMAND ""$PARPATH"" $IGNOREVAR
shopt -u extglob
IFS="$IFS_OLD"


How would you suggest I debug the error?

Re: par2 on solaris fails on *

Posted: August 23rd, 2013, 4:35 pm
by ljw1
Oops I pasted the debug version of the script. The actual script is :-

#/bin/bash!
# Script to wrap around par2 binary
# The wrapper removes the __ADMIN__ folder only
IFS_OLD="$IFS"
IFS="\n"

shopt -s extglob
IGNOREVAR="!(__ADMIN__)"
COMMAND="$1"
shift
PARPATH="$1"
DIRPATH=${1%/*}
shift
IGNOREVAR="$DIRPATH/!(__ADMIN__)"
par2 $COMMAND ""$PARPATH"" $IGNOREVAR
shopt -u extglob
IFS="$IFS_OLD"

Re: par2 on solaris fails on *

Posted: August 23rd, 2013, 9:44 pm
by ljw1
Additional debugging info from the log

2013-08-24 12:39:50,931::ERROR::[newsunpack:865] Error [Errno 8] Exec format error while running par2_repair on set 0x3qm8ItdK5nUru
2013-08-24 12:39:50,931::INFO::[newsunpack:866] Traceback:
Traceback (most recent call last):
File "/opt/SABnzbd/sabnzbd/newsunpack.py", line 843, in par2_repair
setname, joinables, single=single)
File "/opt/SABnzbd/sabnzbd/newsunpack.py", line 981, in PAR_Verify
startupinfo=stup, creationflags=creationflags)
File "/usr/lib/python2.6/subprocess.py", line 621, in __init__
errread, errwrite)
File "/usr/lib/python2.6/subprocess.py", line 1126, in _execute_child
raise child_exception
OSError: [Errno 8] Exec format error

Re: par2 on solaris fails on * [partial fix now]

Posted: August 24th, 2013, 3:11 am
by shypike
There will be a working fix in 0.7.15

Re: par2 on solaris fails on * [partial fix now]

Posted: August 26th, 2013, 12:54 pm
by reni
I did apply this commit:
https://github.com/sabnzbd/sabnzbd/comm ... 20fffe08e4

On my QNAP with a par2cmd without wildcard support this atleast made the failed releases complete again after a retry.
I guess the wildcard was to fix the repair of badly named par2 files, not sure if this commit reverts the fix for that.

But apperently i had more releases that failed due to wildcard then to weird par2 files.