after natty upgrade, bzr up blocks on self lock on bound branch

Asked by Steve Beattie

On two different hosts now, after an upgrade to natty, I've seen the following when attempting to bzr update a bound branch of lp:ubuntu-qa-tools:

  [kryten ubuntu-qa-tools]$ bzr up
  Unable to obtain lock held by <email address hidden>
  at crowberry [process #31685], acquired 10 seconds ago.
  See "bzr help break-lock" for more.
  bzr: ERROR: Could not acquire lock "(remote lock)": bzr+ssh://<email address hidden>/~ubuntu-bugcontrol/ubuntu-qa-tools/master/

Here's what bzr info says about the bound branch:

  [kryten ubuntu-qa-tools]$ bzr info .
  Checkout (format: pack-0.92)
  Location:
         checkout root: .
    checkout of branch: bzr+ssh://<email address hidden>/%7Eubuntu-bugcontrol/ubuntu-qa-tools/master/

  Related branches:
    submit branch: /home/steve/bzr/ubuntu-qa-tools-0.1

This is what gets dumped in ~/.bzr.log

Fri 2011-04-01 10:44:22 -0700
0.151 bazaar version: 2.3.1
0.151 bzr arguments: [u'up']
0.208 looking for plugins in /home/steve/.bazaar/plugins
0.279 looking for plugins in /usr/lib/python2.7/dist-packages/bzrlib/plugins
0.427 encoding stdout as sys.stdout encoding 'UTF-8'
0.603 opening working tree '/home/steve/bzr/ubuntu-qa-tools'
0.962 ssh implementation is OpenSSH
18.615 Using fetch logic to copy between RemoteRepository(bzr+ssh://<email address hidden>/~ubuntu-bugcontrol/ubuntu-qa-tools/master/.bzr/)(RemoteRepositoryFormat(_network_name='Bazaar pack repository format 1 (needs bzr 0.92)\n')) and KnitPackRepository('file:///home/steve/bzr/ubuntu-qa-tools/.bzr/repository/')(RepositoryFormatKnitPack1())
18.616 fetch up to rev {<email address hidden>}
30.189 Transferred: 28kB (1.0kB/s r:23kB w:5kB)
30.235 Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/bzrlib/commands.py", line 926, in exception_to_return_code
    return the_callable(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/bzrlib/commands.py", line 1126, in run_bzr
    ret = run(*run_argv)
  File "/usr/lib/python2.7/dist-packages/bzrlib/commands.py", line 691, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/usr/lib/python2.7/dist-packages/bzrlib/commands.py", line 713, in run
    return self._operation.run_simple(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/bzrlib/cleanup.py", line 135, in run_simple
    self.cleanups, self.func, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/bzrlib/cleanup.py", line 165, in _do_with_cleanups
    result = func(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/bzrlib/builtins.py", line 1413, in run
    old_tip = branch.update(possible_transports)
  File "/usr/lib/python2.7/dist-packages/bzrlib/decorators.py", line 194, in write_locked
    result = unbound(self, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/bzrlib/branch.py", line 2799, in update
    self.pull(master, overwrite=True)
  File "/usr/lib/python2.7/dist-packages/bzrlib/branch.py", line 1086, in pull
    possible_transports=possible_transports, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/bzrlib/decorators.py", line 194, in write_locked
    result = unbound(self, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/bzrlib/branch.py", line 3478, in pull
    merge_tags_to_master=not source_is_master)
  File "/usr/lib/python2.7/dist-packages/bzrlib/branch.py", line 3593, in _pull
    overwrite, ignore_master=not merge_tags_to_master)
  File "/usr/lib/python2.7/dist-packages/bzrlib/tag.py", line 209, in merge_to
    return operation.run(to_tags, overwrite, ignore_master)
  File "/usr/lib/python2.7/dist-packages/bzrlib/cleanup.py", line 131, in run
    self.cleanups, self.func, self, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/bzrlib/cleanup.py", line 165, in _do_with_cleanups
    result = func(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/bzrlib/tag.py", line 241, in _merge_to_operation
    add_cleanup(master.lock_write().unlock)
  File "/usr/lib/python2.7/dist-packages/bzrlib/remote.py", line 2468, in lock_write
    remote_tokens = self._remote_lock_write(token)
  File "/usr/lib/python2.7/dist-packages/bzrlib/remote.py", line 2458, in _remote_lock_write
    self.repository.base.split('.bzr/')[0])
LockContention: Could not acquire lock "(remote lock)": bzr+ssh://<email address hidden>/~ubuntu-bugcontrol/ubuntu-qa-tools/master/

30.252 return code 3

This is with 2.3.1-1ubuntu1. I can paper over the issue by deleting the tree and re-checking it out, but it's really frustrating to run into, and it would probably be nice to know what's going wrong.

Question information

Language:
English Edit question
Status:
Solved
For:
Launchpad itself Edit question
Assignee:
No assignee Edit question
Solved by:
Max Bowsher
Solved:
Last query:
Last reply:
Revision history for this message
Best Max Bowsher (maxb) said :
#1

The key is in this line:

checkout of branch: bzr+ssh://<email address hidden>/%7Eubuntu-bugcontrol/ubuntu-qa-tools/master/

Something has changed in bzr such that it gets confused by the escaped ~ character, and ends up considering two textually different but semantically identical branch URLs as two separate things that must be locked.

You may more easily work around the issue by editing branch.conf and changing the %7E to ~, but clearly there is a bug here which needs to be fixed.

Revision history for this message
Steve Beattie (sbeattie) said :
#2

Thanks Max Bowsher, that solved my question.