transitionToTarget for an Ubuntu package yields HTTP 500 error

Bug #342355 reported by Martin Pitt
12
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Launchpad itself
Fix Released
High
Eleanor Berger

Bug Description

I cannot figure out how to use bug_task.transitionToTarget() with an Ubuntu package. The API doc just says it expects a bug_target object, but not how to get one. I tried (on staging):

>>> b = c.launchpad.bugs[341518]
>>> list(b.bug_tasks)
[<bug_task at https://api.staging.launchpad.net/beta/ubuntu/+bug/341518>]
>>> b.bug_tasks[0].target
<distribution at https://api.staging.launchpad.net/beta/ubuntu>

>>> b.bug_tasks[0].transitionToTarget(target=c.launchpad.distributions['ubuntu'].getSourcePackage(name='coreutils'))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.6/dist-packages/launchpadlib/resource.py", line 349, in __call__
    url, in_representation, http_method, extra_headers=extra_headers)
  File "/usr/lib/python2.6/dist-packages/launchpadlib/_browser.py", line 212, in _request
    raise HTTPError(response, content)
launchpadlib.errors.HTTPError: HTTP Error 500: Internal Server Error

I also tried a link, but doesn't work either:

>>> b.bug_tasks[0].transitionToTarget(target='https://api.staging.launchpad.net/beta/ubuntu/+source/coreutils')
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.6/dist-packages/launchpadlib/resource.py", line 349, in __call__
    url, in_representation, http_method, extra_headers=extra_headers)
  File "/usr/lib/python2.6/dist-packages/launchpadlib/_browser.py", line 212, in _request
    raise HTTPError(response, content)
launchpadlib.errors.HTTPError: HTTP Error 500: Internal Server Error

Am I doing something wrong here?

Tags: lp-bugs
Revision history for this message
Eleanor Berger (intellectronica) wrote :

This is not a duplicate of bug #329917

Revision history for this message
Kees Cook (kees) wrote :

Comments from bug #329917:

Kees:
This appears to only fail when there is no package already assigned. I.e. if the task is "vlc (Ubuntu)" and I switch it to "linux", the API works. If the task is "Ubuntu" and I switch it to "linux", it fails.

Graham Binns:
This bug is happening because the NullBugTask code is being triggered. *Why* it's being triggered, I don't know. It's possible that this is a race condition, but that seems unlikely.

This needs to be dealt with quickly, as it's now causing quite a lot of problems.

Revision history for this message
Eleanor Berger (intellectronica) wrote :

This bug happens when you try to switch from a task on a distribution to a task on a distro package.

Changed in malone:
status: New → Triaged
importance: Undecided → High
assignee: nobody → Tom Berger (intellectronica)
milestone: none → 3.1.10
Revision history for this message
Diogo Matsubara (matsubara) wrote : Bug fixed by a commit
Changed in malone:
status: Triaged → Fix Committed
Revision history for this message
Brian Murray (brian-murray) wrote :

Martin - I went ahead and cleaned up most of all the old apport-crash reports without a package using transitionToTarget and it is working fine. However, the retracer doesn't seem to be doing this now - do you know why?

Revision history for this message
Martin Pitt (pitti) wrote :

As I said, apport currently tries

                bug.bug_tasks[0].transitionToTarget(target=self.lp_distro.getSourcePackage(name="mysourcepackage"))

Perhaps it's the wrong datatype for the "target" argument? What did you use?

Revision history for this message
Eleanor Berger (intellectronica) wrote :

@pitti, yes that should be the correct argument type. Do you still get this problem now? The fix has been on edge for a couple of weeks already.

Revision history for this message
Martin Pitt (pitti) wrote :

Right, seems it's working now; I removed the try/except workaround from apport's trunk.

Thanks!

Changed in malone:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.