Error : cannot create directory (Debian / SMB share)

Support for the Debian/Ubuntu package, created by JCFP.
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
error404
Newbie
Newbie
Posts: 10
Joined: July 9th, 2012, 6:43 am

Error : cannot create directory (Debian / SMB share)

Post by error404 »

Hi,

I have installed sabnzbd on my raspberry pi (debian squeeze). sabnzbd runs as a daemon.

Problem is : when i try to set my "complete" and "incomplete" folders on my NAS (SMB share), I get the following errors :

Code: Select all

2012-07-09 14:23:33,338 ERROR: Cannot change permissions of /media/usbshare1/downloads/complete/_UNPACK_FileName
2012-07-09 14:23:33,343 ERROR: Cannot change permissions of /media/usbshare1/downloads/complete/_UNPACK_ FileName 
2012-07-09 14:23:42,792 ERROR: Cannot create directory /media/usbshare1/downloads/incomplete
2012-07-09 14:23:43,903 ERROR: Cannot create directory /media/usbshare1/downloads/complete
2012-07-09 14:23:44,710 ERROR: Cannot create directory /media/usbshare1/downloads/incomplete
2012-07-09 14:23:45,925 ERROR: Cannot create directory /media/usbshare1/downloads/incomplete
2012-07-09 14:23:45,942 ERROR: Cannot create directory /media/usbshare1/downloads/complete
2012-07-09 14:23:55,742 ERROR: Disk error on creating file /media/usbshare1/downloads/incomplete/FileName/File.ext
2012-07-09 14:23:56,154 ERROR: Cannot change permissions of /media/usbshare1/downloads/complete/_UNPACK_FileName
2012-07-09 14:23:56,160 ERROR: Cannot change permissions of /media/usbshare1/downloads/complete/_UNPACK_FileName/File.ext

Everything is OK when the download directory is set on the system SD card. And I don't understand why sabnzbd tries to create the folderz "incomplete" and "complete", as it already existst.
I also get a "Disk Error".

It looks like a permission problem, so I checked :

- sabnzbd runs under my main account, which is sudoer :

Code: Select all

error404@raspberrypi:~$ ps -ef | grep -i sabnzbd
error404  4895  4637  0 13:31 pts/0    00:00:00 grep -i sabnzbd
error404  8352     1 17 11:34 ?        00:20:44 /usr/bin/python -OO /usr/bin/sabnzbdplus --daemon
with this account, i can (without sudo) make or delete directories and files in the share.

- my SMB share is mounted via fstab, with 777 permissions (confirmed by ls -l)

Code: Select all

error404@raspberrypi:~$ ls -l /media/usbshare1/downloads/
total 0
drwxrwxrwx 1 1024 users 0 Jul  9 11:37 complete
drwxrwxrwx 1 1024 users 0 Jul  9 11:36 incomplete
I can't see where is the problem... Can anyone help me ?

Thanks !
User avatar
sander
Release Testers
Release Testers
Posts: 9258
Joined: January 22nd, 2008, 2:22 pm

Re: Error : cannot create directory (Debian / SMB share)

Post by sander »

error404 is the account sabnzbd is running under, right?

If so, as error404, do this:

Code: Select all

echo "blabla" >> /media/usbshare1/downloads/incomplete/blabla.txt
Does that work? I expect not. If so, check the "mount" permissions by typing "mount" and posting the output here. Permissions should be "rw".
error404
Newbie
Newbie
Posts: 10
Joined: July 9th, 2012, 6:43 am

Re: Error : cannot create directory (Debian / SMB share)

Post by error404 »

It worked, i did not get any error, and blabla.txt is created in the incomplete folder, with blabla in it....

mount output :

//192.168.0.15/usbshare1/ on /media/usbshare1 type cifs (rw,mand)
//192.168.0.15/usbshare2/ on /media/usbshare2 type cifs (rw,mand)

That's why I don't get it : permissions are set properly...
error404
Newbie
Newbie
Posts: 10
Joined: July 9th, 2012, 6:43 am

Re: Error : cannot create directory (Debian / SMB share)

Post by error404 »

I tried to lower the folder_max_length value, as i saw that some "Disk Error" were caused by folder names being too long... Default was 256, I set it to 64, and I still get the same errors.

I also noticed that the "disk errors" are random : when downloading a file which contains 10 rar files (r00 to r09), I only got 8 "Disk error on creating file", r03 and r08 were created properly...
User avatar
sander
Release Testers
Release Testers
Posts: 9258
Joined: January 22nd, 2008, 2:22 pm

Re: Error : cannot create directory (Debian / SMB share)

Post by sander »

error404 wrote: I also noticed that the "disk errors" are random : when downloading a file which contains 10 rar files (r00 to r09), I only got 8 "Disk error on creating file", r03 and r08 were created properly...
Oh. So intermittent errors. :-( I would say your system can't reach the NAS all the time. Annoying. That makes it hard to analyze and solve.

I would do this: open a seperate terminal on your Raspi / debian system and start this script (and keep it running):

Code: Select all

#!/bin/sh

TOUCHFILE='/home/sander/date-touch.txt'
# TOUCHFILE='/media/usbshare1/downloads/incomplete/date-touch.txt'

while [ 1 ]
do
	date > $TOUCHFILE
	cat $TOUCHFILE
	sleep 1

done
Change TOUCHFILE to a writable location on the remote NAS, so something with ......./incomplete/date-touch.txt

This script has two effects:
- keep the connection to the NAS awake (if that is the problem)
- show if the connection is working

If you keep this script running, see what the effect on SABnzbd and saving to the NAS is.
error404
Newbie
Newbie
Posts: 10
Joined: July 9th, 2012, 6:43 am

Re: Error : cannot create directory (Debian / SMB share)

Post by error404 »

I just tried it, and I still get the errors:

Here is the output of the shells script :

Code: Select all


Tue Jul 10 08:13:11 CEST 2012
(...)
Tue Jul 10 08:13:19 CEST 2012
Tue Jul 10 08:13:30 CEST 2012
(...)
Tue Jul 10 08:13:39 CEST 2012
Tue Jul 10 08:13:50 CEST 2012
(...)
Tue Jul 10 08:13:59 CEST 2012
Tue Jul 10 08:14:10 CEST 2012
(...)
Tue Jul 10 08:14:16 CEST 2012
Tue Jul 10 08:14:27 CEST 2012
Tue Jul 10 08:14:29 CEST 2012
Tue Jul 10 08:14:30 CEST 2012
(...) indicate that I get a record every second. So it seems that the connection is lost sometimes... That should explain the random errors.

I tried to set the "downloads" folders of my other sabnzbd (running on a Win7 laptop) to the NAS, and everything works great, no errors even when downloading big files... So the smb server works great, at least with a (powerful, compared to the raspi) windows client The share is also accessed from XBMC to stream videos, and that works.

My two next steps :
- set up a SMB share on my win7 laptop and set the raspi sabnzbd downloads folders on it. If there are errors, problem may come from the raspi
- install sabnbzbd on my main linux distro on my laptop. If there are errors, that should be a more linux cifs configuration generic problem, or network issue that only shows when a linux client access the smb share

I'll keep you posted with the results. Anyway, thanks for your help !
error404
Newbie
Newbie
Posts: 10
Joined: July 9th, 2012, 6:43 am

Re: Error : cannot create directory (Debian / SMB share)

Post by error404 »

- set up a SMB share on my win7 laptop and set the raspi sabnzbd downloads folders on it
=> Done, same errors cannot create directory / disk error. No more cannot change permissions.

Problem does not come from the share. More likely from the raspberry pi cifs configuration, or from the network.

I'll do the next test, testing with a linux install of sabnzbd on my main laptop
error404
Newbie
Newbie
Posts: 10
Joined: July 9th, 2012, 6:43 am

Re: Error : cannot create directory (Debian / SMB share)

Post by error404 »

So, with sabnzbd+ 0.8.8 installed on a Linux Mint 12, with downloads folders on the smb share :
=> No disk errors, no "cannot create directory" errors, but still "cannot change permission".

My NAS seems to refuse permission change from the current user :

Code: Select all

error404@raspberrypi:~$ chmod 777 /media/usbshare1/downloads/incomplete/testperm.txt
chmod: changing permissions of `/media/usbshare1/downloads/incomplete/testperm.txt': Operation not permitted
error404@raspberrypi:~$ sudo chmod 777 /media/usbshare1/downloads/incomplete/testperm.txt
chmod: changing permissions of `/media/usbshare1/downloads/incomplete/testperm.txt': Permission denied
That's not a really an issue, as the share is mounted with 777 rights, every d/led file is already rw.

So, the "disk errors" and "cannot create directory" must come from poor cifs management on my raspberry pi, which causes errors when writing files. I'll try to investigate.

I also set up a NFS share to try it : no errors and better transfer speed...
User avatar
sander
Release Testers
Release Testers
Posts: 9258
Joined: January 22nd, 2008, 2:22 pm

Re: Error : cannot create directory (Debian / SMB share)

Post by sander »

IMHO: if the "chmod" does not work towards your NAS, the "sudo chmod" won't work either: with sudo you only get su rights on your local Raspi machine, not on the NAS.
error404
Newbie
Newbie
Posts: 10
Joined: July 9th, 2012, 6:43 am

Re: Error : cannot create directory (Debian / SMB share)

Post by error404 »

Yes, but I still don"t get why the NAS won't let any client change permissions, although they have rw privileges... but that's not a big issue.

Thanks for your advice and help anyway ! I will reply later if I find a way to make cifs work properly on my raspi.
User avatar
sander
Release Testers
Release Testers
Posts: 9258
Joined: January 22nd, 2008, 2:22 pm

Re: Error : cannot create directory (Debian / SMB share)

Post by sander »

error404 wrote:Yes, but I still don"t get why the NAS won't let any client change permissions, although they have rw privileges... but that's not a big issue.

Thanks for your advice and help anyway ! I will reply later if I find a way to make cifs work properly on my raspi.
BTW: I don't understand the "anyway"... ???

"rw" is the overall stuff. The rights per directory and file can be more limiting. The resulting right is <mount-right> AND <directory/file-right>
So as what user (+group) are you logged on to the NAS, and what are the rights?

Some more things:
- chmod over cifs to another filesystem (on the NAS) ... that's an "interesting" task
- I had a look at the SABnzbd source code sabnzbd/misc.py and I'm not sure *why* SABnzbd wants to change the permissions on the directory (leading to the errors you reported)
Post Reply