Randomly error in N1QL in simple select

net

#1

Hi,

I have the next code to recovery user from database

User user = new User();

var queryUser = new QueryRequest($“SELECT {couchbaseBucket.Name}.* FROM {couchbaseBucket_config.Name} WHERE type = ‘user’ and username=$username and password=$password “);
queryUser.AddNamedParameter(”$username”, userRequest.username);
queryUser.AddNamedParameter("$password", userRequest.password);
var userDB = couchbaseBucket_config.Query(queryUser);

The error occurs randomly, sometimes fails and sometimes does not fail, occurs in all N1QL queries

System.Threading.Tasks.TaskCanceledException: The operation was canceled. —> System.IO.IOException: Unable to read data from the transport connection: The I/O operation has been aborted because of either a thread exit or an application request. —> System.Net.Sockets.SocketException: The I/O operation has been aborted because of either a thread exit or an application request
— End of inner exception stack trace —
at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.ThrowException(SocketError error)
at System.Net.Sockets.Socket.AwaitableSocketAsyncEventArgs.GetResult(Int16 token)
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.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)}

Please help,

Thanks in advance


#2

Hi,

I get my error ,
QueryRequestTimeout was configured in 300 :frowning: ,
increasing QueryRequestTimeout all work :slight_smile: