Problem using some network drives

Asked by Tim Langen

I'm having trouble using Bazaar on a network drive that is stored on my network attached storage device (Synology DS1010+). Whatever I do (checkout, init etc.) I get ERROR: [Error 5] Access denied as an error message. This happens on both Windows XP, Windows 7 and OSX machines.

When I check after the error message, the root folder of the checkout has been created, but it is completely empty and Windows tells me I actually have no privileges to do anything with the folder.

I do however have complete read and write priviliges on that device, the firewall is open on all ports and even if I run bazaar with administrator priviliges I get exactly the same error message. If I checkout to my local computer and then copy the result to the location on the network drive I wanted to checkout to, there is absolutely no problem. In fact, everything else works very well and so far only Bazaar seems to have problems with this network drive.

Is there maybe something particular in the way Bazaar treats some network drives? The drive that shows the problem is a usual smb mount. Working with other network drives from a server running Samba works without any problem.

Question information

Language:
English Edit question
Status:
Answered
For:
Bazaar Edit question
Assignee:
No assignee Edit question
Last query:
Last reply:
Revision history for this message
Martin Pool (mbp) said :
#1

Hi,

People do happily use bzr over CIFS and with Samba. It is probably a bug in the firmware of this device, or perhaps in bzr. bzr could perhaps work around it.

Can you please post the error traceback you get by running 'bzr -Derror init' (or whatever command.)

Thanks

Revision history for this message
Tim Langen (tlangen-ati) said :
#2

Hi,

thanks for your help! here's the traceback:

bzr -Derror init
bzr: ERROR: exceptions.WindowsError: [Error 5] Zugriff verweigert
Traceback (most recent call last):
  File "bzrlib\commands.pyo", line 923, in exception_to_return_code
  File "bzrlib\commands.pyo", line 1123, in run_bzr
  File "bzrlib\commands.pyo", line 691, in run_argv_aliases
  File "bzrlib\commands.pyo", line 710, in run
  File "bzrlib\cleanup.pyo", line 135, in run_simple
  File "bzrlib\cleanup.pyo", line 165, in _do_with_cleanups
  File "bzrlib\builtins.pyo", line 1756, in run
  File "bzrlib\bzrdir.pyo", line 471, in create_branch_convenience
  File "bzrlib\bzrdir.pyo", line 927, in create
  File "bzrlib\bzrdir.pyo", line 1539, in initialize_on_transport
  File "bzrlib\bzrdir.pyo", line 1680, in _initialize_on_transport_vfs
  File "bzrlib\transport\local.pyo", line 212, in put_bytes
  File "bzrlib\atomicfile.pyo", line 111, in commit
  File "bzrlib\osutils.pyo", line 365, in _win32_rename
  File "bzrlib\osutils.pyo", line 229, in fancy_rename
WindowsError: [Error 5] Zugriff verweigert

Revision history for this message
Vincent Ladeuil (vila) said :
#3

If you get the same message when using this server from xp, w7 and OSX but you don't get it on other samba mounted drives, then it strongly suggests a problem on the server.

I could swear we had a bug report about a similar problem where we failed to rename a file we just created... but I can't find it back

Revision history for this message
Tim Langen (tlangen-ati) said :
#4

I checked again: The error traceback is absolutely the same on XP and w7 (even running different versions of Bazaar). On OSX it is almost the same, but the error code is different:

bzr -Derror init
bzr: ERROR: bzrlib.errors.LockContention: Could not acquire lock "/Volumes/KRbData/Simulations/TEST/.bzr/checkout/dirstate": [Errno 45] Operation not supported

Traceback (most recent call last):
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/bzrlib/commands.py", line 853, in exception_to_return_code
    return the_callable(*args, **kwargs)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/bzrlib/commands.py", line 1055, in run_bzr
    ret = run(*run_argv)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/bzrlib/commands.py", line 661, in run_argv_aliases
    return self.run_direct(**all_cmd_args)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/bzrlib/commands.py", line 665, in run_direct
    return self._operation.run_simple(*args, **kwargs)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/bzrlib/cleanup.py", line 122, in run_simple
    self.cleanups, self.func, *args, **kwargs)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/bzrlib/cleanup.py", line 156, in _do_with_cleanups
    result = func(*args, **kwargs)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/bzrlib/builtins.py", line 1730, in run
    possible_transports=[to_transport])
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/bzrlib/bzrdir.py", line 532, in create_branch_convenience
    bzrdir.create_workingtree()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/bzrlib/bzrdir.py", line 1616, in create_workingtree
    accelerator_tree=accelerator_tree, hardlink=hardlink)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/bzrlib/workingtree_4.py", line 1407, in initialize
    state = dirstate.DirState.initialize(local_path)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/bzrlib/dirstate.py", line 2049, in initialize
    result.lock_write()
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/bzrlib/dirstate.py", line 3059, in lock_write
    self._lock_token = lock.WriteLock(self._filename)
  File "/opt/local/Library/Frameworks/Python.framework/Versions/2.6/lib/python2.6/site-packages/bzrlib/lock.py", line 216, in __init__
    raise errors.LockContention(self.filename, e)
LockContention: Could not acquire lock "/Volumes/KRbData/Simulations/TEST/.bzr/checkout/dirstate": [Errno 45] Operation not supported

Also, "something" seems to be created in the process, as when I run the command a second time, I get another error message telling me that the .bzr folder allready exists:

Traceback (most recent call last):
  File "bzrlib\commands.pyo", line 853, in exception_to_return_code
  File "bzrlib\commands.pyo", line 1055, in run_bzr
  File "bzrlib\commands.pyo", line 661, in run_argv_aliases
  File "bzrlib\commands.pyo", line 665, in run_direct
  File "bzrlib\cleanup.pyo", line 122, in run_simple
  File "bzrlib\cleanup.pyo", line 156, in _do_with_cleanups
  File "bzrlib\builtins.pyo", line 1730, in run
  File "bzrlib\bzrdir.pyo", line 526, in create_branch_convenience
  File "bzrlib\bzrdir.pyo", line 314, in create
  File "bzrlib\bzrdir.pyo", line 1886, in initialize_on_transport
  File "bzrlib\bzrdir.pyo", line 2007, in _initialize_on_transport_vfs
  File "bzrlib\transport\local.pyo", line 325, in mkdir
  File "bzrlib\transport\local.pyo", line 321, in _mkdir
  File "bzrlib\transport\__init__.pyo", line 316, in _translate_error
FileExists: File exists: u'G:/Simulations/20110217/testtest/.bzr': [Error 183] Cannot create a file when that file already exists: 'G:/Simulations/20110217/testtest/.bzr'

I will also try to get in touch with the manufacturer of my NAS server. Do you have any suggestions where the problem might be? As Bazaar is the only program that has problems, they will probably try to tell me that it is a bug in Bazaar ...

Thanks for your help again!

Revision history for this message
Martin Pool (mbp) said :
#5

The first issue is that the server apparently doesn't support file
locking. That's pretty clearly a limitation in the server but also
something we could work around with
https://bugs.launchpad.net/bzr/+bug/98836

You could work around this by putting the repository on the NAS and
keeping the working tree locally.

The other issue is one we sometimes see in other network filesystems
which is incoherent caching between the server and the client, which
might be the same as <https://bugs.launchpad.net/bzr/+bug/680529>. I
wonder why bzr is trying to create .bzr if it exists?

Revision history for this message
Mathieu Schiffmann (movix) said :
#6

Hello,

I also use a synology device and everything is working well.

The thing is that the synology firmware is powerfull and has a lot of possibilities. This allows more but also is also subject of issues due to misconfigurations.

I guess you are working with smb shares on your NAS that you map on your workstations.

The shares created on the synology have some access rules based wether on internal users and groups or the users of a windows domain if an integration in such has been configured. But it seems these ACLs are ok.

On Windows 7 there was a workaround to do in the windows registry in order to allow proper login to the NAS when mapping SMB shares to drives letters. I do not remember exactly, but searching the synology forums for 'smb drive mapping windows 7" should give you quickly a hit. That said i guess further more that the issue is not related to this but is more a problem with the file / folder ACLs.

Remember that with wrong ACLs you perhaps can create a folder but cannot create file within it, or you can probably create files but not modify them.

If you are integrated in a Windows domain you can check the ACLs by clicking richt on a folder and the walk to the "rights" tab.
If you have not integrated your NAS in a windows domain (ADS) the ACLs are linux based. In this case use the fileManager within the Synology administration, click right on the given folders (not the shares) and select "properties".
In both cases set the rights accordingly and make sure the changes you have done are also are propagated to the children.

Basicaly if you can map a networkdrive in windows over SMB and still have all the rights on your folders and files bazaar should work.

Hope this answer is not too late.

Can you help with this problem?

Provide an answer of your own, or ask Tim Langen for more information if necessary.

To post a message you must log in.