Open Closed

ChatModule exception #5509


User avatar
0
nqthaitn created
  • ABP Framework version: v7.3.1

  • UI Type: MVC

  • Database System: EF Core - SQL Server

  • Tiered (for MVC) or Auth Server Separated (for Angular): yes

  • Exception message and full stack trace: An internal error occurred during your request!

6kmUka0tNT3o&state=V2VkIEF1ZyAwMiAyMDIzIDExOjAxOjU5IEdNVCswNzAwIChJbmRvY2hpbmEgVGltZSk%3D&iss=https%3A%2F%2Flocalhost%3A44322%2F - -
[smart-contract-service_27a3e381-a]: [11:02:02 INF] Sending file. Request path: '/oauth2-redirect.html'. Physical path: 'N/A'
[smart-contract-service_27a3e381-a]: [11:02:02 INF] Request finished HTTP/1.1 GET https://localhost:45186/swagger/oauth2-redirect.html?code=8jt0wCFx2O1km_DwdwGsq4Oy-yTjXf-6kmUka0tNT3o&state=V2VkIEF1ZyAwMiAyMDIzIDExOjAxOjU5IEdNVCswNzAwIChJbmRvY2hpbmEgVGltZSk%3D&iss=https%3A%2F%2Flocalhost%3A44322%2F - - - 200 2690 text/html 3.6102ms
[smart-contract-service_27a3e381-a]: [11:02:25 INF] Request starting HTTP/1.1 GET https://localhost:45186/abp/Swashbuckle/SetCsrfCookie - -
[smart-contract-service_27a3e381-a]: [11:02:25 INF] Executing endpoint 'Volo.Abp.Swashbuckle.AbpSwashbuckleController.SetCsrfCookie (Volo.Abp.Swashbuckle)'
[smart-contract-service_27a3e381-a]: [11:02:25 INF] Route matched with {area = "Abp", action = "SetCsrfCookie", controller = "AbpSwashbuckle"}. Executing controller action with signature Void SetCsrfCookie() on controller Volo.Abp.Swashbuckle.AbpSwashbuckleController (Volo.Abp.Swashbuckle).
[smart-contract-service_27a3e381-a]: [11:02:25 INF] Executing action method Volo.Abp.Swashbuckle.AbpSwashbuckleController.SetCsrfCookie (Volo.Abp.Swashbuckle) - Validation state: Valid
[smart-contract-service_27a3e381-a]: [11:02:25 INF] Executed action method Volo.Abp.Swashbuckle.AbpSwashbuckleController.SetCsrfCookie (Volo.Abp.Swashbuckle), returned result Microsoft.AspNetCore.Mvc.EmptyResult in 2.0293ms.
[smart-contract-service_27a3e381-a]: [11:02:25 INF] Executed action Volo.Abp.Swashbuckle.AbpSwashbuckleController.SetCsrfCookie (Volo.Abp.Swashbuckle) in 5.0455ms
[smart-contract-service_27a3e381-a]: [11:02:25 INF] Executed endpoint 'Volo.Abp.Swashbuckle.AbpSwashbuckleController.SetCsrfCookie (Volo.Abp.Swashbuckle)'
[smart-contract-service_27a3e381-a]: [11:02:25 INF] Request finished HTTP/1.1 GET https://localhost:45186/abp/Swashbuckle/SetCsrfCookie - - - 204 - - 152.7716ms
[smart-contract-service_27a3e381-a]: [11:02:25 INF] Request starting HTTP/1.1 GET https://localhost:45186/api/chat/contact/contacts?Filter=go&IncludeOtherContacts=true - -
[smart-contract-service_27a3e381-a]: [11:02:25 INF] Executing endpoint 'Volo.Chat.Users.ContactController.GetContactsAsync (Volo.Chat.HttpApi)'
[smart-contract-service_27a3e381-a]: [11:02:25 INF] Route matched with {area = "chat", action = "GetContacts", controller = "Contact"}. Executing controller action with signature System.Threading.Tasks.Task`1[System.Collections.Generic.List`1[Volo.Chat.Users.ChatContactDto]] GetContactsAsync(Volo.Chat.Users.GetContactsInput) on controller Volo.Chat.Users.ContactController (Volo.Chat.HttpApi).
[smart-contract-service_27a3e381-a]: [11:02:25 INF] Executing action method Volo.Chat.Users.ContactController.GetContactsAsync (Volo.Chat.HttpApi) - Validation state: Valid
[smart-contract-service_27a3e381-a]: [11:02:25 DBG] PermissionStore.GetCacheItemAsync: pn:U,pk:e63622f1-a21b-9612-c6cb-3a0cc272c812,n:Chat.Messaging
[smart-contract-service_27a3e381-a]: [11:02:25 DBG] Not found in the cache: pn:U,pk:e63622f1-a21b-9612-c6cb-3a0cc272c812,n:Chat.Messaging
[smart-contract-service_27a3e381-a]: [11:02:25 DBG] Getting all granted permissions from the repository for this provider name,key: U,e63622f1-a21b-9612-c6cb-3a0cc272c812
[smart-contract-service_27a3e381-a]: [11:02:25 DBG] Setting the cache items. Count: 115
[smart-contract-service_27a3e381-a]: [11:02:25 DBG] Finished setting the cache items. Count: 115
[smart-contract-service_27a3e381-a]: [11:02:25 DBG] PermissionStore.GetCacheItemAsync: pn:R,pk:admin,n:Chat.Messaging
[smart-contract-service_27a3e381-a]: [11:02:25 DBG] Not found in the cache: pn:R,pk:admin,n:Chat.Messaging
[smart-contract-service_27a3e381-a]: [11:02:25 DBG] Getting all granted permissions from the repository for this provider name,key: R,admin
[smart-contract-service_27a3e381-a]: [11:02:25 DBG] Setting the cache items. Count: 115
[smart-contract-service_27a3e381-a]: [11:02:25 DBG] Finished setting the cache items. Count: 115
[smart-contract-service_27a3e381-a]: [11:02:25 DBG] PermissionStore.GetCacheItemAsync: pn:C,pk:WebGateway_Swagger,n:Chat.Messaging
[smart-contract-service_27a3e381-a]: [11:02:25 DBG] Not found in the cache: pn:C,pk:WebGateway_Swagger,n:Chat.Messaging
[smart-contract-service_27a3e381-a]: [11:02:25 DBG] Getting all granted permissions from the repository for this provider name,key: C,WebGateway_Swagger
[smart-contract-service_27a3e381-a]: [11:02:25 DBG] Setting the cache items. Count: 115
[smart-contract-service_27a3e381-a]: [11:02:25 DBG] Finished setting the cache items. Count: 115
[smart-contract-service_27a3e381-a]: [11:02:25 ERR] ---------- RemoteServiceErrorInfo ----------
[smart-contract-service_27a3e381-a]: {
[smart-contract-service_27a3e381-a]: "code": null,
[smart-contract-service_27a3e381-a]: "message": "An internal error occurred during your request!",
[smart-contract-service_27a3e381-a]: "details": null,
[smart-contract-service_27a3e381-a]: "data": {},
[smart-contract-service_27a3e381-a]: "validationErrors": null
[smart-contract-service_27a3e381-a]: }
[smart-contract-service_27a3e381-a]:
[smart-contract-service_27a3e381-a]: [11:02:25 ERR] Value cannot be null. (Parameter 'inner')
[smart-contract-service_27a3e381-a]: System.ArgumentNullException: Value cannot be null. (Parameter 'inner')
[smart-contract-service_27a3e381-a]: at System.ArgumentNullException.Throw(String paramName)
[smart-contract-service_27a3e381-a]: at System.ArgumentNullException.ThrowIfNull(Object argument, String paramName)
[smart-contract-service_27a3e381-a]: at System.Linq.Queryable.Join[TOuter,TInner,TKey,TResult](IQueryable`1 outer, IEnumerable`1 inner, Expression`1 outerKeySelector, Expression`1 innerKeySelector, Expression`1 resultSelector)
[smart-contract-service_27a3e381-a]: at Volo.Chat.EntityFrameworkCore.Conversations.EfCoreConversationRepository.GetListByUserIdAsync(Guid userId, String filter, CancellationToken cancellationToken)
[smart-contract-service_27a3e381-a]: at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo)
[smart-contract-service_27a3e381-a]: at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue`1.ProceedAsync()
[smart-contract-service_27a3e381-a]: at Volo.Abp.Uow.UnitOfWorkInterceptor.InterceptAsync(IAbpMethodInvocation invocation)
[smart-contract-service_27a3e381-a]: at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter`1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func`3 proceed)
[smart-contract-service_27a3e381-a]: at Volo.Chat.Users.ContactAppService.GetContactsAsync(GetContactsInput input)
[smart-contract-service_27a3e381-a]: at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo)
[smart-contract-service_27a3e381-a]: at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue`1.ProceedAsync()
[smart-contract-service_27a3e381-a]: at Volo.Abp.Features.FeatureInterceptor.InterceptAsync(IAbpMethodInvocation invocation)
[smart-contract-service_27a3e381-a]: at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter`1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func`3 proceed)
[smart-contract-service_27a3e381-a]: at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo)
[smart-contract-service_27a3e381-a]: at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue`1.ProceedAsync()
[smart-contract-service_27a3e381-a]: at Volo.Abp.GlobalFeatures.GlobalFeatureInterceptor.InterceptAsync(IAbpMethodInvocation invocation)
[smart-contract-service_27a3e381-a]: at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter`1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func`3 proceed)
[smart-contract-service_27a3e381-a]: at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo)
[smart-contract-service_27a3e381-a]: at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue`1.ProceedAsync()
[smart-contract-service_27a3e381-a]: at Volo.Abp.Validation.ValidationInterceptor.InterceptAsync(IAbpMethodInvocation invocation)
[smart-contract-service_27a3e381-a]: at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter`1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func`3 proceed)
[smart-contract-service_27a3e381-a]: at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo)
[smart-contract-service_27a3e381-a]: at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue`1.ProceedAsync()
[smart-contract-service_27a3e381-a]: at Volo.Abp.Authorization.AuthorizationInterceptor.InterceptAsync(IAbpMethodInvocation invocation)
[smart-contract-service_27a3e381-a]: at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter`1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func`3 proceed)
[smart-contract-service_27a3e381-a]: at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo)
[smart-contract-service_27a3e381-a]: at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue`1.ProceedAsync()
[smart-contract-service_27a3e381-a]: at Volo.Abp.Auditing.AuditingInterceptor.ProceedByLoggingAsync(IAbpMethodInvocation invocation, AbpAuditingOptions options, IAuditingHelper auditingHelper, IAuditLogScope auditLogScope)
[smart-contract-service_27a3e381-a]: at Volo.Abp.Auditing.AuditingInterceptor.InterceptAsync(IAbpMethodInvocation invocation)
[smart-contract-service_27a3e381-a]: at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter`1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func`3 proceed)
[smart-contract-service_27a3e381-a]: at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo)
[smart-contract-service_27a3e381-a]: at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue`1.ProceedAsync()
[smart-contract-service_27a3e381-a]: at Volo.Abp.Uow.UnitOfWorkInterceptor.InterceptAsync(IAbpMethodInvocation invocation)
[smart-contract-service_27a3e381-a]: at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter`1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func`3 proceed)
[smart-contract-service_27a3e381-a]: at lambda_method1505(Closure, Object)
[smart-contract-service_27a3e381-a]: at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.AwaitableObjectResultExecutor.Execute(ActionContext actionContext, IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
[smart-contract-service_27a3e381-a]: at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Logged|12_1(ControllerActionInvoker invoker)
[smart-contract-service_27a3e381-a]: at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
[smart-contract-service_27a3e381-a]: at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context)
[smart-contract-service_27a3e381-a]: at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted)
[smart-contract-service_27a3e381-a]: at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
[smart-contract-service_27a3e381-a]: at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|26_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
[smart-contract-service_27a3e381-a]: [11:02:25 INF] Executing ObjectResult, writing value of type 'Volo.Abp.Http.RemoteServiceErrorResponse'.
[smart-contract-service_27a3e381-a]: [11:02:25 INF] Executed action Volo.Chat.Users.ContactController.GetContactsAsync (Volo.Chat.HttpApi) in 287.0242ms
[smart-contract-service_27a3e381-a]: [11:02:25 INF] Executed endpoint 'Volo.Chat.Users.ContactController.GetContactsAsync (Volo.Chat.HttpApi)'
  • Steps to reproduce the issue:

  • I added Chat Module to my service (SmartContractService)

  • Call get Contact via swagger

curl -X 'GET' \
  'https://localhost:45186/api/chat/contact/contacts?Filter=go&IncludeOtherContacts=true' \
  -H 'accept: text/plain' \
  -H 'Authorization: Bearer eyJhbGciOiJSUzI1NiIsImtpZCI6IkZCOEY1MjlGMEMyQjRGMjYyMDMxNkQ5MTdFRTU1QkVFRUNCRjJBMjAiLCJ4NXQiOiItNDlTbnd3clR5WWdNVzJSZnVWYjd1eV9LaUEiLCJ0eXAiOiJhdCtqd3QifQ.eyJzdWIiOiJlNjM2MjJmMS1hMjFiLTk2MTItYzZjYi0zYTBjYzI3MmM4MTIiLCJwcmVmZXJ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8O6JN0JCrPFGv-HvAMg3UjqUrOB1gHLoGuAU3ULaQh9yN-4PLmZvhHLfYe-J5OWk5-1eKe55b5HjVgdsRDNsbsmsFKIqwu5osRIXGXsjRsph5IyFQ_gAnOAVBOadRqUzf7xlT6e9l2KKYGlf3u7nWO38yOV-VuJcAT1iw5DxNnZiqfLpVNoAnTxZU7uY3DWKjw' \
  -H 'X-Requested-With: XMLHttpRequest'

The result:

{
  "error": {
    "code": null,
    "message": "An internal error occurred during your request!",
    "details": null,
    "data": {},
    "validationErrors": null
  }
}

My config:
chatconfig1.png
chatconfig2.png

And then I tried to debug it by adding a CustomEfCoreConversationRepository and overide the GetListByUserIdAsync method and test via Sample API, i figured out GetCountAsync on ConversationRepository worked, but GetListByUserAsync not work because all of Chat DbSet is null, am i missing something ? please help.
debug1.png
debug2.png


7 Answer(s)
  • User Avatar
    0
    jfistelmann created

    Hey, simple shot in the dark:

    Make the DbSet full properties. You only have {get; } -> {get; set; }
    Guessing a DI thing based on that.

    Let me know if that helped

  • User Avatar
    0
    nqthaitn created

    Hey, simple shot in the dark:

    Make the DbSet full properties. You only have {get; } -> {get; set; }
    Guessing a DI thing based on that.

    Let me know if that helped

    It works! Thanks a milion. But now i have a new proplem with websocket, receiver not receive message realtime,
    Screenshot 2023-08-02 at 13.13.04.png

    ocelot.json
    image.png

    SmartContractServiceHttpApiHostModule
    image.png

  • User Avatar
    0
    jfistelmann created

    Hey,

    another shot in the dark:
    I took a look at the documentation and found this here

    image.png
    https://docs.abp.io/en/commercial/latest/modules/chat#adding-distributed-event-bus-for-distributed-architecture-projec

    In your initial question, you said that your application is tiered - that's why I wanted to ask if you added a distributed event bus like described?

  • User Avatar
    0
    nqthaitn created

    Hi,
    Yes, my application use microservice template and MVC for UI Framework. I already installed and config Volo.Abp.EventBus.RabbitMQ.

    update:
    After reviewing the code, I realized that the ChatSignalR Module has dependencies in the wrong place.

    • SmartContractServiceWebModule -> [DependsOn(typeof(ChatSignalRModule))]

    • apps/web/src/GoSquidMs.Web/GoSquidMsWebModule.cs depends on SmartContractServiceWebModule
      so i think the websocket log above:

    WebSocket connected to wss://localhost:44321...
    

    this connect is connected to apps/web/src/GoSquidMs.Web/GoSquidMsWebModule, and the gateway is not functioning properly,
    the issue seems to be that i haven't configured the signalR url for the gateway, i found a post on how to config signalR url in Blazor
    image.png

    but my application is built using MVC, how can i configure it?

    image.png

  • User Avatar
    0
    gterdem created
    Senior .NET Developer
  • User Avatar
    0
    nqthaitn created

    Did you configure ocelot for websockets? https://ocelot.readthedocs.io/en/latest/features/websockets.html

    yes, i did. it show in i can use postman to post : https://localhost:44325/signalr-hubs/chat/negotiate?negotiateVersion=1 (44325 is the web gateway) and catched this package in my service. As i mentioned before, how to config signalR url in my mvc web ? the signalR url should be https://localhost:44325 (the web gateway) not https://localhost:44321 (the mvc web app)

  • User Avatar
    0
    nqthaitn created

    Hi Team,
    I apologize for my confusion, it is now working well.
    Thanks for your support.

Boost Your Development
ABP Live Training
Packages
See Trainings
Mastering ABP Framework Book
Do you need assistance from an ABP expert?
Schedule a Meeting
Mastering ABP Framework Book
The Official Guide
Mastering
ABP Framework
Learn More
Mastering ABP Framework Book
Made with ❤️ on ABP v9.2.0-preview. Updated on March 13, 2025, 04:08