AttributeError getting archive subscriptions for a given person

Bug #823473 reported by Diogo Matsubara
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Launchpad itself
Fix Released
Critical
Graham Binns

Bug Description

OOPS-2045DV1 shows an AttributeError: 'NoneType' object has no attribute 'using' raised while using the API to get a list of archive subscriptions for a given person.

   Traceback (most recent call last):
  Module zope.publisher.publish, line 131, in publish
    obj = request.traverse(obj)
  Module lazr.restful.publisher, line 275, in traverse
    result = super(WebServiceRequestTraversal, self).traverse(ob)
  Module zope.publisher.browser, line 542, in traverse
    ob = super(BrowserRequest, self).traverse(obj)
  Module zope.publisher.http, line 455, in traverse
    ob = super(HTTPRequest, self).traverse(obj)
  Module zope.publisher.base, line 261, in traverse
    obj = publication.traverseName(self, obj, entry_name)
  Module lazr.restful.publisher, line 120, in traverseName
    request, ob, name)
  Module zope.app.publication.zopepublication, line 197, in traverseName
    ob2 = adapter.publishTraverse(request, nm)
  Module canonical.launchpad.webapp.publisher, line 672, in publishTraverse
    nextobj = self._publishTraverse(request, name)
  Module canonical.launchpad.webapp.publisher, line 768, in _publishTraverse
    nextobj = handler(self, nextstep)
  Module lp.soyuz.browser.archive, line 321, in traverse_subscription
    person, archive=self.context)
  Module lp.soyuz.model.archivesubscriber, line 192, in getBySubscriber
    return self._getBySubscriber(subscriber, archive, current_only, False)
  Module lp.soyuz.model.archivesubscriber, line 185, in _getBySubscriber
    return store.using(*origin).find(
AttributeError: 'NoneType' object has no attribute 'using'

Related branches

tags: added: critical-analysis
Revision history for this message
Francis J. Lacoste (flacoste) wrote :

traverse_subscription is buggy:

        try:
            person = getUtility(IPersonSet).getByName(person_name)
        except NotFoundError:
            return None

getByName doesn't raise NotFoundError when the name doesn't exist but return None instead, thus passing None as the subscriber name in getBySubscriber.

tags: added: easy
tags: added: trivial
removed: easy
Graham Binns (gmb)
Changed in launchpad:
status: Triaged → In Progress
Graham Binns (gmb)
Changed in launchpad:
assignee: nobody → Graham Binns (gmb)
Revision history for this message
Launchpad QA Bot (lpqabot) wrote :
tags: added: qa-needstesting
Changed in launchpad:
status: In Progress → Fix Committed
Graham Binns (gmb)
tags: added: qa-ok
removed: qa-needstesting
William Grant (wgrant)
Changed in launchpad:
status: Fix Committed → Fix Released
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.