Open link in a new tab

Content

Expand project menu

HTTP status 409 (Conflict) when attempting to update a work package via the API

When attempting to update a work package via the API sometimes I get HTTP status 409 (Conflict). It seems like OpenProject is keeping around locks on work packages longer than it needs to. Anyway any ideas as to what causes this and what can be done about it would be appreciated.

Thank you!

Message actions

Hi Keith,

you will only get 409 errors if the lockVersion in your update call is too old. It needs to match the current version of the work package in database (optimistic locking).

If you POST to the form before trying to patch, you will get the error message for lockVersion as well as the current up-to-date lockVersion from the _embedded.payload data.

Further references:

http://docs.openproject.org/apiv3-doc/#work-packages-work-package-patch

http://docs.openproject.org/apiv3-doc/#work-packages-work-package-edit-form-post

Best,

Oliver

Message actions

Hi Oliver,

That gave me enough info to fix it. Thank you!

Keith