When adding tag or updating description, lp_save() gives "HTTP Error 412: Precondition Failed"
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
lazr.restful |
Fix Released
|
High
|
Leonard Richardson | ||
lazr.restfulclient (Ubuntu) |
Invalid
|
High
|
Unassigned | ||
Lucid |
Invalid
|
High
|
Unassigned |
Bug Description
Getting this error consistently when attempting to add a tag using the following code (which worked last time I ran it a few weeks ago).
if not tag in bug.tags:
# Workaround bug #254901
print " ---> Tagged ",tag
I also tested with the commented line instead of the workaround code; same error.
Traceback (most recent call last):
File "./process-
bug.
File "/home/
self.
File "build/
File "build/
File "build/
launchpadlib.
Related branches
- Graham Binns (community): Approve (code)
-
Diff: 362 lines (+222/-29)3 files modifiedsrc/lazr/restful/_resource.py (+75/-28)
src/lazr/restful/example/base/tests/entry.txt (+146/-0)
src/lazr/restful/version.txt (+1/-1)
- Gary Poster (community): Approve
-
Diff: 246 lines (+140/-26)5 files modifiedlib/canonical/launchpad/pagetests/webservice/apidoc.txt (+1/-0)
lib/canonical/launchpad/pagetests/webservice/conditional-write.txt (+103/-0)
utilities/apidoc-index.pt (+27/-8)
utilities/create-lp-wadl-and-apidoc.py (+8/-17)
versions.cfg (+1/-1)
description: | updated |
Changed in launchpadlib: | |
importance: | Undecided → High |
status: | Confirmed → Triaged |
affects: | launchpadlib → lazr.restful |
Changed in lazr.restful: | |
assignee: | nobody → Leonard Richardson (leonardr) |
Changed in lazr.restful: | |
status: | Fix Committed → Fix Released |
tags: | added: tech-debt |
Changed in lazr.restful: | |
status: | Fix Committed → Fix Released |
Here are the last two requests:
send: 'PATCH /beta/bugs/292317 3cfeb7e05896b38 208e23ddc75
if-match: "72a9365dbdc47f
send: '{"tags": ["needs-xorglog"]}'
reply: 'HTTP/1.1 209 Content Returned\r\n'
send: 'PATCH /beta/bugs/292317 a42d5d0e5bc4aaf 14be1e73123" lspci-vvnn" ]}'
if-match: "7f60495c065527
send: '{"tags": ["needs-xorglog", "needs-
reply: 'HTTP/1.1 412 Precondition Failed\r\n'
Are you calling lp_save() twice, or just once? It would be helpful if you made a GET request after every call to lp_save(), to see what the server thinks the ETag is at each stage.
This might be a problem with the way launchpadlib handles the 209 response code.