dirstate file locking doesn't work on smb mount on osx - bzr add, bzr status, and bzr commit fail over a SMB share

Bug #31006 reported by Jim Hodapp
22
This bug affects 4 people
Affects Status Importance Assigned to Milestone
Bazaar
Confirmed
High
Unassigned

Bug Description

I am trying to create a new branch in an existing directory full of source code that is mounted on my local Mac OS X (10.4.4) machine via a SMB share. No matter if the share is on a Windows Server 2003 share or a Samba 3 share, the same error results. This error can be reproduced through the following 3 bzr commands: "bzr add", "bzr status", and "bzr commit". "bzr init" worked just fine however. The following error is what results:

$ bzr add
bzr: ERROR: bzrlib.errors.LockError: [Errno 45] Operation not supported
  at /opt/local/lib/python2.4/site-packages/bzrlib/lock.py line 105
  in __init__
/opt/local/lib/python2.4/site-packages/bzrlib/lock.py:64: UserWarning: lock on <open file u'/Volumes/duratech server backup/ILSI DATA/ASP961/Source/firmware_dev/.bzr/branch-lock', mode 'rb' at 0x5959b0> not released
  warn("lock on %r not released" % self.f)
Exception exceptions.IOError: (45, 'Operation not supported') in <bound method _fcntl_ReadLock.__del__ of <bzrlib.lock._fcntl_ReadLock object at 0x5adcd0>> ignored

$ bzr status
bzr: ERROR: bzrlib.errors.LockError: [Errno 45] Operation not supported
  at /opt/local/lib/python2.4/site-packages/bzrlib/lock.py line 105
  in __init__
/opt/local/lib/python2.4/site-packages/bzrlib/lock.py:64: UserWarning: lock on <open file u'/Volumes/duratech server backup/ILSI DATA/ASP961/Source/firmware_dev/.bzr/branch-lock', mode 'rb' at 0x595800> not released
  warn("lock on %r not released" % self.f)
Exception exceptions.IOError: (45, 'Operation not supported') in <bound method _fcntl_ReadLock.__del__ of <bzrlib.lock._fcntl_ReadLock object at 0x5ad350>> ignored

$ bzr commit
bzr: ERROR: bzrlib.errors.LockError: [Errno 45] Operation not supported
  at /opt/local/lib/python2.4/site-packages/bzrlib/lock.py line 105
  in __init__
/opt/local/lib/python2.4/site-packages/bzrlib/lock.py:64: UserWarning: lock on <open file u'/Volumes/duratech server backup/ILSI DATA/ASP961/Source/firmware_dev/.bzr/branch-lock', mode 'rb' at 0x110e2f0> not released
  warn("lock on %r not released" % self.f)
Exception exceptions.IOError: (45, 'Operation not supported') in <bound method _fcntl_ReadLock.__del__ of <bzrlib.lock._fcntl_ReadLock object at 0x1108c50>> ignored

Revision history for this message
Martin Pool (mbp) wrote :

This should be fixed for metadir or knit repositories created with bzr 0.8 & later - they use lockdirs, not os locks.

Thanks for the report.

Changed in bzr:
status: Unconfirmed → Fix Released
Revision history for this message
Arjen Lentz (arjen-lentz) wrote :

I think this has been "re-broken"
In bzr 1.7, any command fails were the repo is on an SMB share:

$ bzr status
bzr: ERROR: Could not acquire lock "[Errno 45] Operation not supported"
/Library/Python/2.5/site-packages/bzrlib/lock.py:79: UserWarning: lock on <open file u'/Volumes/shared/bzr/centos/.bzr/checkout/dirstate', mode 'rb' at 0x13c43c8> not released
  warn("lock on %r not released" % self.f)
Exception exceptions.IOError: (45, 'Operation not supported') in <bound method _fcntl_ReadLock.__del__ of <bzrlib.lock._fcntl_ReadLock object at 0x13c92d0>> ignored

Revision history for this message
John A Meinel (jameinel) wrote : Re: [Bug 31006] Re: bzr add, bzr status, and bzr commit fail over a samba share on Mac OS X

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Arjen Lentz wrote:
> I think this has been "re-broken"
> In bzr 1.7, any command fails were the repo is on an SMB share:
>
> $ bzr status
> bzr: ERROR: Could not acquire lock "[Errno 45] Operation not supported"
> /Library/Python/2.5/site-packages/bzrlib/lock.py:79: UserWarning: lock on <open file u'/Volumes/shared/bzr/centos/.bzr/checkout/dirstate', mode 'rb' at 0x13c43c8> not released
> warn("lock on %r not released" % self.f)
> Exception exceptions.IOError: (45, 'Operation not supported') in <bound method _fcntl_ReadLock.__del__ of <bzrlib.lock._fcntl_ReadLock object at 0x13c92d0>> ignored
>

We've never changed the requirement to allow an OS lock on
.bzr/checkout/dirstate.

So my guess is someone accidentally disabled Samba OS locks again.
Possibly because they upgraded SMB?

John
=:->

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.9 (Cygwin)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iEYEARECAAYFAkjvzlkACgkQJdeBCYSNAAPWGACfe8LX0LtvOXTeX7obw1ir2ry6
itYAniRwoMURwQ1JbhPHGCrCMYy3pNQA
=WTP0
-----END PGP SIGNATURE-----

Revision history for this message
Markus Baden (markus-baden) wrote : Re: bzr add, bzr status, and bzr commit fail over a SMB share on Mac OS X

Hi,
I tried to branch my local repository on my mac to a windows machine mounted by smb. The bzr branch fails with a similiar error message.

I use bzr 1.8 (binary installation) and have Mac OS X 10.5.5 installed. Here is what I get

bzr: ERROR: Could not acquire lock "[Errno 45] Operation not supported"
/Library/Python/2.5/site-packages/bzrlib/lock.py:138: UserWarning: lock on <open file u'/Volumes/Experimente/MarkusMatlab/.bzr/checkout/dirstate', mode 'wb+' at 0x1fdee30> not released
  warn("lock on %r not released" % self.f)
Exception exceptions.IOError: (45, 'Operation not supported') in <bound method _fcntl_WriteLock.__del__ of <bzrlib.lock._fcntl_WriteLock object at 0x20181b0>> ignored
/Library/Python/2.5/site-packages/bzrlib/lockable_files.py:116: UserWarning: LockableFiles(<bzrlib.transport.local.LocalTransport url=file:///Volumes/Experimente/MarkusMatlab/.bzr/checkout/>) was gc'd while locked
  warnings.warn("%r was gc'd while locked" % self)

Revision history for this message
Martin Pool (mbp) wrote :

As John says, we've always needed file locks on dirstate files, so while the original version of this bug was fixed, a different occurrence remains open.

Since several people have reported this I'm assuming that SMB on Mac OS X doesn't support file locking by default, or at least not in a common configuration. However, samba, SMB/CIFS, and OS X do all support file locks, so it seems like it should be possible to find some workaround that will let bzr dirstate working trees function there.

Changed in bzr:
importance: Medium → High
milestone: 0.8 → none
status: Fix Released → Confirmed
Revision history for this message
Cory Pratt (cory-pratt) wrote :

I tried every version I could find from 1.13 down to 1.0 and they all had the same locking issue. I'm working around this for now by using sftp instead of samba.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.