Q: about get CAS error

I test my couchbase lite application, I use golang to make restful API. when post data via HTTP, often failed and prompt below message:

[12009] DML Error, possible causes include CAS mismatch or concurrent modificationFailed to perform update - cause: MCResponse status=KEY_EEXISTS, opcode=SET, opaque=0, msg: ",“data”:null

why couchbase lite get this error response?



I’m confused. We don’t have a Go API for Couchbase Lite.

Where are you posting data to? The error looks like something from Couchbase Server.

HI @jens,
sorry, I haven’t explain clear my issue.
I use Read and write separation.
Write: golang for server side, I use golang sdk for couchbase server make a restful API services for cb lite write data. when cb lite want write data to server, cb lite will POST data via HTTP to golang restful API.
Read: cb lite read data via sync gateway.
I found my android bug. when cb lite post data to API, the lite at the same time modify a document, so has CAS error.

thanks for you reply.

Right, you need to do a GET and retry if you get a CAS error.

In the future, it’s better to post questions about Couchbase Server APIs to one of the Server forums rather than mobile … you’ll get better answers from the server experts :slight_smile:

HI @jens,
got it. thanks for you reply.


I moved this to the Go SDK forum.