setting bug_reporting_guidelines for some packages fails

Bug #309056 reported by Brian Murray
2
Affects Status Importance Assigned to Milestone
Launchpad itself
Fix Released
High
Gavin Panella

Bug Description

Trying to set the bug_reporting_guidelines via the API on edge is resulting in an error depending on the package I'm trying to update. The output follows:

10:37:53 - flash:[...ents/canonical/launchpadlib] python package-bug-guidelines.py
Fail! for https://api.edge.launchpad.net/beta/ubuntu/+source/displayconfig-gtk
one() used with more than one result available

I've tried the following packages:

#'linux', # fail
#'linux-backports-modules-2.6.24', #fail
#'linux-backports-modules-2.6.27', #fail
#'linux-meta', # fail
#'linux-ports', # success it exists in intrepid + jaunty
#'linux-restricted-modules', #fail
#'linux-restricted-modules-2.6.24', # fail
#'linux-ubuntu-modules-2.6.24', # fail
#'bughelper', # fail it exists in feisty+
#'fwknop', #success jaunty only
'displayconfig-gtk', #fail gutsy + hardy

Revision history for this message
Gavin Panella (allenap) wrote :

This is the full traceback I get:

Fail! for https://api.edge.launchpad.net/beta/ubuntu/+source/displayconfig-gtk
one() used with more than one result available

Traceback (most recent call last):
  File "/srv/edge.launchpad.net/edge/launchpad-rev-7469/lib/zope/publisher/publish.py", line 133, in publish
    result = publication.callObject(request, obj)
  File "/srv/edge.launchpad.net/edge/launchpad-rev-7469/utilities/../lib/canonical/launchpad/webapp/publication.py", line 341, in callObject
    return mapply(ob, request.getPositionalArguments(), request)
  File "/srv/edge.launchpad.net/edge/launchpad-rev-7469/lib/zope/publisher/publish.py", line 108, in mapply
    return debug_call(obj, args)
  File "/srv/edge.launchpad.net/edge/launchpad-rev-7469/lib/zope/publisher/publish.py", line 114, in debug_call
    return obj(*args)
  File "/srv/edge.launchpad.net/edge/launchpad-rev-7469/utilities/../lib/canonical/lazr/rest/resource.py", line 596, in __call__
    result = self.do_PATCH(media_type, representation)
  File "/srv/edge.launchpad.net/edge/launchpad-rev-7469/utilities/../lib/canonical/lazr/rest/resource.py", line 775, in do_PATCH
    return self._applyChanges(changeset)
  File "/srv/edge.launchpad.net/edge/launchpad-rev-7469/utilities/../lib/canonical/lazr/rest/resource.py", line 1016, in _applyChanges
    entry_before_modification = Snapshot(
  File "/srv/edge.launchpad.net/edge/launchpad-rev-7469/utilities/../lib/canonical/launchpad/webapp/snapshot.py", line 52, in __init__
    value = getattr(ob, name, _marker)
  File "/srv/edge.launchpad.net/edge/launchpad-rev-7469/utilities/../lib/canonical/launchpad/database/distributionsourcepackage.py", line 209, in binary_package_names
    cache = DistributionSourcePackageCache.selectOne("""
  File "/srv/edge.launchpad.net/edge/launchpad-rev-7469/utilities/../lib/storm/sqlobject.py", line 352, in selectOne
    return SQLObjectResultSet(cls, *args, **kwargs)._one()
  File "/srv/edge.launchpad.net/edge/launchpad-rev-7469/utilities/../lib/storm/sqlobject.py", line 516, in _one
    return detuplelize(self._result_set.one())
  File "/srv/edge.launchpad.net/edge/launchpad-rev-7469/utilities/../lib/storm/store.py", line 1096, in one
    raise NotOneError("one() used with more than one result available")
NotOneError: one() used with more than one result available

Revision history for this message
Gavin Panella (allenap) wrote :

Originally a similar problem was happening when retrieving a source
package, because binary_package_names was being referenced. At that
time binary_package_names was exported in the webservices API. Later
we discovered that it was obsolete and actually broken (as you can see
in the traceback above). The solution with the smallest risk /
overhead / diff at the time was to not export binary_package_names in
the API.

However, it is haunting us still!

In canonical/lazr/rest/resource.py, line 1016, in
EntryResource._applyChanges:

    # Make a snapshot of the entry to use in a notification event.
    entry_before_modification = Snapshot(
        self.entry.context, providing=providedBy(self.entry.context))

Because binary_package_names is still declared in the interface (not
exported for the API, just declared), this Snapshot is referencing it,
and falling over, because the implementation of binary_package_names
is broken.

So, let's remove binary_package_names from IDistributionSourcePackage
and its implementations for ever!

Gavin Panella (allenap)
Changed in malone:
assignee: nobody → allenap
importance: Undecided → High
milestone: none → 2.2.1
status: New → In Progress
Revision history for this message
Gavin Panella (allenap) wrote :

In LP 7485.

Changed in malone:
status: In Progress → Fix Committed
Revision history for this message
Gavin Panella (allenap) wrote :

This should now be available on edge.

Changed in malone:
status: Fix Committed → Fix Released
Revision history for this message
Brian Murray (brian-murray) wrote :

Indeed it is now working for me thanks!

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.