Couchbase KeyExistsError on rep(Couchbase键退出错误)

2024-06-15 08:51:50 发布

您现在位置:Python中文网/ 问答频道 /正文

我尝试更新couchbase中的实体时遇到以下错误:

 File "./*/couchbase_repository.py", line 55, in update self.repository.update(group)
self._connection.replace(couch_doc["id"], couch_doc, persist_to=1, cas=cas)
File "/opt/*/virtualenv/lib/python2.7/site-packages/couchbase/bucket.py", line 377, in replace
persist_to=persist_to, replicate_to=replicate_to)
_KeyExistsError_0xC (generated, catch KeyExistsError): <Key=u'*', RC=0xC[The key already exists in the server. If you have supplied a CAS then the key exists with a CAS value different than speci$

问题是,我没有在代码中指定cas值,也没有相应地指定couchbase python客户机源代码-默认的cas值是zero,因此它应该忽略cas验证。在

couchbase服务器版本:3.0.1社区版(build-1444)

couchbase python客户端版本:2.0.4

C库的版本:

图书馆基地-设备:amd64 2.5.3-1在

libcouchbase2-核心:amd64 2.5.3-1在

libcouchbase2-libevent:amd64 2.5.3-1在

这是调用库的代码:

^{pr2}$

Tags: toinpyself版本repositorylineupdate