ErrNo 13 Permission denied

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
otakucode
Newbie
Newbie
Posts: 2
Joined: February 20th, 2009, 10:02 pm

ErrNo 13 Permission denied

Post by otakucode »

I'm sure this is going to turn out to be a stupid mistake on my part, but I've been wrestling with this issue for a couple hours now and could use some help, I'm just not seeing it.  I recently transitioned from Windows to Linux (Debian Server) for my SABnzbd box.  I set everything up and it was working fine.  Today, however, for every download that completes and requires an unrar step, SABnzbd fails with the error "[ErrNo 13] Permission denied".  I have checked my download directory, and both the complete and incomplete directories are set to 777.  SAB is setup to make the completed files 777 also.  In the incomplete directory while the download is happening, the created directory is set to 700.  I think this should be OK.  The owner of the directory and the user starting sab are the same (only 2 accounts on the box, root and otakucode.  Running SAB as otakucode, created directories as otakucode, etc).  unrar is at /usr/local/bin/rar/unrar with a symlink in /usr/bin, where sab finds it and is the 3.91 beta, the newest as of a couple days ago.  If I change into the "_FAILED_whatever" directory and execute an unrar x whatever.rar, everything extracts fine.  I cannot figure out why I am getting this permission error.  For downloads that do not require an unrar step, processing succeeds, so it seems to be pointing at a problem with unrar.

Here is an example failure from the logs:

sabnzbd.log.2:2009-12-05 16:22:58,124::ERROR::[newsunpack:417] Error "[Errno 13] Permission denied" while running rar_unpack on Whatever

Any ideas would be appreciated.


Update:  I just discovered that in the SAB log file, the following line appears:

2009-12-05 19:01:39,023::INFO::[SABnzbd:414] unrar binary... found (/usr/local/bin/rar)

This, I believe, is a problem... likely the problem.  /usr/local/bin/rar is a DIRECTORY which contains the rar and unrar executables, not an executable itself.  So how does SAB decide which paths to search and how can I convince it not to do this?  There are symlinks in /usr/bin to both the rar and unrar executables.  If I execute a "which rar"/"which unrar" from the commandline (using the same otakucode account that sab runs under) it points me to /usr/bin/rar (or unrar, respectively).  I am a bit perplexed as to how sab comes to glom on to the directory in /usr/local/bin.  There doesn't seem to be any setting in sabnzbd.ini that affects where it searches...  What can I do to discourage it from tripping up on this?  I think this would probably qualify as a bona fide bug BTW.
Last edited by otakucode on December 5th, 2009, 7:19 pm, edited 1 time in total.
User avatar
shypike
Administrator
Administrator
Posts: 19774
Joined: January 18th, 2008, 12:49 pm

Re: ErrNo 13 Permission denied

Post by shypike »

It's very unusual to have sub-folders in /usr/local/bin,
which is the reason nobody complained about this before.
On top of that you have /usr/local/bin before /usr/bin in the path (which is normal).

For a quick fix.
Find module misc.py and change line 1019 from

Code: Select all

            if os.access(target_path, os.X_OK):
to

Code: Select all

            if os.path.isfile(target_path) and os.access(target_path, os.X_OK):
Post Reply