SELECT COUNT(*) failed with IndexFailureException

Hello,

When performing this query :

SELECT RAW COUNT(*) FROM ot_cibml ._default .accessor_integration_tests

(through the Linq2Couchbase LongCountAsync(), but as explained here Couchbase.Core.Exceptions.IndexFailureException raised when calling LongCountAsync() · Issue #368 · couchbaselabs/Linq2Couchbase · GitHub
the problem is not direclty related to Linq2Couchbase)

I get this exception :

Couchbase.Core.Exceptions.IndexFailureException
Failed to get count for keyspace default:ot_cibml - cause: write tcp 10.118.180.31:49586->10.118.185.14:11210: write: connection timed out [12006]
   at Couchbase.Query.QueryResultExtensions.ThrowExceptionOnError[T](IQueryResult`1 result, QueryErrorContext context)
   at Couchbase.Query.StreamingQueryResult`1.GetAsyncEnumerator(CancellationToken cancellationToken)+MoveNext()
   at Couchbase.Query.StreamingQueryResult`1.GetAsyncEnumerator(CancellationToken cancellationToken)+System.Threading.Tasks.Sources.IValueTaskSource<System.Boolean>.GetResult()
   at Couchbase.Linq.Execution.ClusterQueryExecutor.ExecuteCollectionAsync[T](String statement, LinqQueryOptions queryOptions, CancellationToken cancellationToken)+MoveNext()
   at Couchbase.Linq.Execution.ClusterQueryExecutor.ExecuteCollectionAsync[T](String statement, LinqQueryOptions queryOptions, CancellationToken cancellationToken)+MoveNext()
   at Couchbase.Linq.Execution.ClusterQueryExecutor.ExecuteCollectionAsync[T](String statement, LinqQueryOptions queryOptions, CancellationToken cancellationToken)+System.Threading.Tasks.Sources.IValueTaskSource<System.Boolean>.GetResult()
   at System.Linq.AsyncEnumerable.<SingleAsync>g__Core|530_0[TSource](IAsyncEnumerable`1 source, CancellationToken cancellationToken) in /_/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Single.cs:line 50
   at System.Linq.AsyncEnumerable.<SingleAsync>g__Core|530_0[TSource](IAsyncEnumerable`1 source, CancellationToken cancellationToken) in /_/Ix.NET/Source/System.Linq.Async/System/Linq/Operators/Single.cs:line 55

What I have in the logs :

[2023-09-01 12:12:33Z] dbug: Couchbase.Query.QueryClient[0]
Sending query 8a8775a8-8a99-4b97-8d06-14258bf648c8 to node http://cmxd4o05.dev.cm.par.emea.cib:8093/query/service.
[2023-09-01 12:12:33Z] dbug: Couchbase.Query.QueryClient[0]
Request 8a8775a8-8a99-4b97-8d06-14258bf648c8 has succeeded.
[2023-09-01 12:12:33Z] dbug: Couchbase.Query.QueryClient[0]
The request 8a8775a8-8a99-4b97-8d06-14258bf648c8 failed because: Failed to get count for keyspace default:ot_cibml - cause: write tcp 10.118.180.31:49586->10.118.185.14:11210: write: connection timed out [12006]

I don’t know what timeout is triggered ? How can I configure it ?

Thanks,
Julien

looks timeout to contact query node. This should have taken only few ms.
If problem persists try restart query service. MB-56683

Thanks for your answer.
Do you know if it is possible to configure this “connection timeout” ? (with ClusterOptions ?)

11210 is the kv port. I’m not sure why it would be accessed - unless internally a count without a predicate on a keyspace just gets the document count of the keyspace. Do you have a data node on 10.118.185.14 ? Is it running?

Hi mreiche,
Yes I have a data node on 10.118.185.14 and it is running.