ReadOnly error doing update due to url aliasing

Bug #792898 reported by Stuart Bishop
14
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Bazaar
Confirmed
Medium
Unassigned
Breezy
Triaged
Medium
Unassigned

Bug Description

$ bzr update
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/)

Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/bzrlib/commands.py", line 930, in exception_to_return_code
    return the_callable(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/bzrlib/commands.py", line 1130, 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 1483, in run
    old_tip = branch.update(possible_transports)
  File "/usr/lib/python2.7/dist-packages/bzrlib/decorators.py", line 217, in write_locked
    result = unbound(self, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/bzrlib/branch.py", line 2632, in update
    self.pull(master, overwrite=True)
  File "/usr/lib/python2.7/dist-packages/bzrlib/branch.py", line 1108, in pull
    possible_transports=possible_transports, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/bzrlib/decorators.py", line 217, in write_locked
    result = unbound(self, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/bzrlib/branch.py", line 3347, in pull
    master_branch.lock_write()
  File "/usr/lib/python2.7/dist-packages/bzrlib/remote.py", line 2770, in lock_write
    raise errors.ReadOnlyError(self)
ReadOnlyError: A write attempt was made in a read only transaction on RemoteBranch(bzr+ssh://bazaar.launchpad.net/~launchpad/lp-source-dependencies/trunk/)

You can report this problem to Bazaar's developers by running
    apport-bug /var/crash/bzr.1000.2011-06-04T19:52.crash
if a bug-reporting window does not automatically appear.

$ bzr info
Checkout (format: 2a)
Location:
       checkout root: .
  checkout of branch: bzr+ssh://bazaar.launchpad.net/%7Elaunchpad/lp-source-dependencies/trunk/

$ bzr version
Bazaar (bzr) 2.4b3
  Python interpreter: /usr/bin/python 2.7.1
  Python standard library: /usr/lib/python2.7
  Platform: Linux-2.6.38-8-generic-x86_64-with-Ubuntu-11.04-natty
  bzrlib: /usr/lib/python2.7/dist-packages/bzrlib
  Bazaar configuration: /home/stub/.bazaar
  Bazaar log file: /home/stub/.bzr.log

Copyright 2005-2011 Canonical Ltd.
http://bazaar.canonical.com/

bzr comes with ABSOLUTELY NO WARRANTY. bzr is free software, and
you may use, modify and redistribute it under the terms of the GNU
General Public License version 2 or later.

Bazaar is part of the GNU Project to produce a free operating system.

Revision history for this message
John A Meinel (jameinel) wrote : Re: [Bug 792898] [NEW] ReadOnly error doing update

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

On 6/4/2011 9:55 PM, Stuart Bishop wrote:
> Public bug reported:
>
> $ bzr update
> 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/)
>
> Traceback (most recent call last):
> File "/usr/lib/python2.7/dist-packages/bzrlib/commands.py", line 930, in exception_to_return_code
> return the_callable(*args, **kwargs)
> File "/usr/lib/python2.7/dist-packages/bzrlib/commands.py", line 1130, in run_bzr
...

> ReadOnlyError: A write attempt was made in a read only transaction on RemoteBranch(bzr+ssh://bazaar.launchpad.net/~launchpad/lp-source-dependencies/trunk/)
>
> You can report this problem to Bazaar's developers by running
> apport-bug /var/crash/bzr.1000.2011-06-04T19:52.crash
> if a bug-reporting window does not automatically appear.
>
>
> $ bzr info
> Checkout (format: 2a)
> Location:
> checkout root: .
> checkout of branch: bzr+ssh://bazaar.launchpad.net/%7Elaunchpad/lp-source-dependencies/trunk/

^- Your checkout is of ".../%7Elaunchpad" but the "update" is running
against "/~launchpad". I think just doing "bzr bind
lp:~launchpad/lp-source-dependencies/trunk" will be sufficient to get
you unstuck.

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

iEYEARECAAYFAk3s6UEACgkQJdeBCYSNAAPnFwCeKC5SntLpe7SjHQn51RsY1BOU
JscAoI8sYWfCtwPmskyMUo+EQ7guwP1V
=PdF/
-----END PGP SIGNATURE-----

Revision history for this message
Martin Pool (mbp) wrote : Re: ReadOnly error doing update

So what's the bug here? bzr needs to know they're the same object to lock them properly, but the name aliasing confuses it?

Martin Pool (mbp)
Changed in bzr:
status: New → Confirmed
importance: Undecided → Low
importance: Low → Medium
summary: - ReadOnly error doing update
+ ReadOnly error doing update due to url aliasing
Revision history for this message
Stuart Bishop (stub) wrote :

I can confirm John's workaround got the branch back on its feet.

Revision history for this message
Edmundo (eantoranz) wrote :

I just had a bug marked as a duplicate of this one. In my case I ran into the same error by doing a bzr update on a branch that is linked to a SVN branch.

https://bugs.launchpad.net/bugs/996747

Revision history for this message
Edmundo (eantoranz) wrote :
Download full text (3.6 KiB)

Just tried with bind and it's still failing (by the way, https+urllib adresses are saved as https, so I have to correct it by hand afterwards with bzr config).

$ bzr config
branch:
  bound_location = https+urllib://blahblah/svn.repos/blahblah/branches/abranch
  bound = True
  tab_width = 8
  parent_location = https+urllib://blahblah/svn.repos/blahblah/branches/abranch
  parent_branch = https+urllib://blahblah/svn.repos/blahblah/branches/abranch
  parent branch = https+urllib://blahblah/svn.repos/blahblah/branches/abranch
bazaar:
  [DEFAULT]
  email = Edmundo Carmona <email address hidden>

Then:
$ bzr update -Ossl.cert_reqs=none
Not checking SSL certificate for 192.168.162.30: 443
bzr: ERROR: bzrlib.errors.ReadOnlyError: A write attempt was made in a read only transaction on SvnBranch('https://blahblah/svn.repos/blahblah/branches/abranch')

Traceback (most recent call last):
  File "/usr/lib/python2.7/dist-packages/bzrlib/commands.py", line 920, in exception_to_return_code
    return the_callable(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/bzrlib/commands.py", line 1131, in run_bzr
    ret = run(*run_argv)
  File "/usr/lib/python2.7/dist-packages/bzrlib/commands.py", line 673, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/usr/lib/python2.7/dist-packages/bzrlib/commands.py", line 695, in run
    return self._operation.run_simple(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/bzrlib/cleanup.py", line 136, in run_simple
    self.cleanups, self.func, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/bzrlib/cleanup.py", line 166, in _do_with_cleanups
    result = func(*args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/bzrlib/builtins.py", line 1742, in run
    old_tip = branch.update(possible_transports)
  File "/usr/lib/python2.7/dist-packages/bzrlib/decorators.py", line 218, in write_locked
    result = unbound(self, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/bzrlib/branch.py", line 2715, in update
    self.pull(master, overwrite=True)
  File "/usr/lib/python2.7/dist-packages/bzrlib/branch.py", line 1133, in pull
    possible_transports=possible_transports, *args, **kwargs)
  File "/usr/lib/python2.7/dist-packages/bzrlib/plugins/svn/branch.py", line 989, in pull
    master_branch.lock_write()
  File "/usr/lib/python2.7/dist-packages/bzrlib/plugins/svn/branch.py", line 690, in lock_write
    raise ReadOnlyError(self)
ReadOnlyError: A write attempt was made in a read only transaction on SvnBranch('...

Read more...

Revision history for this message
Edmundo (eantoranz) wrote :

Interestingly, in this last attemp, I'm not being asked about username/password.

Revision history for this message
Tomasz Gajewski (tomga) wrote :

I've just had same problem and I managed to solve it by binding to svn+https instead of https+urllib.

Hope this will help with solving the issue or workaround it.

Jelmer Vernooij (jelmer)
tags: added: check-for-breezy
Jelmer Vernooij (jelmer)
tags: removed: check-for-breezy
Changed in brz:
status: New → Triaged
importance: Undecided → Medium
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.