Base solution for your next web application
Ends in:
01 DAYS
01 HRS
01 MIN
01 SEC
Open Closed

Abrupt broken connection between my app and the database #11531


User avatar
0
mpineiro created

In my web application, the following query throws an error and causes my application to stop seeing the database server, which causes me to have to restart my application server. Then I put the whole log so you can analyze the case:

ERROR 2023-03-17 12:38:00,638 [210 ] oft.EntityFrameworkCore.Database.Command - Failed executing DbCommand (0ms) [Parameters=[@__ef_filter__p_0='?' (DbType = Boolean), @__ef_filter__p_1='?' (DbType = Boolean), @__ef_filter__CurrentTenantId_2='?' (DbType = Int32), @__p_0='?' (DbType = Int64)], CommandType='Text', CommandTimeout='30'] SELECT TOP(1) [a].[Id], [a].[AccessFailedCount], [a].[AuthenticationSource], [a].[ConcurrencyStamp], [a].[CreationTime], [a].[CreatorUserId], [a].[DeleterUserId], [a].[DeletionTime], [a].[EmailAddress], [a].[EmailConfirmationCode], [a].[GoogleAuthenticatorKey], [a].[IsActive], [a].[IsDeleted], [a].[IsEmailConfirmed], [a].[IsExternalUser], [a].[IsLockoutEnabled], [a].[IsPhoneNumberConfirmed], [a].[IsTwoFactorEnabled], [a].[LastModificationTime], [a].[LastModifierUserId], [a].[LockoutEndDateUtc], [a].[Name], [a].[NormalizedEmailAddress], [a].[NormalizedUserName], [a].[Password], [a].[PasswordResetCode], [a].[PhoneNumber], [a].[ProfilePictureId], [a].[SecurityStamp], [a].[ShouldChangePasswordOnNextLogin], [a].[SignInToken], [a].[SignInTokenExpireTimeUtc], [a].[Surname], [a].[TenantId], [a].[UserName] FROM [AbpUsers] AS [a] WHERE (((@__ef_filter__p_0 = CAST(1 AS bit)) OR ([a].[IsDeleted] <> CAST(1 AS bit))) AND ((@__ef_filter__p_1 = CAST(1 AS bit)) OR ([a].[TenantId] = @__ef_filter__CurrentTenantId_2))) AND ([a].[Id] = @__p_0) ERROR 2023-03-17 12:38:00,639 [210 ] Microsoft.EntityFrameworkCore.Query - An exception occurred while iterating over the results of a query for context type 'Worldsys.Compliance.EntityFrameworkCore.ComplianceDbContext'. System.Threading.Tasks.TaskCanceledException: A task was canceled. at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable1.AsyncEnumerator.InitializeReaderAsync(DbContext _, Boolean result, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerExecutionStrategy.ExecuteAsync[TState,TResult](TState state, Func4 operation, Func4 verifySucceeded, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable1.AsyncEnumerator.MoveNextAsync() System.Threading.Tasks.TaskCanceledException: A task was canceled. at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable1.AsyncEnumerator.InitializeReaderAsync(DbContext _, Boolean result, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerExecutionStrategy.ExecuteAsync[TState,TResult](TState state, Func4 operation, Func4 verifySucceeded, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable1.AsyncEnumerator.MoveNextAsync() ERROR 2023-03-17 12:38:10,144 [142 ] .EntityFrameworkCore.Database.Connection - An error occurred using the connection to database 'ComplianceProd' on server 'xxx.xx.xxx.xxx'. ERROR 2023-03-17 12:38:10,144 [204 ] .EntityFrameworkCore.Database.Connection - An error occurred using the connection to database 'ComplianceProd' on server 'xxx.xx.xxx.xxx'.

Where I put the x, is our database server IP

I would appreciate any help you can give me.


7 Answer(s)
  • User Avatar
    0
    mpineiro created

    Hello, Any update ? Is critical for us

  • User Avatar
    0
    mpineiro created

    Hello, Any update ? Is critical for us. Please, We need help !

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @mpineiro

    Sorry for my late reply. Somehow, your question is not listed on support website for us until today. Do you have any SingleAsync usage in your code ? It might be related to https://github.com/dotnet/SqlClient/pull/285.

    Could you also share the previous log line which might show which method is executed and caused this problem ?

    Thanks,

  • User Avatar
    0
    mpineiro created

    Hi @ismcagdas

    Thanks for your answer. We do not use SingleAsync and the queries shown in the shared log are NET ZERO's own, they are not our queries. I ask you to follow the case and give us a prompt solution because it is very critical for our business.

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    Then, could you share the entire log file with [email protected] ?

    Thanks,

  • User Avatar
    0
    mpineiro created

    Thank you, I already sent the logs of our application to the indicated email. We look forward to a prompt response to solve this problem.

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @mpineiro

    Thanks, we can continue via email for this case.