Status code OperationTimeout (Code 512) with DocumentDoesNotExistException

Hello,

I did the implementation using ClusterHelper and .NET SDK 2.7.4. I did some tests with high traffic with 900 ops / s and I am getting a exception with the Status Code 512 ( OperationTimeout) but with the exception message “Message: No document found for key: …” and exception type Couchbase.DocumentDoesNotExistException. This does not happen all the time but I am trying to figure out why I am getting a OperationTimeout with the Document Does Not Exists Exception. In my code I need to do some validations when I got the status KeyNotFound in the method GetDocument but I am not sure what to do with this combination “status code 512 (OperationTimeout) and DocumentDoesNotExistException”

Regards.

1 Like

@Xepe -

A DocumentDoesNotExistException always happens when no document exists for a given key, pretty straightforward. The exception is based upon the value of the response status - it might be possible its timing out afterwords - this would indicate a bug, Which specifiic method are you calling?

Jeff

Thanks for the answer,

I am using bucket.GetDocument(“key”) where the bucket come from ClusterHelper.GetBucket(“name”) .

Regards

@Xepe -

I cam only think that its a bug where the timeout occurs after getting the server response and overwrites the Status field. The server response and DocumentDoesNotExistException is what should be shown as well status of KeyNotFound if the document doesn’t exist in Couchbase.

Can you post your configuration? I created a Jira ticket for the issue.

I am using the following configuration.:

  public static class CouchbaseConfig
    {
        public static void Register()
        {
            var couchbaseServerSetting = ConfigurationManager.AppSettings.Get("CouchbaseServer");
            var urls = couchbaseServerSetting.Split(',');
            var servers = new List<Uri>();

            foreach (var url in urls)
            {
                servers.Add(new Uri(url));
            }

            ClusterHelper.Initialize(new ClientConfiguration
            {
                Servers = servers 
            });

            var username = ConfigurationManager.AppSettings.Get("CouchbaseUser");
            var password = ConfigurationManager.AppSettings.Get("CouchbasePassword");

            // provide authentication to cluster
            ClusterHelper.Get().Authenticate(new PasswordAuthenticator(username, password));
        }

        public static void CleanUp()
        {
            ClusterHelper.Close();
        }
    }

Regards.

I’m experiencing the same issue with .NET SDK 2.7.16
Getting an Exception with OperationTimeout when a document does not exists.