BranchTypeError calling requestMirror() on a mirrored branch

Bug #722143 reported by Max Bowsher
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Launchpad itself
Invalid
Critical
Unassigned

Bug Description

I'm trying to cause an immediate mirror of lp:~debian-bazaar/bzr-grep/unstable using `bzr lp-mirror`, which calls the requestMirror() API. It works fine in general, but for this particular branch I am getting a BranchTypeError in an HTTP 500 response with x-lazr-oopsid: OOPS-1877M950

Tags: api docs oops
Revision history for this message
Max Bowsher (maxb) wrote :

Also affecting lp:~debian-bazaar/bzr-explorer/unstable x-lazr-oopsid: OOPS-1877K863

But not affecting lp:~debian-bazaar/bzr/unstable, nor bzrtools, bzr-svn, bzr-git etc.

Revision history for this message
Curtis Hovey (sinzui) wrote :

Both TB take the same path through the code:
  Module lazr.restful._resource, line 928, in __call__
    result = self.do_POST()
  Module lazr.restful._resource, line 765, in do_POST
    return self.handleCustomPOST(operation_name)
  Module lazr.restful._resource, line 1371, in handleCustomPOST
    value = super(EntryResource, self).handleCustomPOST(operation_name)
  Module lazr.restful._resource, line 749, in handleCustomPOST
    return operation()
  Module lazr.restful._operation, line 83, in __call__
    response = self.call(**values)
  Module lazr.restful.declarations, line 1210, in call
    result = self._getMethod()(**params)
  Module lp.code.model.branch, line 963, in requestMirror
    raise BranchTypeError(self.unique_name)
BranchTypeError: ~bzr-explorer-dev/bzr-explorer/trunk

The code does this:

    def requestMirror(self):
        """See `IBranch`."""
        if self.branch_type in (BranchType.REMOTE, BranchType.HOSTED):
            raise BranchTypeError(self.unique_name)

It looks like this method cannot be used a remote branch. This error should be converted to a HTTP code and the method documentation should make it clear the branch most be MIRRORED or IMPORTED.

Changed in launchpad:
status: New → Triaged
importance: Undecided → Critical
tags: added: api docs oops
Revision history for this message
Curtis Hovey (sinzui) wrote :

I see neglected to notice that the requested branch, "unstable", and the branched that errors, "trunk". It think the code in lp-mirror does not reconcile some situations with stacked branches.

Revision history for this message
Max Bowsher (maxb) wrote :

Yes, this is a fault in bzr lp-mirror, no problem with Launchpad.

Changed in launchpad:
status: Triaged → Invalid
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.