Changing a task's target using the API OOPSes as NotImplementedError

Bug #329917 reported by Ursula Junque
18
This bug affects 2 people
Affects Status Importance Assigned to Milestone
Launchpad itself
Invalid
High
Unassigned
launchpadlib
Fix Released
Undecided
Unassigned

Bug Description

As seen on OOPS-1138EC328, OOPS-1143S70.

I could reproduce trying to transitionToTarget twice. The first time it returned without error (but the target was still the old one), and the second it returned a 500 error, producing OOPS-1143S70.

In [21]: bug = lp.bugs[82110]
In [22]: bug_task = bug.bug_tasks[0]
In [23]: bug_task
Out[23]: <bug_task at https://api.staging.launchpad.net/beta/ubuntu/+source/xserver-xorg-video-intel/+bug/82110>
In [24]: bug_task.target
Out[24]: <distribution_source_package at https://api.staging.launchpad.net/beta/ubuntu/+source/xserver-xorg-video-intel>
In [25]: bug_task.transitionToTarget(target="https://api.staging.launchpad.net/beta/ubuntu/+source/xserver-xorg-input-evdev")
In [26]: bug_task.transitionToTarget(target="https://api.staging.launchpad.net/beta/ubuntu/+source/xserver-xorg-input-evdev")
...
HTTPError: HTTP Error 500: Internal Server Error

Ursula Junque (ursinha)
description: updated
Revision history for this message
Brian Murray (brian-murray) wrote :

I swear I was using this the other week but now it is failing for me with an AttributeError.

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

For me it's still oopsing right at the first try (see my duplicate bug 342355):

  File "apport/crashdb_impl/launchpad.py", line 332, in update
    bug.bug_tasks[0].transitionToTarget(target=src)
  File "/usr/lib/python2.6/dist-packages/lazr/restfulclient/resource.py", line 460, in __call__
    url, in_representation, http_method, extra_headers=extra_headers)
  File "/usr/lib/python2.6/dist-packages/lazr/restfulclient/_browser.py", line 204, in _request
    raise HTTPError(response, content)
HTTPError: HTTP Error 500: Internal Server Error

I supplied the result of self.lp_distro.getSourcePackage(name='coreutils') as target= argument (Ursula used a string), but as I said in bug 342355 it's not actually clear what kind of argument type the target option expects (I guess getSourcePackage() should deliver a valid type, though).

Changed in malone:
status: New → Confirmed
tags: added: ubuntu-qa
Revision history for this message
Kees Cook (kees) wrote :

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.

Revision history for this message
Bryce Harrington (bryce) wrote :

Using the attached launchpadlib script I was able to reproduce the error only if the project was set to none (i.e. "Ubuntu"), at which point it generated this traceback:

Traceback (most recent call last):
  File "./test", line 27, in <module>
    bugtask.transitionToTarget(target = target)
  File "/usr/lib/python2.6/dist-packages/lazr/restfulclient/resource.py", line 460, in __call__
    url, in_representation, http_method, extra_headers=extra_headers)
  File "/usr/lib/python2.6/dist-packages/lazr/restfulclient/_browser.py", line 204, in _request
    raise HTTPError(response, content)
lazr.restfulclient.errors.HTTPError: HTTP Error 500: Internal Server Error

Revision history for this message
Bryce Harrington (bryce) wrote :

debug output from above script when it failed...

Revision history for this message
Graham Binns (gmb) wrote :

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.

Changed in malone:
importance: Undecided → High
milestone: none → 3.1.10
status: Confirmed → Triaged
tags: added: regression
tags: removed: regression
Revision history for this message
Eleanor Berger (intellectronica) wrote :

The reason Ursula's example is failing is because the task's URI, which is how it's being identified by the API, changes after the target changes. The workaround is to re-fetch the task (using the new URL) after the target has changed. I'm pretty sure there's a launchpadlib bug for making this workaround built-in, but I can't find it right now.

Changed in malone:
status: Triaged → Invalid
Revision history for this message
Kees Cook (kees) wrote : Re: API cannot be used to set a package target for a bugtask when bugtask lacks a package

Bug 342355 has been split from this...

summary: - Changing a task's target using the API OOPSes as NotImplementedError
+ API cannot be used to set a package target for a bugtask when bugtask
+ lacks a package
Changed in malone:
status: Invalid → Confirmed
status: Confirmed → Invalid
summary: - API cannot be used to set a package target for a bugtask when bugtask
- lacks a package
+ Changing a task's target using the API OOPSes as NotImplementedError
Deryck Hodge (deryck)
Changed in malone:
milestone: 3.1.10 → none
Revision history for this message
Diogo Matsubara (matsubara) wrote :

I couldn't reproduce this bug with the examples given. Might have been fixed already. Can you reproduce?

Changed in launchpadlib:
status: New → Incomplete
Revision history for this message
Leonard Richardson (leonardr) wrote :

This was probably fixed when we changed launchpadlib to re-fetch an object after a POST named operation.

Revision history for this message
Brian Murray (brian-murray) wrote :

I have not had an issue with this in quite some time and have been using a bughugger plugin for assigning no package bug reports to packages so I imagine its fixed.

Revision history for this message
Gary Poster (gary) wrote :

Optimistically marked as Fix Released, given comments.

Changed in launchpadlib:
status: Incomplete → 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

Bug attachments

Remote bug watches

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