Occasionally bucket->get(docId) returns NULL when doc exists

Hello there,

So I have some code that gets a document id and tries to get the object from Couchbase. Most of the time it works great, using the same docId repeatedly, but every once in a while I get a NULL result from the bucket->get(docId) call. Notice that I say the result is NULL, not the value. This seems like it should never happen. If there is no key, then it should throw the exception, but it does not.

Doing some debugging, what I found is that in the case where this happens (and only in this case), if I dump the bucket->manager()->info() function, it is also NULL (the manager itself is not and looks no different).

Does anyone have any idea what is going on and how I can fix it? It seems almost like the bucket has not fully initialised or something, but I can’t see how.

I am using server 4.1.0-4908 on a Mac (development & testing) and version 2.0.7 of the PHP SDK.

Thanks in advance,