Item1007: RCS: failed to create file : Permission denied

pencil
Priority: Normal
Current State: No Action Required
Released In:
Target Release: n/a
Applies To: Engine
Component:
Branches:
Reported By: FabriceGlibert
Waiting For:
Last Change By: KennethLavrsen
Problem appears while modifying a new topic for the first time and trying to save the modification.
Environment is :
Foswiki installed in an Ubuntu 8.10, installed in a Virtual Machine (VMWare), installed in a Windows Server 2008 (to be confirmed for the OS Version)
The data and pub directory are in the Windows filesystem, with the right path redefined in the foswiki configure page, and mounted on Ubuntu with the following /etc/fstab line :
//STORESRV/BIOINFO$/data/wiki/foswiki /mnt/wiki/ cifs auto,credentials=/root/.credentials,umask=000,user,uid=33,guid=33   0   0

The first time a new topic is created and saved, files appears as this in the file system :
-r-xr-Sr-x 1 www-data root   160 2009-02-06 15:36 TestTwo.txt
-r-xr-Sr-x 1 www-data root   574 2009-02-06 15:36 TestTwo.txt,v
We can see that file permissions are NOT 644 as defined in {RCS}{filePermission}

Then I want to modify my topic. When I save it again, this error message appears :
RCS: failed to create file /mnt/wiki/data/Sandbox/TestTwo.txt: Permission denied 

A new file appears in the file system with the 2 others :
-rwxrwSrwx 1 www-data root 55 2009-02-06 15:41 TestTwo.lease
We can see that permissions are different...

Then I go back in my navigator with the left arrow, click on "save" again...and it works...
File are always with this permissions :
-r-xr-Sr-x 1 www-data root   160 2009-02-06 15:42 TestTwo.txt
-r-xr-Sr-x 1 www-data root   574 2009-02-06 15:42 TestTwo.txt,v

Then, no problem to modify the topic again !

So, the error appears the first time the file is modify, then no more problem with modifications.

Lot of information are in the irc log

Edit: 23/02/2009
This problem appears not only on new created topic but also on existing topic...
It is not always solved by a simple "back" in navigator and "save" again...
Some time I must go into the file system and chmod the  -r-xr-Sr-x  file to 777 in order to be able to save it with Foswiki...
It's make my users crazy...

ColasNahaboo - 23 Feb 2009: your mount parameters seem bogus (mode=000). try file_mode=0644,dir_mode=0755 for instance.
Thanx for your advice...
But why "bogus" ? mode=000 works as a umask so it set rights to 777 and that's what we can see for all files...
Anyway I tried your proposition and set file_mode=0644,dir_mode=0755 while mounting my disk : command line mounting is as :
sudo mount -t cifs -o auto,credentials=/root/.credentials,file_mode=0644,dir_mode=0755,user,uid=33,gid=33 //PXT-STORESRV/BIOINFO$/data/wiki/foswiki /mnt/wiki/
Then a ls gives :
-rw-r--r-- 1 www-data www-data  65210 2009-02-23 17:05 IrbesartanSC.txt
-rw-r--r-- 1 www-data www-data  65402 2009-02-23 17:05 IrbesartanSC.txt,v
-rw-r--r-- 1 www-data www-data   6798 2009-02-24 10:06 DocEpidb.txt
-rw-r--r-- 1 www-data www-data  10784 2009-02-24 10:06 DocEpidb.txt,v
Then I modify the DocEpidb topic in FosWiki, save it an do a ls again :
-rw-r--r-- 1 www-data www-data  65210 2009-02-23 17:05 IrbesartanSC.txt
-rw-r--r-- 1 www-data www-data  65402 2009-02-23 17:05 IrbesartanSC.txt,v
-r--r--r-- 1 www-data www-data   6798 2009-02-24 10:06 DocEpidb.txt
-r--r--r-- 1 www-data www-data  10784 2009-02-24 10:06 DocEpidb.txt,v
so what ??? rights changed and you can see the same problem, user have no more rights to write (change) DocEpidb file !!!
IngoKappler - 23 Feb 2009: Seems you are using Debian because of www-data. I always set user and group to be www-data not just the user. In the above examples there is no right to write to the files not even for the user. I remember by heart to have seen this error when using wrong ownerships "somewhere" in the foswiki structure and in such cases for me something like chown -Rv www-data:www-data /your/path/to/foswiki | grep -v retained solves the issue. Not sure this will be the case for you but also verify correct ownerships (web server user and group).
thank you to point this, I already changed it but forget to update this in my report...in fact, it was a typo in my mounting command 'cause its not "guid=33" but "gid=33"
24 Feb 2009 AM
So, new files are -r--r--r-- BUT i can modify them by Foswiki...it's strange but it works...I dont know exactly WHY some topics maybe be saved without problem (with -r--r--r-- permissions ...???...) 
and some other give me the saving error message... 
24 Feb 2009 PM
Before another problem, I prefer to change my saved File System so I create a 40 Go Virtual Disk on my VM Machine (getting free space from the Windows File System) and formated it as ext3. 
Then I mount it using nfs server, copy in it my data and pub foswiki directories and chown all files to www-data (user and group).
.txt files are now -rw-r--r-- when modify it but the .txt,v files are still -r--r--r--, maybe its normal...

-- Should SMART this...

Anyway, yes, the ,v files are supposed to be read-only. That's how RCS works. You won't write to them directly, you use RCS to do it for you, and it handles the chmod.

It's probably just a safeguard that you shouldn't be playing around in your ,v file, as it's only RCS meta-data.

So if I read the bug report properly, the issue was from using a shared disk, so it's most probably an issue in the sharing or visualization code, and not on our side, right?

If so, please close this bug.

26 Feb 2009 AM
No, the issue was using a shared disk formated as ext3, the same file system on which foswiki is installed.
The probleme still exists using the previous disk on the Windows File System : but i dont know if the problem is on foswiki side or on Winfows File System side. 

-- OlivierRaginel - 26 Feb 2009

Sorry, I haven't seen your reply before. Anyway, this bug item is getting really hard to read. Could you please state again which configuration are working, and which isn't? From what I understood:
  • Host Windows 2008 Server, Guest Ubuntu Intrepid (8.10), Foswiki (1.0.0)
  • $Foswiki::cfg{StoreImpl} = 'RcsWrap';
  • $Foswiki::cfg{DataDir} = some path on a shared folder (same for PubDir)

And when this shared folder is mounted using CIFS (windows share), it fails as mentionned above, but when it is formatted in ext3 and mounted using a local disk, it works. If my assumptions are correct, I'm afraid this is more in the CIFS code, or in how VMware handles these calls, than in Foswiki. And it would be really hard and time consuming to confirm, I'm afraid.

If you really have to have this kind of configuration, with data stored in another server (SAN, NAS or whatever), I'd suggest you mount it directly in Ubuntu and use some *nix filesystem (ext2, 3, 4, reiser, xfs, zfs, whatever)

I had issues with NAS and CIFS too, and they're not related to Foswiki at all smile

-- OlivierRaginel - 11 Mar 2009

-- FabriceGlibert - 11 Mar 2009

Olivier Said
If my assumptions are correct, I'm afraid this is more in the CIFS code, or in how VMware handles these calls, than in Foswiki.
I think you're right, or maybe its the way Windows deal with users and right permissions. Anyway, I dont think its a priority to fix it or look at it deeper...

-- FabriceGlibert

Reporter suggests "I dont think its a priority to fix it or look at it deeper..."

So no action

-- KennethLavrsen - 16 Jun 2009

ItemTemplate edit

Summary RCS: failed to create file : Permission denied
ReportedBy FabriceGlibert
Codebase
SVN Range Foswiki-1.0.0, Thu, 08 Jan 2009, build 1878
AppliesTo Engine
Component
Priority Normal
CurrentState No Action Required
WaitingFor
Checkins
TargetRelease n/a
ReleasedIn
Topic revision: r11 - 16 Jun 2009, KennethLavrsen
The copyright of the content on this website is held by the contributing authors, except where stated elsewhere. See Copyright Statement. Creative Commons License    Legal Imprint    Privacy Policy