bzr: ERROR: bzrlib.errors.ReadOnlyError: A write attempt was made in a read only transaction

Bug #786980 reported by Julian Edwards
38
This bug affects 5 people
Affects Status Importance Assigned to Milestone
Bazaar
Fix Released
High
Vincent Ladeuil
2.3
Fix Released
High
Vincent Ladeuil
2.4
Fix Released
High
Vincent Ladeuil
bzr (Ubuntu)
Fix Released
High
Jelmer Vernooij
Natty
Fix Released
High
Jelmer Vernooij

Bug Description

I am doing a "bzr up" in a checkout and getting this error:

bzr: ERROR: bzrlib.errors.ReadOnlyError: A write attempt was made in a read only transaction on RemoteBranch(bzr+ssh://bazaar.launchpad.net/~launchpad/lp-source-dependencies/trunk/)

Related branches

Revision history for this message
Julian Edwards (julian-edwards) wrote :

Crash log attached.

Revision history for this message
Henning Eggers (henninge) wrote :

My observations:

- The bug is in 2.3.3 but not in 2.3.1
- A newly created checkout of the same remote branch does not have the problem.

Henning

Revision history for this message
Jelmer Vernooij (jelmer) wrote : Re: [Bug 786980] Re: bzr: ERROR: bzrlib.errors.ReadOnlyError: A write attempt was made in a read only transaction

On Mon, 2011-05-23 at 13:16 +0000, Julian Edwards wrote:
> Crash log attached.
>
> ** Attachment added: "bzr.500.2011-05-23T13:10.crash"
> https://bugs.launchpad.net/bzr/+bug/786980/+attachment/2139605/+files/bzr.500.2011-05-23T13%3A10.crash
We shouldn't be trying to take a write lock on the master branch during
'bzr up'.

This code in InterBranch.push looks dodgy:

source_is_master = (self.source.user_url == bound_location)

I think we need to use has_same_location() there, as e.g. user_url might
have a slightly different URL (more or fewer slashes).

  status triaged
  importance high

Cheers,

Jelmer

Changed in bzr:
importance: Undecided → High
status: New → Triaged
Revision history for this message
Andrew Bennetts (spiv) wrote :

Jelmer: ITYM meant InterBranch.pull. Anyway I agree, or perhaps differently escaped versions of the same URL (e.g. ~ vs. %7E). Henning also reported this on IRC, with these details:

 * Error: ReadOnlyError: A write attempt was made in a read only transaction on RemoteBranch(bzr+ssh://bazaar.launchpad.net/~launchpad/lp-source-dependencies/trunk/)
 * bzr info excerpt: checkout of branch: bzr+ssh://bazaar.launchpad.net/%7Elaunchpad/lp-source-dependencies/trunk/

So same URL, different escaping. His original pastes are <http://paste.ubuntu.com/611700/> and <http://paste.ubuntu.com/611718/>.

On the other hand, the bzr info also said this:

  parent branch: bzr+ssh://bazaar.launchpad.net/%2Bbranch/lp-source-dependencies/

Which is a different URL that happens to be an alias for the same location — but only the server knows that. It would be good to know the exact value of self.source.user_url and bound_location in that traceback. Perhaps an affected person could run bzr with BZR_PDB=1 set in their environment and find out?

Changed in bzr:
status: Triaged → Confirmed
Revision history for this message
Aleksander Morgado (aleksander-m) wrote :

Confirmed here when bound_location has a final last slash less than self.source.user_url

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

This is blocking the bzr 2.3.3 SRU; if we fix it in 2.3.4 we might be able to SRU that.

Changed in bzr:
assignee: nobody → Vincent Ladeuil (vila)
Revision history for this message
Nicholas Allen (nick-allen) wrote :

Will this be fixed in 2.4? I'm still experiencing this and it's really making my workflow cumbersome...

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

Hi Nick, after this is merged into 2.3 it will be merged up into 2.4; unless there is some problem it should be it 2.4.0.

Revision history for this message
Nicholas Allen (nick-allen) wrote :

Great! Looking forward to this bug biting the dust!

Revision history for this message
Vincent Ladeuil (vila) wrote :

@Nicholas: If you're still experiencing this, your feedback on the proposed branch lp:~vila/bzr/786980-url-aliases is highly welcome !

Vincent Ladeuil (vila)
Changed in bzr:
status: Confirmed → In Progress
Vincent Ladeuil (vila)
Changed in bzr:
milestone: none → 2.5b1
status: In Progress → Fix Released
Jelmer Vernooij (jelmer)
Changed in bzr (Ubuntu):
status: New → Fix Released
importance: Undecided → High
Changed in bzr (Ubuntu Natty):
status: New → In Progress
importance: Undecided → High
assignee: nobody → Jelmer Vernooij (jelmer)
Changed in bzr (Ubuntu):
assignee: nobody → Jelmer Vernooij (jelmer)
Revision history for this message
Clint Byrum (clint-fewbar) wrote : Please test proposed package

Hello Julian, or anyone else affected,

Accepted bzr into natty-proposed, the package will build now and be available in a few hours. Please test and give feedback here. See https://wiki.ubuntu.com/Testing/EnableProposed for documentation how to enable and use -proposed. Thank you in advance!

Changed in bzr (Ubuntu Natty):
status: In Progress → Fix Committed
tags: added: verification-needed
Revision history for this message
Jelmer Vernooij (jelmer) wrote :

Verified by running the bzr testsuite from the package in a clean natty install.

tags: added: verification-done
removed: verification-needed
tags: added: verification-needed
removed: verification-done
Jelmer Vernooij (jelmer)
tags: added: verification-done
removed: verification-needed
Jelmer Vernooij (jelmer)
Changed in bzr (Ubuntu):
status: Fix Released → Triaged
assignee: Jelmer Vernooij (jelmer) → nobody
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package bzr - 2.3.4-0ubuntu1

---------------
bzr (2.3.4-0ubuntu1) natty-proposed; urgency=low

  * New upstream release.
   + Fix bzr version number in deprecation warnings. LP: #794960
   + Prevent write attemps on remote branch during "bzr up". LP: #786980
   + Fix conflict handling when two trees involved in a merge have different
     root ids. LP: #805809

bzr (2.3.3-0ubuntu1) natty-proposed; urgency=low

  * New upstream release.
   + Fixes deprecation warning on newer versions of Python. LP: #760435
   + Stops 'bzr push' from copying entire repository if a .bzr directory is
     present without a branch. LP: #465517
   + Fixes undefined local variable error when waiting for lock. LP: #733136
   + Fixes lock contention issues pushing to a bound branch. LP: #733350
   + Transfers less data creating a new stacked branch. LP: #737234
   + Several fixes to the test suite, making it more robust. LP: #654733,
      LP: #751824
   + 'bzr merge --pull --preview' actually shows a preview rather than
     actually merging. LP: #760152
   + bzr smart server now supports UTF-8 user names. LP: #659763
   + user identity can now be set based on username and /etc/mailname, not
     requiring it to be set manually. LP: #616878
   + stacking is now fully transitive. LP: #715000
   + makes in-terminal crash report of plugins much shorter. LP: #716389
 -- Jelmer Vernooij <email address hidden> Thu, 14 Jul 2011 21:12:58 +0200

Changed in bzr (Ubuntu Natty):
status: Fix Committed → Fix Released
Jelmer Vernooij (jelmer)
Changed in bzr (Ubuntu):
status: Triaged → In Progress
assignee: nobody → Jelmer Vernooij (jelmer)
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package bzr - 2.4.0-0ubuntu1

---------------
bzr (2.4.0-0ubuntu1) oneiric; urgency=low

  * New upstream release.
   + Fixes version number in deprecation warnings. LP: #794960
   + Fixes some spelling mistakes in manual page. LP: #814311
   + Prevents taking file system locks in read only transactions.
     LP: #786980
   + Fix support for configuration files containing UTF-8 data.
     LP: #688677
 -- Jelmer Vernooij <email address hidden> Sun, 14 Aug 2011 02:35:33 +0200

Changed in bzr (Ubuntu):
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

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