You are viewing a plain text version of this content. The canonical link for it is here.
Posted to dev@couchdb.apache.org by "Robert Newson (JIRA)" <ji...@apache.org> on 2012/10/18 15:50:03 UTC

[jira] [Resolved] (COUCHDB-1568) update handler on _users always returns 409: update conflict

     [ https://issues.apache.org/jira/browse/COUCHDB-1568?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]

Robert Newson resolved COUCHDB-1568.
------------------------------------

    Resolution: Invalid

It's because you're not passing a rev, but it's really because you're updating a document when you mean to call your update handler.

https://wiki.apache.org/couchdb/Document_Update_Handlers#Usage
                
> update handler on _users always returns 409: update conflict 
> -------------------------------------------------------------
>
>                 Key: COUCHDB-1568
>                 URL: https://issues.apache.org/jira/browse/COUCHDB-1568
>             Project: CouchDB
>          Issue Type: Bug
>          Components: HTTP Interface
>    Affects Versions: 1.2
>            Reporter: Daniel MacDonald
>            Priority: Minor
>
> Adding a trivial update handler to separate design doc on _users on my local install and attempting to PUT to it always gives me a conflict error. If there is an explicit prohibition on the use of _design docs in _users, it isn't documented anywhere I could find. I know that _design/auth is always overwritten on startup, so I created another document _design/helpers to encapsulate some mucking about with roles I wanted to do.
> $ curl -X GET  http://admin:pw@proxy.couchdb:5984/_users/_design/helpers
> {"_id":"_design/helpers","_rev":"29-f4666ed8cddf8eba77167b1de3f71f7d","updates":{"add_user_role":"function (doc,req) { return [doc, null]; }"}}
> $ curl -X PUT http://admin:pw@proxy.couchdb:5984/_users/_design/helpers/add_user_role/org.couchdb.user:test_user_1350517688116_0.4186373823322356@test.com
> {"error":"conflict","reason":"Document update conflict."}

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators
For more information on JIRA, see: http://www.atlassian.com/software/jira