When using the Couchbase.Transactions library, v1.0.0-beta.2, I am getting the following exception when calling the InsertAsync method:
Couchbase.Transactions.Error.External.TransactionOperationFailedException: Exception of type 'Couchbase.Transactions.Error.External.TransactionOperationFailedException' was thrown.
at Couchbase.Transactions.AttemptContext.<SetAtrPending>b__47_0()
at Couchbase.Transactions.AttemptContext.<>c__DisplayClass79_0.<<RepeatUntilSuccessOrThrow>b__0>d.MoveNext()
--- End of stack trace from previous location ---
at Couchbase.Transactions.AttemptContext.RepeatUntilSuccessOrThrow[T](Func`1 func, Int32 retryLimit, String caller)
at Couchbase.Transactions.AttemptContext.SetAtrPending()
at Couchbase.Transactions.AttemptContext.SetAtrPendingIfFirstMutation(ICouchbaseCollection collection)
at Couchbase.Transactions.AttemptContext.InsertAsync(ICouchbaseCollection collection, String id, Object content)
at MyLibrary.MyOtherMethod() in /Users/mlearner/work/repos/.../myOtherClass.cs:line 73
-----------------------Context Info---------------------------
null
This exception repeats many times because of retries, but is never successful. I am not able to find any documentation regarding why this exception may be raised.
I know I am able to connect to my (new and empty) bucket as it has created an empty _txn:client-record document there.
Before receiving the exception message listed above, I receive this exception message, which I expect and handle:
Couchbase.Core.Exceptions.KeyValue.DocumentNotFoundException: Exception of type 'Couchbase.Core.Exceptions.KeyValue.DocumentNotFoundException' was thrown.
at Couchbase.Core.ClusterNode.ExecuteOp(Func`4 sender, IOperation op, Object state, CancellationTokenPair tokenPair)
at Couchbase.CouchbaseBucket.SendAsync(IOperation op, CancellationTokenPair tokenPair)
at Couchbase.Core.Retry.RetryOrchestrator.RetryAsync(BucketBase bucket, IOperation operation, CancellationTokenPair tokenPair)
at Couchbase.KeyValue.CouchbaseCollection.GetAsync(String id, GetOptions options)
at MyLibrary.MyMethod() in /Users/mlearner/work/repos/.../someClass.cs:line 264
-----------------------Context Info---------------------------
{"DispatchedFrom":null,"DispatchedTo":null,"DocumentKey":"MyDocumentKey","ClientContextId":"19","Cas":0,"Status":1,"BucketName":"myBucket","CollectionName":"_default","ScopeName":"_default","Message":"KV Error: {Name=\"KEY_ENOENT\", Description=\"Not Found\", Attributes=\"item-only\"}"}
I do see that the “Context Info” in this initial message is not null, whereas it is null in the subsequent message. I’m not sure what to do with that information however.
The AttemptContext, on which I am calling InsertAsync is not null, of course. Rather it is just the “Context Info” found in the exception message itself that is showing “null”.
What might cause the TransactionOperationFailedException?
- Couchb aseNetClient, 3.1.3
- Couchbase.Transactions, 1.0.0-beta.2
- net5.0