Duplicate key 'warning' from Python SDK


Every now and then I see this warning in my logs:

/usr/local/lib/python2.7/dist-packages/couchbase/bucket.py:1000: RuntimeWarning: Found duplicate key
replica=replica, no_format=no_format)

I’m not sure what it means by found duplicate key - if that was the case, how did it get inserted? - whats stranger is that its a warning and doesn’t seem to affect anything else.

Am hoping someone can point in a direction to dig further.


You will get a “Duplicate Key” warning if you end up performing a get_multi() call and using the same key more than once in the list. The warning is issued because since internally it is stored in a dictionary, one of the operations is lost.

Thanks @mnunberg :smile:

That solved it!