Exception while selecting a document frequently (every 1 minute)

While selecting same document from couchbase multiple time every 10 seconds gives following exception. It is just a simple select query using use keys, we get the same error even if we execute ‘Select 1’. Note: it comes one time out of 5 or so. can you please what we can do to resolve this issue.


“Message”:“An error occurred while sending the request.”,“Data”:{},“InnerException”:{“ClassName”:**“System.IO.IOException**”,“Message”:"The response ended prematurely.

Detailed Error:
[“Select * from use keys $DocId”,[{“Name”:“DocId”,“value”:“testdoc”}]],“OriginalException”:{“StackTrace”:" at System.Net.Http.HttpConnection.SendAsyncCore(HttpRequestMessage request, CancellationToken cancellationToken) in //src/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpConnection.cs:line 728\n at System.Net.Http.HttpConnectionPool.SendWithNtConnectionAuthAsync(HttpConnection connection, HttpRequestMessage request, Boolean doRequestAuth, CancellationToken cancellationToken) in //src/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpConnectionPool.cs:line 572\n at System.Net.Http.HttpConnectionPool.SendWithRetryAsync(HttpRequestMessage request, Boolean doRequestAuth, CancellationToken cancellationToken) in //src/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpConnectionPool.cs:line 537\n at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) in //src/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/RedirectHandler.cs:line 33\n at System.Net.Http.DiagnosticsHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken) in //src/System.Net.Http/src/System/Net/Http/DiagnosticsHandler.cs:line 160\n at System.Net.Http.HttpClient.FinishSendAsyncBuffered(Task`1 sendTask, HttpRequestMessage request, CancellationTokenSource cts, Boolean disposeCts) in //src/System.Net.Http/src/System/Net/Http/HttpClient.cs:line 546\n at Couchbase.N1QL.QueryClient.ExecuteQueryAsync[T](IQueryRequest queryRequest, CancellationToken cancellationToken)",“Message”:“An error occurred while sending the request.”,“Data”:{},“InnerException”:{“ClassName”:“System.IO.IOException”,“Message”:“The response ended prematurely.”,“Data”:null,“InnerException”:null,“HelpURL”:null,“StackTraceString”:" at System.Net.Http.HttpConnection.SendAsyncCore(HttpRequestMessage request, CancellationToken cancellationToken) in /_/src/System.Net.Http/src/System/Net/Http/SocketsHttpHandler/HttpConnection.cs

Hello @kjindal2003 can you please provide a little more details like SDK version used , Server version, development environment etc.

@kjindal2003 -

The error indicates that the connection is likely be closed for some reason while the query is being executed. It could be any number of reasons; I would ensure that the app itself is not doing this by call Dispose on the ICluster or its not going out of scope.

Jeff