Page 1 of 1

Cannot use external drive as watched folder

Posted: August 21st, 2010, 6:45 pm
by chosenken
Hello.  I have been having a weird problem lately where SABnzbd would start giving me random permission errors on different folders.  But first, the required info:

Version: 0.5.3 (Ubuntu Rep)
OS: Ubuntu 10.04 Server
Install-type: Ubuntu Rep
Skin: Default
Firewall Software: None
Are you using IPV6? No
Is the issue reproducible? It seems random...

At times, it would write out some files into the incomplete directory, then it would start giving disk errors on temp files.  A restart would work for a few files, then the errors would return.  Other times, it would run for a few NZBs then start giving erros with the cache (Saving /home/ken/.sabnzbd/cache/SABnzbd_nzo_sYpVtb failed).  Here is the error log from the web:

Code: Select all

2010-08-21 18:59:25,197 ERROR: Cannot create directory /home/ken/.sabnzbd/cache
2010-08-21 18:59:25,197 ERROR: Error importing <NzbFile: filename=None, type=None>
2010-08-21 18:59:25,197 ERROR: Cannot create directory /home/ken/.sabnzbd/cache
2010-08-21 18:59:25,198 ERROR: Error importing <NzbFile: filename=None, type=None>
2010-08-21 18:59:25,198 ERROR: Cannot create directory /home/ken/.sabnzbd/cache
2010-08-21 18:59:25,198 ERROR: Error importing <NzbFile: filename=None, type=None>
2010-08-21 18:59:25,199 ERROR: Cannot create directory /home/ken/.sabnzbd/cache
2010-08-21 18:59:25,199 ERROR: Error importing <NzbFile: filename=None, type=None>
2010-08-21 18:59:25,200 ERROR: Cannot create directory /home/ken/.sabnzbd/cache
2010-08-21 18:59:25,200 ERROR: Error importing <NzbFile: filename=None, type=None>
2010-08-21 18:59:25,200 ERROR: Cannot create directory /home/ken/.sabnzbd/cache
2010-08-21 18:59:25,201 ERROR: Error importing <NzbFile: filename=None, type=None>
2010-08-21 18:59:25,201 ERROR: Cannot create directory /home/ken/.sabnzbd/cache
2010-08-21 18:59:25,201 ERROR: Error importing <NzbFile: filename=None, type=None>
2010-08-21 18:59:25,202 ERROR: Cannot create directory /home/ken/.sabnzbd/cache
2010-08-21 18:59:25,202 ERROR: Error importing <NzbFile: filename=None, type=None>
2010-08-21 18:59:25,203 ERROR: Cannot create directory /home/ken/.sabnzbd/cache
2010-08-21 18:59:25,203 ERROR: Error importing <NzbFile: filename=None, type=None>
2010-08-21 18:59:25,212 ERROR: Cannot create directory /home/ken/.sabnzbd/cache
2010-08-21 18:59:25,212 ERROR: Saving /home/ken/.sabnzbd/cache/SABnzbd_nzo_sYpVtb failed
And here is sabnzbd.error.log:

Code: Select all

Exception in thread Thread-1:
Traceback (most recent call last):
  File "/usr/lib/python2.6/threading.py", line 532, in __bootstrap_inner
    self.run()
  File "/usr/share/sabnzbdplus/sabnzbd/postproc.py", line 457, in run
    history_db = database.get_history_handle()
  File "/usr/share/sabnzbdplus/sabnzbd/database.py", line 51, in get_history_handle
    return HistoryDB(_HISTORY_DB)
  File "/usr/share/sabnzbdplus/sabnzbd/database.py", line 67, in __init__
    self.con = sqlite3.connect(db_path)
OperationalError: unable to open database file

Traceback (most recent call last):
  File "/usr/bin/sabnzbdplus", line 1228, in <module>
    main()
  File "/usr/bin/sabnzbdplus", line 815, in main
    os.makedirs(sabnzbd.DIR_LCLDATA)
  File "/usr/lib/python2.6/os.py", line 157, in makedirs
    mkdir(name, mode)
OSError: [Errno 13] Permission denied: '/home/ken/.sabnzbd'
Here are the permissions for the .sabnzbd folder:

Code: Select all

drwxr-xr-x  6 ken  ken   4096 2010-08-20 23:27 .sabnzbd
Finally, here is the permissions of the incomplete download directory:

Code: Select all

drwxr-xr-x  3 ken ken             47 2010-08-21 18:59 Temp
Here is my INI file:  http://pastebin.com/e9E90kMU

I know there is space left on the drives, my home drive is on the server main drive and the downloads are stored on an array.  Here is the df for the raid (where downloads are stored) info:

Code: Select all

Filesystem           1K-blocks      Used Available Use% Mounted on
/dev/md3             4395276544 3623963868 771312676  83% /share
And df info for the .sabnzbd folder:

Code: Select all

Filesystem           1K-blocks      Used Available Use% Mounted on
/home/ken/.Private   149470772   5116124 136761932   4% /home/ken
Aaaaand, my log: http://dl.dropbox.com/u/4386564/sabnzbd.zip (Zipped up cause its 5 mb >.>)

Every thing was working great before, I think the issues may have started when I updated to 0.5.3 final, up from the beta.  Any ideas?  Thanks!

Re: Getting Permission Denied errors at random

Posted: August 21st, 2010, 6:55 pm
by shypike
The error message about /home/ken/.sabnzbd is quite clear.
Does this folder exist?

Re: Getting Permission Denied errors at random

Posted: August 21st, 2010, 6:57 pm
by chosenken
Yep.  Its sitting in my home directory with the following permissions:

Code: Select all

drwxr-xr-x  6 ken  ken   4096 2010-08-20 23:27 .sabnzbd
And the permissions inside it:

Code: Select all

ken@chosenubuntu:~/.sabnzbd$ pwd
/home/ken/.sabnzbd
ken@chosenubuntu:~/.sabnzbd$ ls -al
total 280
drwxr-xr-x  6 ken ken   4096 2010-08-20 23:27 .
drwx------ 42 ken ken  12288 2010-08-21 19:45 ..
drwxr-xr-x  2 ken ken   4096 2010-08-21 18:57 admin
drwxr-xr-x  2 ken ken 241664 2010-08-21 18:58 cache
drwxr-xr-x  2 ken ken   4096 2010-08-20 23:18 logs
drwx------  2 ken ken   4096 2010-08-21 18:57 nzb
-rw-r--r--  1 ken ken   3979 2010-08-21 18:54 sabnzbd.ini

Re: Getting Permission Denied errors at random

Posted: August 21st, 2010, 6:59 pm
by shypike
Tough one.
If the OS tells SABnzbd that it cannot create a file, then what can it do?

Re: Getting Permission Denied errors at random

Posted: August 21st, 2010, 7:03 pm
by chosenken
The issue may be that SABnzbd is trying to create files/folders that already exist.  Why would it try to recreate the .sabnzbd folder if it is already there?

Gona try reinstalling SABnzbd, see if that will do anything.

Re: Getting Permission Denied errors at random

Posted: August 21st, 2010, 7:58 pm
by chosenken
Ok, reinstalled and re-added my NZBs.  Everything was going great till we got to the forth item.  I looked at the log, and it was writing to the cache with no issue, when it came up saying the cache does not exist. 

I uploaded a bit of my log to paste bin, and highlighted where it was writing to cache fine, line 12, and where it reports it can't find the cache, line 89.

Log:  http://pastebin.com/eCdaFrnj

Here is the information about the cache directory at the time it failed http://pastebin.com/K1Cd0e6U

And finally the cache folder sitting inside .sabnzbd

Code: Select all

ken@chosenubuntu:~/.sabnzbd$ pwd
/home/ken/.sabnzbd
ken@chosenubuntu:~/.sabnzbd$ ll
total 84
drwxr-xr-x 2 ken ken  4096 2010-08-21 20:28 admin
drwxr-xr-x 2 ken ken 61440 2010-08-21 20:28 cache
drwxr-xr-x 2 ken ken  4096 2010-08-21 20:13 logs
drwx------ 2 ken ken  4096 2010-08-21 20:18 nzb
-rw-r--r-- 1 ken ken  3944 2010-08-21 20:17 sabnzbd.ini
So, why is it SABnzbd starts working fine, then all the sudden thinks the cache folder is gone, when it is still there?

Re: Getting Permission Denied errors at random

Posted: August 22nd, 2010, 8:34 am
by shypike
It's impossible for us to solve this issue for you.
Your complaint is quite unique, meaning it could be triggered by problems
in your system or the combination of SABnzbd and your system.
SABnzbd relies on feedback from the operating system (and the Python runtime system).
We're talking about rather basic operations here, like "does folder exist?",
"make this folder", so I'm not suspecting SABnzbd to have to some
obscure error which comes up (only) on your system.

Re: Getting Permission Denied errors at random

Posted: January 9th, 2011, 5:24 am
by diab
Hi,

I'm getting exactly the same error, you don't happen to have solved this problem?
I got Ubuntu 10.10 running, my home dir where sabnzbd is residing is on a ssd drive. The downloads get moved to a raid5 (md0).
I also tend to imagine that there are less errors when I keep my ssh connection to the system open (which makes no sense at all I guess).

Diab

Re: Getting Permission Denied errors at random

Posted: January 9th, 2011, 5:53 am
by shypike
Unless SABnzbd start writing itsfiles at incorrect locations,
I see no reason why it isn't an OS problem.
Do the log files indicate that files are written to unexpected locations?

About ssh: if you started SABnzbd from an SSH session and you did not
start it in daemon (-d) mode, SABnzbd stops when you break the connection.

Re: Getting Permission Denied errors at random

Posted: January 20th, 2011, 1:26 pm
by diab
The problem was my encrypted homedir, I feel stupid for not noticing the obvious :/