After PC crash during commit, commit impossible in that branch

Bug #190204 reported by Arjan Gelderblom
2
Affects Status Importance Assigned to Milestone
Bazaar
Triaged
Medium
Unassigned

Bug Description

During commit the PC hang, Windows XP SP 2 with the standalone installer for Win32 latest version so PC had to be rebooted. Now all commits fail to that branch. Even commits from other workstations.

Commits are being done over sftp:// protocol.

bzr check on the branch itself gives:
-----------------------------------------------------------------------
checked branch file:///var/bzr/*****/trunk/ format Bazaar-NG branch format 5
checked repository <bzrlib.transport.local.LocalTransport url=file:///var/bzr/*****/> format <RepositoryFormatKnit1>
    30 revisions
  4787 file-ids
  5159 unique file texts
108226 repeated file texts
     0 unreferenced text versions
-----------------------------------------------------------------------

Error message is from a Linux (Xubuntu 7.10) box using the same branch but not updated after the crash.
------- Error message -------------------------------------------
bzr commit
bzr: ERROR: exceptions.AttributeError: 'NoneType' object has no attribute 'as_dict'

Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 802, in run_bzr_catch_errors
    return run_bzr(argv)
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 758, in run_bzr
    ret = run(*run_argv)
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 492, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/usr/lib/python2.5/site-packages/bzrlib/builtins.py", line 2334, in run
    author=author)
  File "/usr/lib/python2.5/site-packages/bzrlib/decorators.py", line 165, in write_locked
    return unbound(self, *args, **kwargs)
  File "/usr/lib/python2.5/site-packages/bzrlib/workingtree_4.py", line 245, in commit
    result = WorkingTree3.commit(self, message, revprops, *args, **kwargs)
  File "/usr/lib/python2.5/site-packages/bzrlib/decorators.py", line 165, in write_locked
    return unbound(self, *args, **kwargs)
  File "/usr/lib/python2.5/site-packages/bzrlib/mutabletree.py", line 187, in commit
    revprops=revprops, *args, **kwargs)
  File "/usr/lib/python2.5/site-packages/bzrlib/commit.py", line 292, in commit
    self._check_bound_branch()
  File "/usr/lib/python2.5/site-packages/bzrlib/commit.py", line 473, in _check_bound_branch
    self.master_branch.lock_write()
  File "/usr/lib/python2.5/site-packages/bzrlib/branch.py", line 1340, in lock_write
    repo_token = self.repository.lock_write()
  File "/usr/lib/python2.5/site-packages/bzrlib/repository.py", line 692, in lock_write
    result = self.control_files.lock_write(token=token)
  File "/usr/lib/python2.5/site-packages/bzrlib/lockable_files.py", line 230, in lock_write
    token_from_lock = self._lock.lock_write(token=token)
  File "/usr/lib/python2.5/site-packages/bzrlib/lockdir.py", line 563, in lock_write
    return self.wait_lock()
  File "/usr/lib/python2.5/site-packages/bzrlib/lockdir.py", line 502, in wait_lock
    new_info = self.peek()
  File "/usr/lib/python2.5/site-packages/bzrlib/lockdir.py", line 418, in peek
    info = self._read_info_file(self._held_info_path)
  File "/usr/lib/python2.5/site-packages/bzrlib/lockdir.py", line 408, in _read_info_file
    return self._parse_info(self.transport.get(path))
  File "/usr/lib/python2.5/site-packages/bzrlib/lockdir.py", line 445, in _parse_info
    return read_stanza(info_file.readlines()).as_dict()
AttributeError: 'NoneType' object has no attribute 'as_dict'

bzr 1.0.0 on python 2.5.1.final.0 (linux2)
arguments: ['/usr/bin/bzr', 'commit']
encoding: 'UTF-8', fsenc: 'UTF-8', lang: 'en_US.UTF-8'
plugins:
  gtk /usr/lib/python2.5/site-packages/bzrlib/plugins/gtk [0.93.0]
  launchpad /usr/lib/python2.5/site-packages/bzrlib/plugins/launchpad [unknown]
  multiparent /usr/lib/python2.5/site-packages/bzrlib/plugins/multiparent.pyc [unknown]
*** Bazaar has encountered an internal error.
-----------------------------------------------------------------------

Revision history for this message
James Westby (james-w) wrote : Re: [Bug 190204] [NEW] After PC crash during commit, commit impossible in that branch

On Fri, 2008-02-08 at 14:53 +0000, Bloged wrote:
> Public bug reported:
>
> During commit the PC hang, Windows XP SP 2 with the standalone installer
> for Win32 latest version so PC had to be rebooted. Now all commits fail
> to that branch. Even commits from other workstations.
>

If you delete .bzr/branch/lock/ then you should be able to continue.

The issue was caused by a very badly timed crash.

Thanks,

James

Revision history for this message
John A Meinel (jameinel) wrote : Re: [Bug 190204] [NEW] After PC crash during commit, commit impossible in that branch

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

James Westby wrote:
| On Fri, 2008-02-08 at 14:53 +0000, Bloged wrote:
|> Public bug reported:
|>
|> During commit the PC hang, Windows XP SP 2 with the standalone installer
|> for Win32 latest version so PC had to be rebooted. Now all commits fail
|> to that branch. Even commits from other workstations.
|>
|
| If you delete .bzr/branch/lock/ then you should be able to continue.
|
| The issue was caused by a very badly timed crash.
|
| Thanks,
|
| James
|

Actually, you should just need to break .bzr/branch/lock/held

The problem is that we created a file in a different directory and then
renamed it. Apparently that was insufficient for the file to actually be
written to disk. (We should have already closed the file handle, etc
before we did the rename.)

However, Bazaar should be able to cope with this a bit better.

John
=:->

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

iD4DBQFHrKCsJdeBCYSNAAMRAmgDAKCG/e6R1sFA6P8zw4uCoYQyA0O5+QCXeGEa
+v/k+jOM12uFXj2klCUPFQ==
=mQaz
-----END PGP SIGNATURE-----

Revision history for this message
Arjan Gelderblom (launchpad-net-game-creators) wrote :

John A Meinel wrote:
Actually, you should just need to break .bzr/branch/lock/held

If you mean 'bzr break-lock' it results in an almost identical output:
-------------------------------------------
bzr: ERROR: exceptions.AttributeError: 'NoneType' object has no attribute 'as_dict'

Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 802, in run_bzr_catch_errors
    return run_bzr(argv)
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 758, in run_bzr
    ret = run(*run_argv)
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 492, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/usr/lib/python2.5/site-packages/bzrlib/builtins.py", line 3677, in run
    control.break_lock()
  File "/usr/lib/python2.5/site-packages/bzrlib/bzrdir.py", line 118, in break_lock
    thing_to_unlock.break_lock()
  File "/usr/lib/python2.5/site-packages/bzrlib/workingtree_4.py", line 228, in break_lock
    self.branch.break_lock()
  File "/usr/lib/python2.5/site-packages/bzrlib/branch.py", line 118, in break_lock
    master.break_lock()
  File "/usr/lib/python2.5/site-packages/bzrlib/branch.py", line 115, in break_lock
    self.repository.break_lock()
  File "/usr/lib/python2.5/site-packages/bzrlib/repository.py", line 589, in break_lock
    self.control_files.break_lock()
  File "/usr/lib/python2.5/site-packages/bzrlib/lockable_files.py", line 118, in break_lock
    self._lock.break_lock()
  File "/usr/lib/python2.5/site-packages/bzrlib/lockdir.py", line 335, in break_lock
    holder_info = self.peek()
  File "/usr/lib/python2.5/site-packages/bzrlib/lockdir.py", line 418, in peek
    info = self._read_info_file(self._held_info_path)
  File "/usr/lib/python2.5/site-packages/bzrlib/lockdir.py", line 408, in _read_info_file
    return self._parse_info(self.transport.get(path))
  File "/usr/lib/python2.5/site-packages/bzrlib/lockdir.py", line 445, in _parse_info
    return read_stanza(info_file.readlines()).as_dict()
AttributeError: 'NoneType' object has no attribute 'as_dict'

bzr 1.0.0 on python 2.5.1.final.0 (linux2)
arguments: ['/usr/bin/bzr', 'break-lock']
encoding: 'UTF-8', fsenc: 'UTF-8', lang: 'en_US.UTF-8'
plugins:
  gtk /usr/lib/python2.5/site-packages/bzrlib/plugins/gtk [0.93.0]
  launchpad /usr/lib/python2.5/site-packages/bzrlib/plugins/launchpad [unknown]
  multiparent /usr/lib/python2.5/site-packages/bzrlib/plugins/multiparent.pyc [unknown]
*** Bazaar has encountered an internal error.
-------------------------------------------

James Westby wrote:
If you delete .bzr/branch/lock/ then you should be able to continue.

Removing the empty directory still gives the same error and won't make commit available!

Grtz,
Bloged

Revision history for this message
John A Meinel (jameinel) wrote : Re: [Bug 190204] Re: After PC crash during commit, commit impossible in that branch

Bloged wrote:
> John A Meinel wrote:
> Actually, you should just need to break .bzr/branch/lock/held
>
>
> If you mean 'bzr break-lock' it results in an almost identical output:
...

> File "/usr/lib/python2.5/site-packages/bzrlib/repository.py", line 589, in break_lock
> self.control_files.break_lock()
> File "/usr/lib/python2.5/site-packages/bzrlib/lockable_files.py", line 118, in break_lock
> self._lock.break_lock()
...

>
> James Westby wrote:
> If you delete .bzr/branch/lock/ then you should be able to continue.
>
> Removing the empty directory still gives the same error and won't make
> commit available!
>
> Grtz,
> Bloged
>

You also need to delete .bzr/repository/lock/held

The traceback shows that it is failing on the repository lock, and not the
branch lock. (It probably failed on the branch lock earlier.)

John
=:->

Revision history for this message
Arjan Gelderblom (launchpad-net-game-creators) wrote :

John A Meinel wrote:
You also need to delete .bzr/repository/lock/held

Thanks that fixed the problem!

Grtz,

Bloged a.k.a. Arjan Gelderblom

Martin Albisetti (beuno)
Changed in bzr:
importance: Undecided → Medium
status: New → Triaged
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.