par2 on solaris fails on * [partial fix now]

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
ljw1
Newbie
Newbie
Posts: 11
Joined: July 12th, 2011, 3:54 pm

par2 on solaris fails on * [partial fix now]

Post 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?
Last edited by ljw1 on August 23rd, 2013, 9:45 pm, edited 1 time in total.
User avatar
shypike
Administrator
Administrator
Posts: 19774
Joined: January 18th, 2008, 12:49 pm

Re: par2 on solaris fails on *

Post 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.
ljw1
Newbie
Newbie
Posts: 11
Joined: July 12th, 2011, 3:54 pm

Re: par2 on solaris fails on *

Post 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.
User avatar
shypike
Administrator
Administrator
Posts: 19774
Joined: January 18th, 2008, 12:49 pm

Re: par2 on solaris fails on *

Post 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.
ljw1
Newbie
Newbie
Posts: 11
Joined: July 12th, 2011, 3:54 pm

Re: par2 on solaris fails on *

Post 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?
ljw1
Newbie
Newbie
Posts: 11
Joined: July 12th, 2011, 3:54 pm

Re: par2 on solaris fails on *

Post 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"
ljw1
Newbie
Newbie
Posts: 11
Joined: July 12th, 2011, 3:54 pm

Re: par2 on solaris fails on *

Post 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
User avatar
shypike
Administrator
Administrator
Posts: 19774
Joined: January 18th, 2008, 12:49 pm

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

Post by shypike »

There will be a working fix in 0.7.15
reni
Newbie
Newbie
Posts: 5
Joined: January 5th, 2012, 4:51 am

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

Post 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.
Post Reply