Stacking loop causes unhelpful "unable to obtain lock" errors during "bzr up"

Bug #726976 reported by Jay Vora (Serpent Consulting Services)
42
This bug affects 5 people
Affects Status Importance Assigned to Milestone
Bazaar
Confirmed
High
Unassigned

Bug Description

lp:~openerp/openobject-server/5.0 says and lp:~openerp/openobject-server/trunk claim to be stacked on each other (presumably due to bug 377519). This causes bzr to emit confusing errors like the following:

"""
bzr up
Doing on-the-fly conversion from RemoteRepositoryFormat(_network_name='Bazaar repository format 2a (needs bzr 1.16 or later)\n') to RepositoryFormatKnitPack4().
This may take some time. Upgrade the repositories to the same format for better performance.
Unable to obtain lock held by <email address hidden>
at crowberry [process #12281], acquired 11 seconds ago.
See "bzr help break-lock" for more.
bzr: ERROR: Could not acquire lock "(remote lock)": bzr+ssh://bazaar.launchpad.net/~openerp/openobject-server/5.0/
"""

Instead bzr should detect the stacking loop, and give the user a helpful error. Something like this perhaps:

bzr: ERROR: Cannot open bzr+ssh://bazaar.launchpad.net/~openerp/openobject-server/5.0/: stacking loop detected with bzr+ssh://bazaar.launchpad.net/~openerp/openobject-server/trunk/. The configuration of those branches must be fixed before they can be used.

tags: added: lock
description: updated
Revision history for this message
Andrew Bennetts (spiv) wrote :

The root cause of this is bug 377519: lp:~openerp/openobject-server/5.0 says it is stacked on lp:~openerp/openobject-server/trunk, but lp:~openerp/openobject-server/trunk says it is stacked on lp:~openerp/openobject-server/5.0. This is almost certainly due to branch renames done via Launchpad, but due to bug 377519 Launchpad doesn't update the stacked-on locations when renames happen.

The workaround is as described in the comments of that bug. (Edit the .bzr/branch/branch.conf files for those branches via SFTP.)

Bzr itself could be more helpful in detecting this situation (a loop in stacked-on locations) and guiding the user towards fixing it, so I'll leave this bug open for that aspect.

summary: - Any command of bzr runs for 11 seconds an shows a lock of itself
+ Stacking loop causes unhelpful "unable to obtain lock" errors during
+ "bzr up"
tags: added: stacking
removed: lock
Andrew Bennetts (spiv)
description: updated
Changed in bzr:
importance: Undecided → High
status: New → Confirmed
Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) wrote :

Thanks for the Rapid action Andrew.

There is no doubt why Bzr is one the the best VCS.

Thanks.

Revision history for this message
Jay Vora (Serpent Consulting Services) (jayvora) wrote :

Hello Andrew,

I just changed the repository from checkout to normal branch and I got it working for me.

Should this lead to close the bug?

Thanks.

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

Hi Jay,

No, the bug still exists, but that's a good workaround for it.

Revision history for this message
Robert Collins (lifeless) wrote : Re: [Bug 726976] Re: Stacking loop causes unhelpful "unable to obtain lock" errors during "bzr up"

This makes me suspect its the %7E vs ~ thing leading to a checkout
thinking it has a different parent and locking its own master twice.

Revision history for this message
Olivier Dony (Odoo) (odo-openerp) wrote :

Actually I ran some tests to see how I should fix the branches mentioned in this bug, but I couldn't figure out if something needed to be fixed.

When I create test stacked branches, the parent_location *and* stacked_on_location are both set in the branch.conf on bazaar.launchpad.net. If I empty the branch.conf via sftp, I can indeed make the branch unusable because it cannot locate its revisions.
If I then do a push --overwrite, it apparently re-uploads all revisions, resets the branch to being non-stacked, and make it usable again (but not stacked). Interestingly, this is also one of the only ways I found to be able to create push new non-stacked branches in existing projects.

Now, for our aforementioned branches, only the parent_location is set in branch.conf, and I do not understand how this is related to stacking, as none of the branches seem to be stacked (perhaps they were before).
But both branches have their parent location pointing to each other, indeed.

The database doesn't seem to think there is any stacking either, because the branches' pages at code.launchpad.net do no say they are stacked.

So... as apparently there is no stacking, is it safe for us to remove the parent_location in the branch.conf of these branches? (or at least in one of them?). What is its purpose?

Thanks!

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

On 5 March 2011 00:19, Olivier Dony (OpenERP) <email address hidden> wrote:
> Actually I ran some tests to see how I should fix the branches mentioned
> in this bug, but I couldn't figure out if something needed to be fixed.
>
> When I create test stacked branches, the parent_location *and* stacked_on_location are both set in the branch.conf on bazaar.launchpad.net. If I empty the branch.conf via sftp, I can indeed make the branch unusable because it cannot locate its revisions.
> If I then do a push --overwrite, it apparently re-uploads all revisions, resets the branch to being non-stacked, and make it usable again (but not stacked). Interestingly, this is also one of the only ways I found to be able to create push new non-stacked branches in existing projects.
>
> Now, for our aforementioned branches, only the parent_location is set in branch.conf, and I do not understand how this is related to stacking, as none of the branches seem to be stacked (perhaps they were before).
> But both branches have their parent location pointing to each other, indeed.
>
> The database doesn't seem to think there is any stacking either, because
> the branches' pages at code.launchpad.net do no say they are stacked.
>
> So... as apparently there is no stacking, is it safe for us to remove
> the parent_location in the branch.conf of these branches? (or at least
> in one of them?). What is its purpose?

The parent_location gives the default source for pull and merge
commands, if no location is given on the command line. It shouldn't
have any affect on stacking. If removing it makes things work then
they previously weren't, that's interesting information for this bug.

Revision history for this message
Andrew Bennetts (spiv) wrote :

Perhaps bug 733350 is related?

Jelmer Vernooij (jelmer)
tags: added: check-for-breezy
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.