Reputation: 1372
Recently there was mass chown-ing root:root on the server, so now I'm trying to repairer BZR permissions.
Next error appears on committing code to master branch:
Run command: bzr commit -m "[new commit msg]"
Committing to: sftp://goce@[IP:PORT]/usr/local/www/data/bzr/pr1/goce/
bzr: ERROR (ignored): 'sftp://goce@[IP:PORT]/usr/local/www/data/bzr/.bzr/repository/upload/e9sb7n5enoi59nixasq6.pack'
bzr: ERROR: Permission denied: "/usr/local/www/data/bzr/.bzr/repository/upload/e9sb7n5enoi59nixasq6.pack": [Errno 13] Permission denied
Look at the reported file shows this:
$ pwd
/usr/local/www/data/bzr/.bzr/repository/upload
$ ls -al
total 1212
drwxrwxr-x 2 root bzr 4096 Jan 30 14:02 .
-rw-r--r-- 1 goce bzr 204814 Jan 30 12:45 e9sb7n5enoi59nixasq6.pack
…
-rw-rw-r-- 1 root root 42 May 2 2011 umxv2mvk79n72bkjjae9.pack
...
What is the main reason for this error?
Can it be that e9sb7n5enoi59nixasq6.pack should have g-rw permissions, and BZR can't create g-rw file?(guessing this cause there are few g-rw files there, as shown in the xample)
Upvotes: 0
Views: 501
Reputation: 124704
For one thing, the fact that user goce
does not have write permission on the parent directory /usr/local/www/data/bzr/.bzr/repository/upload
could cause some problems. For example this would prevent deleting files from the directory.
I think you should do a chown -R goce /usr/local/www/data/bzr
to clean up permission issues.
The cleanest solution is to replace the branch with a clean new replica:
cd /usr/local/www/data
mv bzr bzr-bak
bzr branch --no-tree bzr-bak bzr
As a result, /usr/local/www/data/bzr
will be a shiny new clean replica of the old one, with all the files within having correct permissions.
Upvotes: 2