Open Closed

Chat module inconsistency - some users can chat while others can't - same roles -- see log file #5001


User avatar
0
Dicky.tech@gmail.com created
  • ABP Framework version: v7.2.0
  • UI type: MVC
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): no
  • Exception message and stack trace: 2023-05-03 23:12:32.044 +03:00 [INF] Request finished HTTP/2 POST https://localhost:44343/api/chat/conversation/send-message application/json 70 - 204 - - 132.0564ms 2023-05-03 23:12:34.840 +03:00 [INF] Request starting HTTP/2 GET https://localhost:44343/api/chat/conversation/conversation?targetUserId=f1f150ff-71b9-6661-11b4-3a0a4b42e908&skipCount=0&maxResultCount=50 application/json - 2023-05-03 23:12:34.842 +03:00 [DBG] The event OpenIddict.Validation.OpenIddictValidationEvents+ProcessRequestContext was successfully processed by OpenIddict.Validation.AspNetCore.OpenIddictValidationAspNetCoreHandlers+ResolveRequestUri. 2023-05-03 23:12:34.843 +03:00 [DBG] The event OpenIddict.Server.OpenIddictServerEvents+ProcessRequestContext was successfully processed by OpenIddict.Server.AspNetCore.OpenIddictServerAspNetCoreHandlers+ResolveRequestUri. 2023-05-03 23:12:34.844 +03:00 [DBG] The event OpenIddict.Server.OpenIddictServerEvents+ProcessRequestContext was successfully processed by OpenIddict.Server.OpenIddictServerHandlers+InferEndpointType. 2023-05-03 23:12:34.844 +03:00 [DBG] The event OpenIddict.Server.OpenIddictServerEvents+ProcessRequestContext was successfully processed by Volo.Abp.Account.Web.Pages.Account.OpenIddictImpersonateInferEndpointType. 2023-05-03 23:12:34.844 +03:00 [DBG] The event OpenIddict.Server.OpenIddictServerEvents+ProcessRequestContext was successfully processed by OpenIddict.Server.AspNetCore.OpenIddictServerAspNetCoreHandlers+ValidateHostHeader. 2023-05-03 23:12:34.865 +03:00 [INF] Executing endpoint 'Volo.Chat.Conversations.ConversationController.GetConversationAsync (Volo.Chat.HttpApi)' 2023-05-03 23:12:34.866 +03:00 [INF] Route matched with {area = "chat", action = "GetConversation", controller = "Conversation", page = ""}. Executing controller action with signature System.Threading.Tasks.Task`1[Volo.Chat.Conversations.ChatConversationDto] GetConversationAsync(Volo.Chat.Conversations.GetConversationInput) on controller Volo.Chat.Conversations.ConversationController (Volo.Chat.HttpApi). 2023-05-03 23:12:34.899 +03:00 [DBG] PermissionStore.GetCacheItemAsync: pn:U,pk:59482871-34e2-50fe-57e3-3a0a45c3d424,n:Chat.Messaging 2023-05-03 23:12:34.899 +03:00 [DBG] Found in the cache: pn:U,pk:59482871-34e2-50fe-57e3-3a0a45c3d424,n:Chat.Messaging 2023-05-03 23:12:34.899 +03:00 [DBG] PermissionStore.GetCacheItemAsync: pn:R,pk:admin,n:Chat.Messaging 2023-05-03 23:12:34.899 +03:00 [DBG] Found in the cache: pn:R,pk:admin,n:Chat.Messaging 2023-05-03 23:12:34.991 +03:00 [ERR] ---------- RemoteServiceErrorInfo ---------- { "code": null, "message": "An internal error occurred during your request!", "details": null, "data": {}, "validationErrors": null }

2023-05-03 23:12:34.991 +03:00 [ERR] Sequence contains more than one matching element System.InvalidOperationException: Sequence contains more than one matching element at System.Linq.ThrowHelper.ThrowMoreThanOneMatchException() at System.Linq.Enumerable.TryGetSingle[TSource](IEnumerable1 source, Func2 predicate, Boolean& found) at Volo.Chat.EntityFrameworkCore.Conversations.EfCoreConversationRepository.FindPairAsync(Guid senderId, Guid targetId, CancellationToken cancellationToken) at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo) at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue1.ProceedAsync() at Volo.Abp.Uow.UnitOfWorkInterceptor.InterceptAsync(IAbpMethodInvocation invocation) at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func3 proceed) at Volo.Chat.Messages.MessagingManager.ReadMessagesAsync(Guid targetUserId, Int32 skipCount, Int32 maxResultCount) at Volo.Chat.Conversations.ConversationAppService.GetConversationAsync(GetConversationInput input) at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo) at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue1.ProceedAsync() at Volo.Abp.Authorization.AuthorizationInterceptor.InterceptAsync(IAbpMethodInvocation invocation) at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func3 proceed) at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo) at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue1.ProceedAsync() at Volo.Abp.GlobalFeatures.GlobalFeatureInterceptor.InterceptAsync(IAbpMethodInvocation invocation) at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func3 proceed) at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo) at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue1.ProceedAsync() at Volo.Abp.Auditing.AuditingInterceptor.ProceedByLoggingAsync(IAbpMethodInvocation invocation, AbpAuditingOptions options, IAuditingHelper auditingHelper, IAuditLogScope auditLogScope) at Volo.Abp.Auditing.AuditingInterceptor.InterceptAsync(IAbpMethodInvocation invocation) at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func3 proceed) at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo) at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue1.ProceedAsync() at Volo.Abp.Features.FeatureInterceptor.InterceptAsync(IAbpMethodInvocation invocation) at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func3 proceed) at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo) at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue1.ProceedAsync() at Volo.Abp.Validation.ValidationInterceptor.InterceptAsync(IAbpMethodInvocation invocation) at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func3 proceed) at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo) at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue1.ProceedAsync() at Volo.Abp.Uow.UnitOfWorkInterceptor.InterceptAsync(IAbpMethodInvocation invocation) at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func3 proceed) at lambda_method8009(Closure, Object) at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.AwaitableObjectResultExecutor.Execute(ActionContext actionContext, IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeActionMethodAsync>g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask1 actionResultValueTask) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.

  • Steps to reproduce the issue:"

13 Answer(s)
  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    There seems the ChatConversations table has some wrong records.

    How can I reproduce this? Is there any steps?

  • User Avatar
    0
    Dicky.tech@gmail.com created

    @maliming

    Steps.

    1. I created a project in 7.0.0. Chat module not enabled
    2. I Upgraded to 7.1.1 - enabled chat module - got the error when chatting with some users An error occurred while saving the entity changes. See the inner exception for details. ---> Microsoft.Data.SqlClient.SqlException (0x80131904): Violation of PRIMARY KEY constraint 'PK_ChatUsers'. Cannot insert duplicate key in object 'dbo.ChatUsers'. The duplicate key value is (59482871-34e2-50fe-57e3-3a0a45c3d424).
    3. Upgraded to 7.2.0 -- the error changes when chatting with some users to, see above post for full logs ** [ERR] Sequence contains more than one matching element System.InvalidOperationException: Sequence contains more than one matching element**
    4. I run the below script on DB and the error disappears. DELETE FROM [xxxxx].[dbo].[ChatUsers] DELETE FROM [xxxxx].[dbo].[ChatMessages] DELETE FROM [xxxxx].[dbo].[ChatUserMessages] DELETE FROM [xxxxx].[dbo].[ChatConversations]

    I will continue testing more scenarios and i will update.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    Thanks.

  • User Avatar
    0
    alper created
    Support Team Director

    the question has been re-opened due to the owner's request

  • User Avatar
    0
    Dicky.tech@gmail.com created

    the tenant creation doesn't create the seed data. it appears some data messed up ? That is the tenant is created on the tenant table but no users, roles, permissions etc created

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Please share the logs. Thanks

    liming.ma@volosoft.com

  • User Avatar
    0
    Dicky.tech@gmail.com created

    Shared

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    Please try this https://support.abp.io/QA/Questions/1386/Can't-log-in-as-new-tenant#answer-a265843f-df4c-4f23-9128-39fcdeeec049

  • User Avatar
    0
    Dicky.tech@gmail.com created

    @maliming

    The error is the same after changing the settings, see below

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    The requiresNew is true in the template project by default.

    Can you try the new template project or set it as true?

  • User Avatar
    0
    Dicky.tech@gmail.com created

    Yes. It's true by default.

    I edited it to false because as per https://support.abp.io/QA/Questions/1386/Can't-log-in-as-new-tenant#answer-a265843f-df4c-4f23-9128-39fcdeeec049

    The solution is to set to false.

  • User Avatar
    0
    Dicky.tech@gmail.com created

    Hi

    Am still waiting.

    All other features are working well. The API requests are very fast as well as UI response.

    Why would tenant creation timeout.

  • User Avatar
    0
    maliming created
    Support Team Fullstack Developer

    hi

    I think this is a database problem.

Made with ❤️ on ABP v9.1.0-preview. Updated on December 13, 2024, 06:09