Activités de "vincent.goh"

  • ABP Framework version: v4.4.4 Commercial
  • UI type: Blazor WebAssembly
  • DB provider: MongoDB
  • Tiered (MVC) or Identity Server Separated (Angular): Microservice

I followed this guide to create a new microservice that uses MongoDB -> https://support.abp.io/QA/Questions/1269/using-MongoDB-in-microservice-service-inside-microservice-solution-which-uses-efcore

However, the new microservice will occasionally throw up an "Authorization failed! Given policy has not granted." error when an API endpoint is called. The same API endpoint will normally work fine so it is not due to user permission settings. The issue will only occur some time after using the application and while the user is still logged in.

I have tried my best to figure out the cause and replicate the problem, but this issue will only happen after the application has been working fine for a couple of hours so it's difficult to troubleshoot and identify why it suddenly stopped working. I've tried running the same application on different machines, networks and environments and the issue is still there. Restarting the application, OS and physical machine doesn't make the issue go away. However, after a few hours, the application will work normally again. After a while, the problem will come back. It is frustrating and I have run out of things to try.

Hope you have some suggestions for me to try. If it helps, I can put up the source code on Github for you to take a look.

The error log can be found below.

[21:55:54 INF] Request starting HTTP/1.1 GET https://localhost:44363/api/i-t-service/alarms - 0 [21:55:55 INF] Successfully validated the token. [21:55:55 INF] Executing endpoint 'NaviX.UnifiedDigitalPlatform.ITService.Controllers.Alarms.AlarmController.GetListAsync (NaviX.UnifiedDigitalPlatform.ITService.HttpApi)' [21:55:55 INF] Route matched with {area = "iTService", controller = "Alarm", action = "GetList"}. Executing controller action with signature System.Threading.Tasks.Task1[Volo.Abp.Application.Dtos.PagedResultDto1[NaviX.UnifiedDigitalPlatform.ITService.Alarms.AlarmDto]] GetListAsync(NaviX.UnifiedDigitalPlatform.ITService.Alarms.GetAlarmsInput) on controller NaviX.UnifiedDigitalPlatform.ITService.Controllers.Alarms.AlarmController (NaviX.UnifiedDigitalPlatform.ITService.HttpApi). [21:55:55 DBG] PermissionStore.GetCacheItemAsync: pn:U,pk:e50d88b7-5179-744b-f4c9-39fe5509621d,n:ITService.Alarms [21:55:55 DBG] Found in the cache: pn:U,pk:e50d88b7-5179-744b-f4c9-39fe5509621d,n:ITService.Alarms [21:55:55 DBG] PermissionStore.GetCacheItemAsync: pn:R,pk:admin,n:ITService.Alarms [21:55:55 DBG] Found in the cache: pn:R,pk:admin,n:ITService.Alarms [21:55:55 DBG] PermissionStore.GetCacheItemAsync: pn:C,pk:WebGateway_Swagger,n:ITService.Alarms [21:55:55 DBG] Found in the cache: pn:C,pk:WebGateway_Swagger,n:ITService.Alarms [21:55:55 INF] Authorization failed. These requirements were not met: PermissionRequirement: ITService.Alarms [21:55:55 WRN] ---------- RemoteServiceErrorInfo ---------- { "code": "Volo.Authorization:010001", "message": "Authorization failed! Given policy has not granted.", "details": null, "data": {}, "validationErrors": null } [21:55:55 WRN] Exception of type 'Volo.Abp.Authorization.AbpAuthorizationException' was thrown. Volo.Abp.Authorization.AbpAuthorizationException: Exception of type 'Volo.Abp.Authorization.AbpAuthorizationException' was thrown. at Microsoft.AspNetCore.Authorization.AbpAuthorizationServiceExtensions.CheckAsync(IAuthorizationService authorizationService, AuthorizationPolicy policy) at Volo.Abp.Authorization.MethodInvocationAuthorizationService.CheckAsync(MethodInvocationAuthorizationContext context) at Volo.Abp.Authorization.AuthorizationInterceptor.AuthorizeAsync(IAbpMethodInvocation invocation) 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.Auditing.AuditingInterceptor.ProceedByLoggingAsync(IAbpMethodInvocation invocation, 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.Uow.UnitOfWorkInterceptor.InterceptAsync(IAbpMethodInvocation invocation) at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func3 proceed) at lambda_method1503(Closure , Object ) at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.AwaitableObjectResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask`1 actionResultValueTask) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Awaited|10_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Rethrow(ActionExecutedContextSealed context) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.Next(State& next, Scope& scope, Object& state, Boolean& isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted) [21:55:55 WRN] Code:Volo.Authorization:010001 [21:55:55 INF] Executing ObjectResult, writing value of type 'Volo.Abp.Http.RemoteServiceErrorResponse'. [21:55:55 INF] Executed action NaviX.UnifiedDigitalPlatform.ITService.Controllers.Alarms.AlarmController.GetListAsync (NaviX.UnifiedDigitalPlatform.ITService.HttpApi) in 322.2834ms [21:55:55 INF] Executed endpoint 'NaviX.UnifiedDigitalPlatform.ITService.Controllers.Alarms.AlarmController.GetListAsync (NaviX.UnifiedDigitalPlatform.ITService.HttpApi)' [21:55:55 INF] Request finished HTTP/1.1 GET https://localhost:44363/api/i-t-service/alarms - 0 - 403 - application/json;+charset=utf-8 630.2044ms

  • ABP Framework version: v5.1.1
  • UI type: Blazor WebAssembly
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): Microservice

I first posted this issue about 3 weeks ago when I tested a new Microservice solution in ABP v5.0 (https://support.abp.io/QA/Questions/2209/Bugs--Issues-v5X#answer-71ba46af-50dd-6d75-9e94-3a01087be8f6) and I tested again with the latest v5.1.1 but the issue still persisted. There seems to be something wrong with the way API calls are handled, and the API calls are often timed out. The timeout error message in the Edge browser console shows:

crit: Microsoft.AspNetCore.Components.WebAssembly.Rendering.WebAssemblyRenderer[100] Unhandled exception rendering component: An error occurred during the ABP remote HTTP request. (The request was canceled due to the configured HttpClient.Timeout of 100 seconds elapsing.) See the inner exception for details. Volo.Abp.Http.Client.AbpRemoteCallException: An error occurred during the ABP remote HTTP request. (The request was canceled due to the configured HttpClient.Timeout of 100 seconds elapsing.) See the inner exception for details.

You can see in the video I created here (https://www.youtube.com/watch?v=om3Yjp7bZAc) that the initial pages and their API calls work fine, but the later pages and API calls stopped working. If I wait a few minutes, the API calls will work again and then after a few more page loads and API calls, it will stop working again. Microservice solutions created on v4.4.4 didn't have such issues.

  • ABP Framework version: v4.4.3
  • DB provider: MongoDB

Currently in the ABP CLI, I can create a new service for a microservice solution with the following command: abp new NewService -t microservice-service-pro

However, the following command to create a microservice using MongoDB doesn't work: abp new NewService -t microservice-service-pro -d mongodb

Are there plans to create a microservice template that uses MongoDB so that we can create a new microservice using the ABP CLI or Suite?

I have read the "Implementing Domain Driven Design" ebook and have some questions on how to use and implement Value Objects in ABP according to DDD, particularly in persisting Value Objects in database.

On page 28 of the ebook where there's an example of IssueLabel as a Value Object, it seems to suggest that Value Objects should be used to implement associative entities / bridging tables to establish one-to-many or many-to-many relationships between entities.

However, I don't see the option of creating a Value Object using the CRUD Page Generator in ABP Suite and I don't see any examples or documentation of how Value Objects should be coded in ABP for persistence in a DBMS like SQL Server. As a result, I have been creating Entities for associative entities / bridging tables for my current ABP solutions.

Any advice on implementing Value Objects in ABP and storing it Value Objects in SQL databases will be helpful. Thanks.

Is there an easy way to create a new microservice using the ABP Suite?

Instead of the standard "product" service created as part of the microservices solution template, I would like to create a microservice named something else.

  • ABP Framework version: v4.4.0
  • DB provider: EF Core
  • Exception message and stack trace:
    • Cannot read the template Volo.Abp.Commercial.SuiteTemplates.Templates.Frontend.Mvc.Menu.MenuContributor_ModuleAddMenuItem_Method_Microservice.txt
  • Steps to reproduce the issue:"
    • Launched ABP Suite v4.4.0
    • Added /services/product (an individual service of a microservice solution) as an existing solution in ABP Suite
    • Tried adding a new entity in the CRUD Page Generator
    • The "Save and generate" button gave the above error

I've created a microservices project via ABP Suite v4.3 using Blazor WebAssembly for the UI.

I don't want to use the Lepton theme that comes with it and I want to implement my own theme instead. However, I am having difficulty finding documentation for how to implement my own theme in the created solution.

The only relevant one I can find is https://docs.abp.io/en/abp/latest/UI/Blazor/Theming#implementing-a-theme but this only talks about replacing the basic theme from ABP Framework, and not the Lepton theme from ABP Commercial in a microservices solution.

Could you point me to resources that can help me with this? Thanks.

Affichage de 1 à 7 sur 7 entrées
Made with ❤️ on ABP v8.2.0-preview Updated on mars 25, 2024, 15:11