ReadOnly error when running bzr review-submit

Bug #195217 reported by Matthew Paul Thomas
6
Affects Status Importance Assigned to Milestone
Bazaar
Won't Fix
Undecided
Unassigned
lpreview
Fix Released
Undecided
Unassigned

Bug Description

This error happens even after running "bzr break-lock":

10:46:39@2008-02-codehosting> bzr review-submit
Checking that the public branch is up to date ...
Checking the working tree is clean ...
bzr: ERROR: bzrlib.errors.ReadOnlyError: A write attempt was made in a read only transaction on LockableFiles(lock, file:///home/mpt/hacking/lpsrc/trunk/.bzr/repository/)

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 "/home/mpt/.bazaar/plugins/lpreview/__init__.py", line 329, in run
    get_diff_as_merged(target_branch, merge_source_branch, diff_file)
  File "/home/mpt/.bazaar/plugins/lpreview/__init__.py", line 39, in get_diff_as_merged
    None, merge_source_branch, merge_source_branch)
  File "/usr/lib/python2.5/site-packages/bzrlib/merge.py", line 144, in from_revision_ids
    merger.set_other_revision(other, other_branch)
  File "/usr/lib/python2.5/site-packages/bzrlib/merge.py", line 286, in set_other_revision
    self._maybe_fetch(other_branch, self.this_branch, self.other_rev_id)
  File "/usr/lib/python2.5/site-packages/bzrlib/merge.py", line 308, in _maybe_fetch
    target.fetch(source, revision_id)
  File "/usr/lib/python2.5/site-packages/bzrlib/decorators.py", line 163, in write_locked
    self.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 225, in lock_write
    raise errors.ReadOnlyError(self)
ReadOnlyError: A write attempt was made in a read only transaction on LockableFiles(lock, file:///home/mpt/hacking/lpsrc/trunk/.bzr/repository/)

bzr 1.0.0 on python 2.5.1.final.0 (linux2)
arguments: ['/usr/bin/bzr', 'review-submit']
encoding: 'UTF-8', fsenc: 'UTF-8', lang: 'en_NZ.UTF-8'
plugins:
  launchpad /usr/lib/python2.5/site-packages/bzrlib/plugins/launchpad [unknown]
  lpreview /home/mpt/.bazaar/plugins/lpreview [unknown]
  multiparent /usr/lib/python2.5/site-packages/bzrlib/plugins/multiparent.pyc [unknown]
  pqm /home/mpt/.bazaar/plugins/pqm [0.92.0dev0]
*** Bazaar has encountered an internal error.

The same error occurs with bzr 1.2.0.

description: updated
description: updated
Revision history for this message
Eleanor Berger (intellectronica) wrote :

Abel, this looks very similar to what you reported is happening on your machine. Maybe you can help us get more information on what is happening and why?

Revision history for this message
Aaron Bentley (abentley) wrote :

This is due to using the actual merge code for generating the preview diff. When you merge, all the revisions involved in the merge are copied into the repository of the branch that you're merging into. Changing this would be nontrivial.

Revision history for this message
Aaron Bentley (abentley) wrote :

Ignore most of what I said. While the fetch does need to happen, that shouldn't be a problem, unless your target branch is marked read-only. This is just a locking issue.

Revision history for this message
Abel Deuring (adeuring) wrote : Re: [Bug 195217] Re: ReadOnly error when running bzr review-submit

On 23.04.2008 15:36, Tom Berger wrote:
> Abel, this looks very similar to what you reported is happening on your
> machine. Maybe you can help us get more information on what is happening
> and why?
>

The traceback is the same as the one reported by mpt; I'm running bzr
version 1.4rc1.

"bzr break-lock" on the local copy of the trunk does not help; as a
workaround, I created a branch "trunk1", which is just a copy of the
trunk, and running "bzr review-submit -t ../trunk1" works, at least
sometimes. "bzr review-submit" without any parameter worked for me for a
while, and it seems to works on some branches even at present: I just
tried it on hwdb-device-classes-3, but when I really submitted that
branch, I got the ReadOnlyError...

Sorry, I know all that sounds really fuzzy (or confused...), but I don't
have any better information.

Revision history for this message
Aaron Bentley (abentley) wrote :

Here's a patch that fixes it. I've already submitted it to mwh.

Revision history for this message
Barry Warsaw (barry) wrote :

Not that I have a solution, but I remember hitting this the first time I tried to use the plugin. I "fixed" it by blowing away my rocketfuel working tree and re-branching it.

Changed in bzr-lpreview:
status: New → Fix Committed
Revision history for this message
Aaron Bentley (abentley) wrote :

Avoiding the requirement for a write lock on the repo would require major surgery and generally not be worth it. However, the plugin can just take a write lock earlier.

Changed in bzr:
status: New → Won't Fix
Aaron Bentley (abentley)
Changed in bzr-lpreview:
status: Fix Committed → Fix Released
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.