urls compared in non-canonical form causes UnlockableTransport

Bug #139478 reported by danigm
This bug report is a duplicate of:  Bug #412223: bzr up locks master branch. Edit Remove
8
Affects Status Importance Assigned to Milestone
Bazaar
Confirmed
High
Unassigned

Bug Description

bzr up, in a application that I have checkout before.

bzr: ERROR: bzrlib.errors.UnlockableTransport: Cannot lock: transport is read only: <bzrlib.transport.http._urllib.HttpTransport_urllib url=http://bazaar.launchpad.net/%7Eawn-core/awn/trunk/.bzr/repository/>

Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 817, in run_bzr_catch_errors
    return run_bzr(argv)
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 779, in run_bzr
    ret = run(*run_argv)
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 477, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/usr/lib/python2.5/site-packages/bzrlib/builtins.py", line 1038, in run
    unversioned_filter=tree.is_ignored))
  File "/usr/lib/python2.5/site-packages/bzrlib/workingtree.py", line 2040, in update
    old_tip = self.branch.update()
  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/branch.py", line 1823, in update
    self.pull(master, overwrite=True)
  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/branch.py", line 1712, in pull
    master_branch.lock_write()
  File "/usr/lib/python2.5/site-packages/bzrlib/branch.py", line 1329, in lock_write
    repo_token = self.repository.lock_write()
  File "/usr/lib/python2.5/site-packages/bzrlib/repository.py", line 307, in lock_write
    result = self.control_files.lock_write(token=token)
  File "/usr/lib/python2.5/site-packages/bzrlib/lockable_files.py", line 258, in lock_write
    token_from_lock = self._lock.lock_write(token=token)
  File "/usr/lib/python2.5/site-packages/bzrlib/lockdir.py", line 556, in lock_write
    return self.wait_lock()
  File "/usr/lib/python2.5/site-packages/bzrlib/lockdir.py", line 485, in wait_lock
    return self.attempt_lock()
  File "/usr/lib/python2.5/site-packages/bzrlib/lockdir.py", line 450, in attempt_lock
    raise UnlockableTransport(self.transport)
UnlockableTransport: Cannot lock: transport is read only: <bzrlib.transport.http._urllib.HttpTransport_urllib url=http://bazaar.launchpad.net/%7Eawn-core/awn/trunk/.bzr/repository/>

bzr 0.90.0 on python 2.5.1.final.0 (linux2)
arguments: ['/usr/bin/bzr', 'update']

Tags: url
Revision history for this message
Warren Butler (grumpymole) wrote :

Same here. Started happening a couple of days ago. I only use bzr to check out and build locally the latest AWN trunk. This has worked fine for several weeks until a few days ago.

I do not change anything or try to commit anything back.

Original command was bzr co http://bazaar.launchpad.net/~awn-core/awn/trunk <dir>
Subsequent commands are bzr update from within <dir>

Bug #137157 seems to be a duplicate.

=========================Error output===============================

bzr: ERROR: bzrlib.errors.UnlockableTransport: Cannot lock: transport is read only: <bzrlib.transport.http._urllib.HttpTransport_urllib url=http://bazaar.launchpad.net/%7Eawn-extras/awn-extras/trunk/.bzr/repository/>

Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 817, in run_bzr_catch_errors
    return run_bzr(argv)
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 779, in run_bzr
    ret = run(*run_argv)
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 477, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/usr/lib/python2.5/site-packages/bzrlib/builtins.py", line 1038, in run
    unversioned_filter=tree.is_ignored))
  File "/usr/lib/python2.5/site-packages/bzrlib/workingtree.py", line 2040, in update
    old_tip = self.branch.update()
  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/branch.py", line 1823, in update
    self.pull(master, overwrite=True)
  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/branch.py", line 1712, in pull
    master_branch.lock_write()
  File "/usr/lib/python2.5/site-packages/bzrlib/branch.py", line 1329, in lock_write
    repo_token = self.repository.lock_write()
  File "/usr/lib/python2.5/site-packages/bzrlib/repository.py", line 307, in lock_write
    result = self.control_files.lock_write(token=token)
  File "/usr/lib/python2.5/site-packages/bzrlib/lockable_files.py", line 258, in lock_write
    token_from_lock = self._lock.lock_write(token=token)
  File "/usr/lib/python2.5/site-packages/bzrlib/lockdir.py", line 556, in lock_write
    return self.wait_lock()
  File "/usr/lib/python2.5/site-packages/bzrlib/lockdir.py", line 485, in wait_lock
    return self.attempt_lock()
  File "/usr/lib/python2.5/site-packages/bzrlib/lockdir.py", line 450, in attempt_lock
    raise UnlockableTransport(self.transport)
UnlockableTransport: Cannot lock: transport is read only: <bzrlib.transport.http._urllib.HttpTransport_urllib url=http://bazaar.launchpad.net/%7Eawn-extras/awn-extras/trunk/.bzr/repository/>

bzr 0.90.0 on python 2.5.1.final.0 (linux2)
arguments: ['/usr/bin/bzr', 'update']

** please send this report to <email address hidden>

Revision history for this message
James Westby (james-w) wrote : Re: [Bug 139478] bzr: ERROR: bzrlib.errors.UnlockableTransport

On (13/09/07 21:41), danigm wrote:
> Public bug reported:
>
> bzr up, in a application that I have checkout before.
>
> bzr: ERROR: bzrlib.errors.UnlockableTransport: Cannot lock: transport is
> read only: <bzrlib.transport.http._urllib.HttpTransport_urllib
> url=http://bazaar.launchpad.net/%7Eawn-core/awn/trunk/.bzr/repository/>

This always seems to be the one branch that triggers it. Is it a format
issue then? I was trying to debug this, but there was no --format option
to branch to get me an old format branch of this branch. (Working on the
assumption that the checkouts were done a while ago, as I can't
reproduce with recent formats, though there were no new revisions to
pull when I tried, so it might just miss the problem).

Thanks,

James

--
  James Westby -- GPG Key ID: B577FE13 -- http://jameswestby.net/
  seccure key - (3+)k7|M*edCX/.A:n*N!>|&7U.L#9E)Tu)T0>AM - secp256r1/nistp256

Revision history for this message
Martin Pool (mbp) wrote : Re: UnlockableTransport running update in checkout of readonly branch

This is similar to bug 129701, that running commit in a checkout of a readonly branch gives a traceback. However, there is a difference, which is that running commit in a readonly branch really should fail (but cleanly), whereas running update should not fail at all.

Changed in bzr:
importance: Undecided → Medium
status: New → Triaged
Revision history for this message
Martin Pool (mbp) wrote :

John suggests this may happen when a commit --local has been done before the update. Are there other circumstances? Will a plain checkout; update; update ever cause this?

Revision history for this message
Robert Collins (lifeless) wrote : Re: [Bug 139478] Re: UnlockableTransport running update in checkout of readonly branch

On Wed, 2007-10-03 at 22:40 +0000, Martin Pool wrote:
> John suggests this may happen when a commit --local has been done before
> the update. Are there other circumstances? Will a plain checkout;
> update; update ever cause this?

If that has been done, it should cause a pivot to occur - the local
branch's head becomes the master's, and the old head becomes a pending
merge.

Neither of which require write access to the master.

-Rob

--
GPG key available at: <http://www.robertcollins.net/keys.txt>.

Revision history for this message
Martin Pool (mbp) wrote : Re: UnlockableTransport running update in checkout of readonly branch

This seems to be commonly happening, but only reported in regard to this awn branch....

Changed in bzr:
importance: Medium → High
Revision history for this message
Tommi Vainikainen (thv) wrote :
Download full text (3.5 KiB)

Since I upgraded to bzr 1.17 I also got this when running "bzr up" to checkout from bzr+ssh://bazaar.launchpad.net/%7Ebzr/bzr-git/trunk/

bzr: ERROR: Cannot lock LockDir(lp-44636176:///~bzr/bzr-git/trunk/.bzr/branchlock): Transport operation not possible: readonly transport

Whole debug log from ~/.bzr.log is

0.121 bzr arguments: [u'up']
0.208 looking for plugins in /home/tvainika/.bazaar/plugins
0.270 looking for plugins in /usr/lib/python2.5/site-packages/bzrlib/plugins
0.580 encoding stdout as sys.stdout encoding 'UTF-8'
0.670 opening working tree '/home/tvainika/src/bzr-git/trunk'
1.189 bzr-svn: using Subversion 1.6.3 ()
1.626 opening SVN RA connection to 'bzr+ssh://bazaar.launchpad.net/~bzr/bzr-git/trunk'
1.635 ssh implementation is OpenSSH
5.163 opening SVN RA connection to 'bzr+ssh://bazaar.launchpad.net/~bzr/bzr-git/trunk'
5.512 opening SVN RA connection to 'bzr+ssh://bazaar.launchpad.net/~bzr/bzr-git/trunk'
7.941 Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 835, in exception_to_return_code
    return the_callable(*args, **kwargs)
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 1030, in run_bzr
    ret = run(*run_argv)
  File "/usr/lib/python2.5/site-packages/bzrlib/commands.py", line 647, in run_argv_aliases
    return self.run(**all_cmd_args)
  File "/usr/lib/python2.5/site-packages/bzrlib/builtins.py", line 1409, in run
    view_info=view_info), possible_transports=possible_transports)
  File "/usr/lib/python2.5/site-packages/bzrlib/workingtree.py", line 2190, in update
    old_tip = self.branch.update(possible_transports)
  File "/usr/lib/python2.5/site-packages/bzrlib/decorators.py", line 192, in write_locked
    result = unbound(self, *args, **kwargs)
  File "/usr/lib/python2.5/site-packages/bzrlib/branch.py", line 2396, in update
    self.pull(master, overwrite=True)
  File "/usr/lib/python2.5/site-packages/bzrlib/decorators.py", line 192, in write_locked
    result = unbound(self, *args, **kwargs)
  File "/usr/lib/python2.5/site-packages/bzrlib/branch.py", line 891, in pull
    possible_transports=possible_transports, *args, **kwargs)
  File "/usr/lib/python2.5/site-packages/bzrlib/branch.py", line 3145, in pull
    master_branch.lock_write()
  File "/usr/lib/python2.5/site-packages/bzrlib/remote.py", line 2178, in lock_write
    remote_tokens = self._remote_lock_write(token)
  File "/usr/lib/python2.5/site-packages/bzrlib/remote.py", line 2169, in _remote_lock_write
    repo_token or '', **err_context)
  File "/usr/lib/python2.5/site-packages/bzrlib/remote.py", line 54, in _call
    return self._client.call(method, *args)
  File "/usr/lib/python2.5/site-packages/bzrlib/smart/client.py", line 129, in call
    result, protocol = self.call_expecting_body(method, *args)
  File "/usr/lib/python2.5/site-packages/bzrlib/smart/client.py", line 142, in call_expecting_body
    method, args, expect_response_body=True)
  File "/usr/lib/python2.5/site-packages/bzrlib/smart/client.py", line 78, in _call_and_read_response
    expect_body=expect_response_body),
  File "/usr/lib/python2.5/site-packages/bzrlib/smart/message.py", line 306, in read_response...

Read more...

Revision history for this message
John A Meinel (jameinel) wrote : Re: [Bug 139478] Re: UnlockableTransport running update in checkout of readonly branch

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

Tommi Vainikainen wrote:
> Since I upgraded to bzr 1.17 I also got this when running "bzr up" to
> checkout from bzr+ssh://bazaar.launchpad.net/%7Ebzr/bzr-git/trunk/
>
> bzr: ERROR: Cannot lock LockDir(lp-44636176:///~bzr/bzr-
> git/trunk/.bzr/branchlock): Transport operation not possible: readonly
> transport
>

^- This is happening because the code changed to switch escaping rules.
So we have a saved location of:

.../%7E...

but you are now updating from:
.../~...

And the internal code uses:
  if url == saved_url:
    # updating from checkout master, just take a read lock
    tree.lock_read()
  else:
    tree.lock_write()

They no longer compare equal, so now you get a failure as you can't
write lock the master branch.

I don't know for sure the workaround, but something like:

bzr unbind; bzr bind; bzr up
or worst case

bzr unbind; bzr bind lp:bzr-git; bzr up

Should get it to work.

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

iEYEARECAAYFAkpocjsACgkQJdeBCYSNAAMt8QCeJW5Z21OOGDxvoxoyhjOCoC/6
eXQAoKUP0sM9Rm+zOVH0A8cUXt+8eNKo
=594x
-----END PGP SIGNATURE-----

Revision history for this message
Marius Kruger (amanica) wrote : Re: [Bug 139478] Re: UnlockableTransport running update in checkout of readonly branch

> ^- This is happening because the code changed to switch escaping rules.
> So we have a saved location of:
>
> .../%7E...
>
> but you are now updating from:
> .../~...

aha, thanks for the explanation, it all makes sense now.
I was hitting this a lot and almost gave up on checkouts of mainlines
on launchpad.

Revision history for this message
Robert Collins (lifeless) wrote : Re: [Bug 139478] Re: UnlockableTransport running update in checkout of readonly branch

 summary "urls compared in non-canonical form causes UnlockableTransport
running update"

This could lead to other problems in fetch. We should compare urls in
canonical form - the escaping rules are set by a standard. Human display
escaping should only be used to affect the UI/saved data on disk.

-Rob

summary: - UnlockableTransport running update in checkout of readonly branch
+ urls compared in non-canonical form causes UnlockableTransport
Martin Pool (mbp)
Changed in bzr:
status: Triaged → Confirmed
Jelmer Vernooij (jelmer)
tags: added: url
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.