changing bugtask attributes via api gives "412 precondition failed"
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
Launchpad itself |
Fix Released
|
Critical
|
James Westby |
Bug Description
When I try to set the importance of a bugtask through the api (using Hydrazine) it always fails with "412 Precondition Failed." This was working last week and now fails 100% of the time.
All the application code is doing is assigning to the importance field of a bugtask.
hydrazine(edge) #532600> importance wishlist
send: 'GET /beta/bugs/
reply: 'HTTP/1.1 200 Ok\r\n'
header: Date: Sun, 07 Mar 2010 22:17:55 GMT
header: Server: zope.server.http (HTTP)
header: X-Powered-By: Zope (www.zope.org), Python (www.python.org)
header: Content-Type: application/json
header: Content-Length: 1236
header: Vary: Cookie,
header: Via: 1.1 wildcard.
changing importance Undecided => Wishlist
send: u'PATCH /beta/bzr/
send: '{"importance": "Wishlist"}'
reply: 'HTTP/1.1 412 Precondition Failed\r\n'
header: Date: Sun, 07 Mar 2010 22:17:56 GMT
header: Server: zope.server.http (HTTP)
header: X-Powered-By: Zope (www.zope.org), Python (www.python.org)
header: X-Content-
header: Content-Type: text/plain
header: Content-Length: 0
header: Vary: Cookie,
header: Via: 1.1 wildcard.
HTTP Error 412: Precondition Failed
Response headers:
---
content-length: 0
content-type: text/plain
date: Sun, 07 Mar 2010 22:17:56 GMT
server: zope.server.http (HTTP)
status: 412
vary: Cookie,
via: 1.1 wildcard.
x-content-
x-powered-by: Zope (www.zope.org), Python (www.python.org)
---
Response body:
---
---
hydrazine(edge) #532600>
Related branches
- Francis J. Lacoste (community): Approve (release-critical)
- Eleanor Berger (community): Approve
-
Diff: 37 lines (+2/-11)2 files modifiedlib/lp/bugs/interfaces/bugtask.py (+2/-4)
lib/lp/bugs/stories/webservice/xx-bug.txt (+0/-7)
- Francis J. Lacoste (community): Approve (release-critical)
- Eleanor Berger (community): Approve (code)
-
Diff: 37 lines (+2/-11)2 files modifiedlib/lp/bugs/interfaces/bugtask.py (+2/-4)
lib/lp/bugs/stories/webservice/xx-bug.txt (+0/-7)
tags: | added: api |
summary: |
- can't update bugtask importance via api + changing bugtask attributes via api gives "412 precondition failed" |
Changed in malone: | |
importance: | High → Critical |
milestone: | none → 10.03 |
assignee: | nobody → James Westby (james-w) |
Changed in malone: | |
status: | Fix Committed → In Progress |
Changed in malone: | |
status: | In Progress → Fix Committed |
tags: |
added: qa-ok removed: qa-needstesting |
Martin,
Could you please dump the json of the task before you get the error, and then after a .lp_refresh()
after you get it. This will show whether something has changed, or there is an etag calculation issue.
This is a problem which there can be many causes for, and so we need to no which it is
before we can look at tackling it.
You can dump the json with something like
print bug_task. _wadl_resource. _definition. representation
Doing bug_task. lp_refresh( ) will then fetch it again from the server and so printing the same
thing will show what changed, if anything.
Thanks,
James