bzr log on directory fails with "ObjectNotLocked"

Bug #618697 reported by Isaac Jurado
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Bazaar
Confirmed
Low
Unassigned

Bug Description

Executing "bzr log foo", where foo is a subdirectory of the working tree (tracked with Bazaar, of course), generates a crash. Either with checkouts or full branches, this always happens with directories.

Even when logging a subtree is not supported, bazaar should fail gracefully.

Generated traceback:

bzr: ERROR: bzrlib.errors.ObjectNotLocked: <WorkingTree6 of /home/ijurado/projects/yoplait> is not locked

Traceback (most recent call last):
  File "/usr/lib/python2.6/dist-packages/bzrlib/commands.py", line 911, in exception_to_return_code
    return the_callable(*args, **kwargs)
  File "/usr/lib/python2.6/dist-packages/bzrlib/commands.py", line 1111, in run_bzr
    ret = run(*run_argv)
  File "/usr/lib/python2.6/dist-packages/bzrlib/commands.py", line 689, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/usr/lib/python2.6/dist-packages/bzrlib/commands.py", line 704, in run
    return self._operation.run_simple(*args, **kwargs)
  File "/usr/lib/python2.6/dist-packages/bzrlib/cleanup.py", line 135, in run_simple
    self.cleanups, self.func, *args, **kwargs)
  File "/usr/lib/python2.6/dist-packages/bzrlib/cleanup.py", line 165, in _do_with_cleanups
    result = func(*args, **kwargs)
  File "/home/ijurado/.bazaar/plugins/pager/__init__.py", line 64, in run
    cmd_class.run(self, **kwargs)
  File "/usr/lib/python2.6/dist-packages/bzrlib/commands.py", line 1126, in ignore_pipe
    result = func(*args, **kwargs)
  File "/usr/lib/python2.6/dist-packages/bzrlib/builtins.py", line 2338, in run
    revision, file_list, self.add_cleanup)
  File "/usr/lib/python2.6/dist-packages/bzrlib/log.py", line 2046, in _get_info_for_log_files
    kind = _get_kind_for_file_id(tree, file_id)
  File "/usr/lib/python2.6/dist-packages/bzrlib/log.py", line 2100, in _get_kind_for_file_id
    return tree.kind(file_id)
  File "/usr/lib/python2.6/dist-packages/bzrlib/workingtree_4.py", line 549, in kind
    return self._kind(relpath)
  File "/usr/lib/python2.6/dist-packages/bzrlib/workingtree_4.py", line 555, in _kind
    entry = self._get_entry(path=relpath)
  File "/usr/lib/python2.6/dist-packages/bzrlib/workingtree_4.py", line 355, in _get_entry
    state = self.current_dirstate()
  File "/usr/lib/python2.6/dist-packages/bzrlib/workingtree_4.py", line 209, in current_dirstate
    self._must_be_locked()
  File "/usr/lib/python2.6/dist-packages/bzrlib/workingtree_4.py", line 860, in _must_be_locked
    raise errors.ObjectNotLocked(self)
ObjectNotLocked: <WorkingTree6 of /home/ijurado/projects/yoplait> is not locked

bzr 2.2.0 on python 2.6.6rc1 (Linux-2.6.35.1-x86_64-with-debian-squeeze-sid)
arguments: ['/usr/bin/bzr', 'log', 'conf']
encoding: 'UTF-8', fsenc: 'UTF-8', lang: 'es_ES.UTF-8'
plugins:
  bash_completion /usr/lib/python2.6/dist-packages/bzrlib/plugins/bash_completion [2.2.0]
  bzr_interactive /home/ijurado/.bazaar/plugins/bzr_interactive [1.2.0]
  bzrtools /usr/lib/python2.6/dist-packages/bzrlib/plugins/bzrtools [2.2.0]
  launchpad /usr/lib/python2.6/dist-packages/bzrlib/plugins/launchpad [2.2.0]
  netrc_credential_store /usr/lib/python2.6/dist-packages/bzrlib/plugins/netrc_credential_store [2.2.0]
  news_merge /usr/lib/python2.6/dist-packages/bzrlib/plugins/news_merge [2.2.0]
  pager /home/ijurado/.bazaar/plugins/pager [unknown]

*** Bazaar has encountered an internal error. This probably indicates a
    bug in Bazaar. You can help us fix it by filing a bug report at
        https://bugs.launchpad.net/bzr/+filebug
    including this traceback and a description of the problem.

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

'bzr log bzrlib' does work ok for me in 2.2. I wonder if this is actually a problem with bzr locking the wrong directory? Is 'conf' perhaps a symlink from one branch to a subdirectory of another, or something like that?

Changed in bzr:
status: New → Incomplete
Revision history for this message
Isaac Jurado (ijurado) wrote :

Right, I can only reproduce this with my repository. Seems like a repository format conversion issue. Closing

Changed in bzr:
status: Incomplete → Invalid
Revision history for this message
Martin Pool (mbp) wrote : Re: [Bug 618697] Re: bzr log on directory crashes

On 18 August 2010 18:13, Isaac Jurado <email address hidden> wrote:
> Right, I can only reproduce this with my repository.  Seems like a
> repository format conversion issue.  Closing
>
> ** Changed in: bzr
>       Status: Incomplete => Invalid

If you can tell me where the symlinks and .bzr directories are in your
repository, we should be able to reproduce and fix this. It's almost
certainly not something about your specific data.

--
Martin

Revision history for this message
Isaac Jurado (ijurado) wrote : Re: bzr log on directory crashes

The troublesome repositories do not have any symbolic links. The repository is private, but I can provide whatever diagnostic information you need.

Revision history for this message
Martin Pool (mbp) wrote : Re: [Bug 618697] Re: bzr log on directory crashes

So if I understand correctly, your working directory is
/home/ijurado/projects/yoplait and you ran 'bzr log conf' there, and
there is a conf top level directory? Are there any other .bzr
directories in the tree?

Revision history for this message
Isaac Jurado (ijurado) wrote : Re: bzr log on directory crashes

No other .bzr directories. As I said, it happens in two unrelated repositories where one is a branch and the other is a checkout. There is a version mismatch, however, between the bazaar at the repository server and the workstation.

Server has:

Bazaar (bzr) 2.0.3
  Python interpreter: /usr/bin/python 2.5.2
  Python standard library: /usr/lib/python2.5
  Platform: Linux-2.6.30.5-xenU-x86_64-with-debian-5.0.5
  bzrlib: /usr/lib/python2.5/site-packages/bzrlib

Workstation has:

Bazaar (bzr) 2.2.0
  Python interpreter: /usr/bin/python 2.6.6rc2
  Python standard library: /usr/lib/python2.6
  Platform: Linux-2.6.35.2-i686-with-debian-squeeze-sid
  bzrlib: /usr/lib/python2.6/dist-packages/bzrlib

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

I'm going to mark this confirmed because someone can possibly work out through static analysis how the object ends up being not locked, but only low because we can't reproduce it.

Changed in bzr:
status: Invalid → Confirmed
importance: Undecided → Low
summary: - bzr log on directory crashes
+ bzr log on directory fails with "ObjectNotLocked"
Jelmer Vernooij (jelmer)
tags: added: check-for-breezy
Jelmer Vernooij (jelmer)
tags: removed: check-for-breezy
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.