QueryAsync HttpRequestExceptions - Response ended prematurely

Running a DotNet Core 3.1 app with the Couchbase .NET client 2.7.26.

I recently updated a test server from Couchbase Enterprise Edition 6.0.3 build 2895 to Enterprise Edition 6.6.3 build 9808 in preparation for an update of production servers. After the update, I started seeing QueryClient Errors similar to the following:

2021/11/05 16:01:47.075|ERR|006|Couchbase.N1QL.QueryClient||
System.Net.Http.HttpRequestException: An error occurred while sending the request.
 ---> System.IO.IOException: The response ended prematurely.
   at System.Net.Http.HttpConnection.SendAsyncCore(HttpRequestMessage request, CancellationToken cancellationToken)
   --- End of inner exception stack trace ---
   at System.Net.Http.HttpConnection.SendAsyncCore(HttpRequestMessage request, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.SendWithNtConnectionAuthAsync(HttpConnection connection, HttpRequestMessage request, Boolean doRequestAuth, CancellationToken cancellationToken)
   at System.Net.Http.HttpConnectionPool.SendWithRetryAsync(HttpRequestMessage request, Boolean doRequestAuth, CancellationToken cancellationToken)
   at System.Net.Http.RedirectHandler.SendAsync(HttpRequestMessage request, CancellationToken cancellationToken)
   at System.Net.Http.HttpClient.FinishSendAsyncBuffered(Task`1 sendTask, HttpRequestMessage request, CancellationTokenSource cts, Boolean disposeCts)
   at Couchbase.N1QL.QueryClient.ExecuteQueryAsync[T](IQueryRequest queryRequest, CancellationToken cancellationToken)
   

Is there a configuration option that needs to be set?

Thanks,
T

I have done some addition investigation in the the HttpRequestException caught when executing a query. It appears the Couchbase server is disconnecting from the client, captured a TCP RST command from the Couchbase Server just prior to the HttpRequestException.

My question; is there a way to disable this behavior in the Couchbase Server, and if not, is there a change I can make to the application to prevent this from happening?

The application uses Dependency Injection to establish the client connection to the Couchbase server, and holds on to the bucket retrieved from a NamedBucketProvider. This bucket object is repeatedly used to run queries.

Any help would be appreciated

Thanks,
T

@ticontask

Are these long-running queries? There is a query timeout which is enforced on the server, I’m wondering if that could be a factor. Also, are you using SSL/TLS?

These are not long-running queries, simple selects which most of the time return nothing. Not using SSL

Thanks,
T

@ticontask -

I don’t have a resolution, but this was reported elsewhere. It can be triggered by “select 1”.

Jeff

@jmorris

Is there any additional logging on the server or client that would help me identify the issue?

Thanks,
T

There are server logs to correlate, but I am not 100% sure which ones to TBH.

Try run the same query via Query Workbench and see if that works to eliminate server issues.

@ticontask -

Is it intermittent or every query?

@ticontask -

We think we have identified the issue and its related to a server change involving idle timeouts. There is a ticket and were working on a fix.

Jeff