Comment 22 for bug 336866

Revision history for this message
Bryce Harrington (bryce) wrote : Re: [Bug 336866] Re: When adding tag or updating description, lp_save() gives "HTTP Error 412: Precondition Failed"

Awesome! Looking forward to trying it out.

On Thu, Apr 23, 2009 at 05:53:03PM -0000, Leonard Richardson wrote:
> The culprit is a combination of the unmarshalled_field_cache and the
> ObjectModifiedEvent. The OME modified date_last_updated, but
> lazr.restful didn't hear about it, and only removed the fields the
> client modified from unmarshalled_field_cache. So the old
> date_last_updated stays in there.
>
> I have a fix but since the lazr.restful example service doesn't use OMEs
> at all, a proper test will take a little while.
>
> --
> When adding tag or updating description, lp_save() gives "HTTP Error 412: Precondition Failed"
> https://bugs.launchpad.net/bugs/336866
> You received this bug notification because you are a direct subscriber
> of the bug.
>
> Status in Launchpad web services client library: Triaged
>
> 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:
> #bug.tags.append(tag)
> # Workaround bug #254901
> tag_list = bug.tags
> tag_list.append(tag)
> bug.tags = tag_list
>
> print " ---> Tagged ",tag
> bug.lp_save()
>
> I also tested with the commented line instead of the workaround code; same error.
>
> Traceback (most recent call last):
> File "./process-new-bugs.py", line 175, in <module>
> bug.append_tag("needs-lspci-vvnn")
> File "/home/bryce/src/Arsenal/arsenal/contrib/arsenal_lib.py", line 125, in append_tag
> self.bug.lp_save()
> File "build/bdist.linux-x86_64/egg/launchpadlib/resource.py", line 489, in lp_save
> File "build/bdist.linux-x86_64/egg/launchpadlib/_browser.py", line 266, in patch
> File "build/bdist.linux-x86_64/egg/launchpadlib/_browser.py", line 212, in _request
> launchpadlib.errors.HTTPError: HTTP Error 412: Precondition Failed