"[Errno 13] Permission denied:" In Linux while creating branch / repository

Asked by Vijaya Kumar on 2011-11-14

Hi,

We have mounted a windows shared drive in Linux (/mnt/p), in which bazaar repository is been created.
And i have given full permission from the linux m/c user.

Using bazaar I'm able to checkout and checkin the files, but while creating branch / new repository getting this below error.
Error:
[tanst@server test]$ bzr branch /mnt/p/HC_Data/repo/renessas/RC1234 /mnt/p/HC_Data/repo/renessas/RC2324
bzr: ERROR: Permission denied: "/mnt/p/HC_Data/repo/renessas/RC2324/.bzr": [Errno 13] Permission denied: '/mnt/p/HC_Data/repo/renessas/RC2324/.bzr'

But a branch folder is been created in target directory with an empty ".bzr" inside.

As a normal user i'm able to create directory inside repository path,

[tanst@ server test]$ mkdir /mnt/p/HC_Data/repo/renessas/RCTEST
[tanst@ server test]$ ls -l /mnt/p/HC_Data/repo/renessas
total 12
drwxrwxrwx 3 tanst RemoteUsr 4096 Nov 8 16:30 ASD_witt
drwxrwxrwx 3 tanst RemoteUsr 4096 Nov 8 16:30 RC1234
drwxrwxrwx 2 tanst RemoteUsr 4096 Nov 14 2011 RCTEST

I don't know why bazaar is giving problem in this situation.

Regards,
Vijay

Question information

Language:
English Edit question
Status:
Solved
For:
Bazaar Edit question
Assignee:
No assignee Edit question
Solved by:
Vijaya Kumar
Solved:
2011-11-16
Last query:
2011-11-16
Last reply:
2011-11-16
Vijaya Kumar (vijayakumar-cm) said : #1

From .bzr.log -->
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
Mon 2011-11-14 16:11:19 +0800
0.028 bazaar version: 2.1.4
0.028 bzr arguments: [u'branch', u'/mnt/p/HC_Data/repo/renessas/RC1234', u'/mnt/p/HC_Data/repo/renessas/RC2555']
0.043 looking for plugins in /home/tanst/.bazaar/plugins
0.043 looking for plugins in /usr/lib/python2.4/site-packages/bzrlib/plugins
0.109 encoding stdout as sys.stdout encoding 'UTF-8'
1.751 Traceback (most recent call last):
  File "/usr/lib/python2.4/site-packages/bzrlib/commands.py", line 853, in exception_to_return_code
    return the_callable(*args, **kwargs)
  File "/usr/lib/python2.4/site-packages/bzrlib/commands.py", line 1055, in run_bzr
    ret = run(*run_argv)
  File "/usr/lib/python2.4/site-packages/bzrlib/commands.py", line 661, in run_argv_aliases
    return self.run_direct(**all_cmd_args)
  File "/usr/lib/python2.4/site-packages/bzrlib/commands.py", line 665, in run_direct
    return self._operation.run_simple(*args, **kwargs)
  File "/usr/lib/python2.4/site-packages/bzrlib/cleanup.py", line 121, in run_simple
    return _do_with_cleanups(
  File "/usr/lib/python2.4/site-packages/bzrlib/cleanup.py", line 156, in _do_with_cleanups
    result = func(*args, **kwargs)
  File "/usr/lib/python2.4/site-packages/bzrlib/builtins.py", line 1232, in run
    source_branch=br_from)
  File "/usr/lib/python2.4/site-packages/bzrlib/bzrdir.py", line 1148, in sprout
    result = cloning_format.initialize_on_transport(target_transport)
  File "/usr/lib/python2.4/site-packages/bzrlib/bzrdir.py", line 1884, in initialize_on_transport
    return self._initialize_on_transport_vfs(transport)
  File "/usr/lib/python2.4/site-packages/bzrlib/bzrdir.py", line 2005, in _initialize_on_transport_vfs
    mode=temp_control._dir_mode)
  File "/usr/lib/python2.4/site-packages/bzrlib/transport/local.py", line 325, in mkdir
    self._mkdir(self._abspath(relpath), mode=mode)
  File "/usr/lib/python2.4/site-packages/bzrlib/transport/local.py", line 321, in _mkdir
    self._translate_error(e, abspath)
  File "/usr/lib/python2.4/site-packages/bzrlib/transport/__init__.py", line 318, in _translate_error
    raise errors.PermissionDenied(path, extra=e)
PermissionDenied: Permission denied: "/mnt/p/HC_Data/repo/renessas/RC2555/.bzr": [Errno 13] Permission denied: '/mnt/p/HC_Data/repo/renessas/RC2555/.bzr'

1.751 Transferred: 0KiB (0.0K/s r:0K w:0K)
1.751 return code 3
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

John A Meinel (jameinel) said : #2

On 11/14/2011 9:45 AM, Vijaya Kumar wrote:
> Question #178695 on Bazaar changed:
> https://answers.launchpad.net/bzr/+question/178695
>
> Vijaya Kumar gave more information on the question:
>
>> From .bzr.log -->
...

> File "/usr/lib/python2.4/site-packages/bzrlib/transport/__init__.py", line 318, in _translate_error
> raise errors.PermissionDenied(path, extra=e)
> PermissionDenied: Permission denied: "/mnt/p/HC_Data/repo/renessas/RC2555/.bzr": [Errno 13] Permission denied: '/mnt/p/HC_Data/repo/renessas/RC2555/.bzr'
>
> 1.751 Transferred: 0KiB (0.0K/s r:0K w:0K)
> 1.751 return code 3
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
>

I'm guessing we are trying to make sure the directory exists, so we are
calling mkdir(). We would expect that if the dir already existed, we
would get a FileExists exception, but we are getting PermissionDenied.

Which leads us to believe that the directory doesn't exist (we were
denied permission to create it).

I suppose we could change the code a bit so that when we get an error,
we do a bit more digging to see if it really means what it says.

John
=:->

Vijaya Kumar (vijayakumar-cm) said : #3

To be more clear..
(1)
Run command: bzr branch bzr+http://137.55.208.82/bzr/renessas/RC1234 bzr+http://137.55.208.82/bzr/renessas/RCTEST --use-existing-dir
bzr: ERROR: Permission denied: ".": : [Errno 13] Permission denied: '/bzr/repo/renessas/RCTEST/.bzr'

(2)
Run command: bzr branch bzr+http://137.55.208.82/bzr/renessas/RC1234 bzr+http://137.55.208.82/bzr/renessas/RCTEST --use-existing-dir bzr: ERROR: File exists: '/bzr/repo/renessas/RCTEST/.bzr'

Martin Pool (mbp) said : #4

The linked branch ought to fix this

Vijaya Kumar (vijayakumar-cm) said : #5

Could you help me to resolve this:

bzr branch lp:~mbp/bzr/606537-mkdir test
bzr: ERROR: Connection error: Couldn't resolve host 'xmlrpc.launchpad.net' [Errno 11001] getaddrinfo failed

Jelmer Vernooij (jelmer) said : #6

Hi Vijaya, that seems like a connection problem. Perhaps it's intermittent? Launchpad does seem to be up at the moment.

Martin Pool (mbp) said : #7

He likely has a firewall blocking the connection. Try using bzr+ssh.
On Nov 14, 2011 11:31 PM, "Jelmer Vernooij" <
<email address hidden>> wrote:

> Question #178695 on Bazaar changed:
> https://answers.launchpad.net/bzr/+question/178695
>
> Jelmer Vernooij proposed the following answer:
> Hi Vijaya, that seems like a connection problem. Perhaps it's
> intermittent? Launchpad does seem to be up at the moment.
>
> --
> You received this question notification because you are an answer
> contact for Bazaar.
>
>

Vijaya Kumar (vijayakumar-cm) said : #8

getting this error :(

ssh: bazaar.launchpad.net: Name or service not known
bzr: ERROR: Connection closed: Unexpected end of message. Please check connectivity and permissions, and report a bug if problems persist.

Martin Pool (mbp) said : #9

I guess this is also your firewall

Try setting http_proxy=http://proxy.your.com
then bzr branch http://bazaar.launchpad.net/~mbp/bzr/606537-mkdir

Vijaya Kumar (vijayakumar-cm) said : #10

Yes, i have copied the branch.

To perform the test, How to merge this code to my existing bzr setup in linux?

Martin Pool (mbp) said : #11

For this test, just run

./bzr branch /mnt/p/HC_Data/repo/renessas/RC1234
/mnt/p/HC_Data/repo/renessas/RC2324

from inside your bzr checkout.

Vijaya Kumar (vijayakumar-cm) said : #12

Still the same issue:

[tanst@P690-6YWJR1S 606537-mkdir]$ ./bzr branch /mnt/p/HC_Data/repo/renessas/RC1234 /mnt/p/HC_Data/repo/renessas/RC1111
bzr: ERROR: Permission denied: "/mnt/p/HC_Data/repo/renessas/RC1111/.bzr": [Errno 13] Permission denied: '/mnt/p/HC_Data/repo/renessas/RC1111/.bzr'
bzr: warning: some compiled extensions could not be loaded; see <https://answers.launchpad.net/bzr/+faq/703>

Martin Pool (mbp) said : #13

please post the traceback again

Vijaya Kumar (vijayakumar-cm) said : #14

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
1.691 Transferred: 0kB (0.0kB/s r:0kB w:0kB)
1.697 Traceback (most recent call last):
  File "/home/tanst/bzr_branch_test/606537-mkdir/bzrlib/commands.py", line 946, in exception_to_return_code
    return the_callable(*args, **kwargs)
  File "/home/tanst/bzr_branch_test/606537-mkdir/bzrlib/commands.py", line 1150, in run_bzr
    ret = run(*run_argv)
  File "/home/tanst/bzr_branch_test/606537-mkdir/bzrlib/commands.py", line 699, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/home/tanst/bzr_branch_test/606537-mkdir/bzrlib/commands.py", line 721, in run
    return self._operation.run_simple(*args, **kwargs)
  File "/home/tanst/bzr_branch_test/606537-mkdir/bzrlib/cleanup.py", line 135, in run_simple
    self.cleanups, self.func, *args, **kwargs)
  File "/home/tanst/bzr_branch_test/606537-mkdir/bzrlib/cleanup.py", line 165, in _do_with_cleanups
    result = func(*args, **kwargs)
  File "/home/tanst/bzr_branch_test/606537-mkdir/bzrlib/builtins.py", line 1307, in run
    source_branch=br_from)
  File "/home/tanst/bzr_branch_test/606537-mkdir/bzrlib/bzrdir.py", line 453, in sprout
    create_tree_if_local=create_tree_if_local)
  File "/home/tanst/bzr_branch_test/606537-mkdir/bzrlib/cleanup.py", line 131, in run
    self.cleanups, self.func, self, *args, **kwargs)
  File "/home/tanst/bzr_branch_test/606537-mkdir/bzrlib/cleanup.py", line 165, in _do_with_cleanups
    result = func(*args, **kwargs)
  File "/home/tanst/bzr_branch_test/606537-mkdir/bzrlib/bzrdir.py", line 469, in _sprout
    result = cloning_format.initialize_on_transport(target_transport)
  File "/home/tanst/bzr_branch_test/606537-mkdir/bzrlib/bzrdir.py", line 1428, in initialize_on_transport
    return self._initialize_on_transport_vfs(transport)
  File "/home/tanst/bzr_branch_test/606537-mkdir/bzrlib/bzrdir.py", line 1551, in _initialize_on_transport_vfs
    mode=temp_control._dir_mode)
  File "/home/tanst/bzr_branch_test/606537-mkdir/bzrlib/transport/local.py", line 327, in mkdir
    self._mkdir(self._abspath(relpath), mode=mode)
  File "/home/tanst/bzr_branch_test/606537-mkdir/bzrlib/transport/local.py", line 323, in _mkdir
    self._translate_error(e, abspath)
  File "/home/tanst/bzr_branch_test/606537-mkdir/bzrlib/transport/__init__.py", line 339, in _translate_error
    raise errors.PermissionDenied(path, extra=e)
PermissionDenied: Permission denied: "/mnt/p/HC_Data/repo/renessas/RC1111/.bzr": [Errno 13] Permission denied: '/mnt/p/HC_Data/repo/renessas/RC1111/.bzr'

1.697 return code 3
[11186] 2011-11-16 12:42:40.903 WARNING: bzr: warning: some compiled extensions could not be loaded; see <https://answers.launchpad.net/bzr/+faq/703>
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

Martin Pool (mbp) said : #15

thanks. please run 'bzr pull' in the bzr directory and try again.

Vijaya Kumar (vijayakumar-cm) said : #16

This fix the issue:
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
[tanst@P690-6YWJR1S 606537-mkdir]$ ./bzr branch /mnt/p/HC_Data/repo/renessas/ASD_witt /mnt/p/HC_Data/repo/renessas/RCTEST
Branched 1 revision(s).
bzr: warning: some compiled extensions could not be loaded; see <https://answers.launchpad.net/bzr/+faq/703>
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

Now i need to replace this version into the server, is it like just copy the bzrlib to python?
>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>
[root@P690-6YWJR1S bzrlib]# bzr --version
Bazaar (bzr) 2.1.4
  Python interpreter: /usr/bin/python 2.4.3
  Python standard library: /usr/lib/python2.4
  Platform: Linux-2.6.18-194.3.1.el5PAE-i686-with-redhat-5.5-Final
  bzrlib: /usr/lib/python2.4/site-packages/bzrlib
  Bazaar configuration: /root/.bazaar
  Bazaar log file: /root/.bzr.log

[root@P690-6YWJR1S 606537-mkdir]# ./bzr --version
Bazaar (bzr) 2.4.3dev
  from bzr checkout /home/tanst/bzr_branch_test/606537-mkdir
    revision: 6062
    revid: <email address hidden>
    branch nick: 606537-mkdir
  Python interpreter: /usr/bin/python2.6 2.6.5
  Python standard library: /usr/lib/python2.6
  Platform: Linux-2.6.18-194.3.1.el5PAE-i686-with-redhat-5.5-Final
  bzrlib: /home/tanst/bzr_branch_test/606537-mkdir/bzrlib
  Bazaar configuration: /root/.bazaar
  Bazaar log file: /root/.bzr.log

>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>>

Martin Pool (mbp) said : #17

awesome, thanks for your help testing this.

as far as upgrading your server, it depends a bit how you installed it
originally. this fix will be in the next 2.4 release. i'm not sure if
redhat will ship that, if you installed from redhat.

perhaps the easiest way to upgrade is
1. remove the distro version
2. do 'sudo python setup.py install'

--
Martin

Vijaya Kumar (vijayakumar-cm) said : #18

Thanks for the info..

my linux server has 2 python version 2.4 and 2.6 in which 2.4 is the default one.
I cant change the default version because it has lot of dependencies running on.

How to install this setup.py with the 2.6 version?

Martin Pool (mbp) said : #19

sudo python2.6 setup.py install

should do it

Vijaya Kumar (vijayakumar-cm) said : #20

[root@P690-6YWJR1S 606537-mkdir]# sudo python2.6 setup.py install
No Cython, trying Pyrex...

The python package 'Pyrex' is not available. If the .c files are available,
they will be built, but modifying the .pyx files will not rebuild them.

C extension(s) not found:
   bzrlib/_annotator_pyx.c
  bzrlib/_bencode_pyx.c
  bzrlib/_chunks_to_lines_pyx.c
  bzrlib/_groupcompress_pyx.c
  bzrlib/_knit_load_data_pyx.c
  bzrlib/_known_graph_pyx.c
  bzrlib/_rio_pyx.c
  bzrlib/_dirstate_helpers_pyx.c
  bzrlib/_readdir_pyx.c
  bzrlib/_chk_map_pyx.c
  bzrlib/_simple_set_pyx.c
  bzrlib/_btree_serializer_pyx.c
The python versions will be used instead.

running install
running build
running build_py
running build_ext
building 'bzrlib._patiencediff_c' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/usr/include/python2.6 -c bzrlib/_patiencediff_c.c -o build/temp.linux-i686-2.6/bzrlib/_patiencediff_c.o
bzrlib/_patiencediff_c.c:28:20: error: Python.h: No such file or directory
In file included from bzrlib/_patiencediff_c.c:30:
bzrlib/python-compat.h:31: error: expected ‘)’ before ‘*’ token
bzrlib/python-compat.h:32: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
bzrlib/python-compat.h:33: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
bzrlib/_patiencediff_c.c:76: error: expected specifier-qualifier-list before ‘PyObject’
bzrlib/_patiencediff_c.c:126: error: expected specifier-qualifier-list before ‘PyObject_HEAD’
bzrlib/_patiencediff_c.c: In function ‘compare_lines’:
bzrlib/_patiencediff_c.c:154: warning: implicit declaration of function ‘PyObject_Compare’
bzrlib/_patiencediff_c.c:154: error: ‘struct line’ has no member named ‘data’
bzrlib/_patiencediff_c.c:154: error: ‘struct line’ has no member named ‘data’
bzrlib/_patiencediff_c.c: In function ‘equate_lines’:
bzrlib/_patiencediff_c.c:183: warning: implicit declaration of function ‘PyErr_SetNone’
bzrlib/_patiencediff_c.c:183: error: ‘PyExc_OverflowError’ undeclared (first use in this function)
bzrlib/_patiencediff_c.c:183: error: (Each undeclared identifier is reported only once
bzrlib/_patiencediff_c.c:183: error: for each function it appears in.)
bzrlib/_patiencediff_c.c:195: warning: implicit declaration of function ‘PyErr_NoMemory’
bzrlib/_patiencediff_c.c: In function ‘delete_lines’:
bzrlib/_patiencediff_c.c:550: warning: implicit declaration of function ‘Py_XDECREF’
bzrlib/_patiencediff_c.c:550: error: ‘struct line’ has no member named ‘data’
bzrlib/_patiencediff_c.c: At top level:
bzrlib/_patiencediff_c.c:558: error: expected ‘)’ before ‘*’ token
bzrlib/_patiencediff_c.c:608: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
bzrlib/_patiencediff_c.c:672: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
bzrlib/_patiencediff_c.c:756: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
bzrlib/_patiencediff_c.c: In function ‘PatienceSequenceMatcher_dealloc’:
bzrlib/_patiencediff_c.c:803: error: ‘PatienceSequenceMatcher’ has no member named ‘backpointers’
bzrlib/_patiencediff_c.c:804: error: ‘PatienceSequenceMatcher’ has no member named ‘hashtable’
bzrlib/_patiencediff_c.c:805: error: ‘PatienceSequenceMatcher’ has no member named ‘b’
bzrlib/_patiencediff_c.c:805: error: ‘PatienceSequenceMatcher’ has no member named ‘bsize’
bzrlib/_patiencediff_c.c:806: error: ‘PatienceSequenceMatcher’ has no member named ‘a’
bzrlib/_patiencediff_c.c:806: error: ‘PatienceSequenceMatcher’ has no member named ‘asize’
bzrlib/_patiencediff_c.c:807: error: ‘PatienceSequenceMatcher’ has no member named ‘ob_type’
bzrlib/_patiencediff_c.c:807: error: ‘PyObject’ undeclared (first use in this function)
bzrlib/_patiencediff_c.c:807: error: expected expression before ‘)’ token
bzrlib/_patiencediff_c.c: At top level:
bzrlib/_patiencediff_c.c:825: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
bzrlib/_patiencediff_c.c:917: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
bzrlib/_patiencediff_c.c:1024: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
bzrlib/_patiencediff_c.c:1190: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘PatienceSequenceMatcher_methods’
bzrlib/_patiencediff_c.c:1211: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘PatienceSequenceMatcherType’
bzrlib/_patiencediff_c.c:1254: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘cpatiencediff_methods’
bzrlib/_patiencediff_c.c:1262: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘init_patiencediff_c’

  Cannot build extension "bzrlib._patiencediff_c".
  Use "build_ext --allow-python-fallback" to use slower python implementations instead.

error: command 'gcc' failed with exit status 1

Vijaya Kumar (vijayakumar-cm) said : #21

Installed: python26-Cython.i386 0:0.14.1-3.el5

[root@P690-6YWJR1S 606537-mkdir]# sudo python2.6 setup.py install
running install
running build
running build_py
running build_ext
cythoning bzrlib/_annotator_pyx.pyx to bzrlib/_annotator_pyx.c
building 'bzrlib._annotator_pyx' extension
gcc -pthread -fno-strict-aliasing -DNDEBUG -O2 -g -pipe -Wall -Wp,-D_FORTIFY_SOURCE=2 -fexceptions -fstack-protector --param=ssp-buffer-size=4 -m32 -march=i386 -mtune=generic -fasynchronous-unwind-tables -D_GNU_SOURCE -fPIC -fwrapv -fPIC -I/usr/include/python2.6 -c bzrlib/_annotator_pyx.c -o build/temp.linux-i686-2.6/bzrlib/_annotator_pyx.o
bzrlib/_annotator_pyx.c:4:20: error: Python.h: No such file or directory
bzrlib/_annotator_pyx.c:6:6: error: #error Python headers needed to compile C extensions, please install development version of Python.

  Cannot build extension "bzrlib._annotator_pyx".
  Use "build_ext --allow-python-fallback" to use slower python implementations instead.

error: command 'gcc' failed with exit status 1

Martin Pool (mbp) said : #22

you'll need python-devel or something

Vijaya Kumar (vijayakumar-cm) said : #23

Martin, Thanks a lot for you help..
came up with my server setup :)