Activities of "bqabani"

  • ABP Framework version: v7.3.0
  • UI Type: Angular
  • Database System: EF Core (SQL Server)
  • Tiered (for MVC) or Auth Server Separated (for Angular): yes **Micro service **

I have a micro service (for example called Products Microservice) in that microservice I would like to check if a specific user has a permission, this user is not the current user, (I have his email only)

Kindly suggest all available solutions, the best solution that does not make me made connection to administration.

I think I need to use: var rs = await authorizationService.AuthorizeAsync(ClaimsPrincipal, requiredPolicy); but I do not have the (ClaimsPrincipal) and how can I get an instance of it related a specific user ? and is this good solution ?

Kindly advice

  • ABP Framework version: v5.0.0
  • UI type: Angular
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): yes
  • Exception message and stack trace:
  • Instances cannot be resolved and nested lifetimes cannot be created from this LifetimeScope as it (or one of its parent scopes) has already been disposed.
  • Steps to reproduce the issue:"

I have a customer scenario, so the application when it starts, it waiting for external event (using a third party), when the event is happend, But when the event is triggered, I should be able to use dependency injection, When I try to access the Service Provider, I get the error above, here is a code sample:

public override void OnApplicationInitialization(ApplicationInitializationContext context)
        {
            var configuration = context.GetConfiguration();  
            var SelfUrl = configuration["App:SelfUrl"];
            var app = context.GetApplicationBuilder();
            var env = context.GetEnvironment();
            var buses = context.ServiceProvider.GetServices<ServiceBusProcessor>();
            foreach (var processor1 in buses)
            {
                processor1.ProcessMessageAsync += (ProcessMessageEventArgs args) => ProcessMessageHandler(context, args);
                processor1.ProcessErrorAsync += ErrorHandler;
                processor1.StartProcessingAsync().GetAwaiter().GetResult();
            }
    }
    private async Task ProcessMessageHandler(ApplicationInitializationContext context, ProcessMessageEventArgs args) { 
       var serviceProvider = context.ServiceProvider ; 
       using (var scope = serviceProvider.CreateScope())
       {
           var handler = serviceProvider.GetService<TraineeProfileUpdateJobHandler>(); // this is throws an error
           var handler2 = scope.ServiceProvider.GetService<TraineeProfileUpdateJobHandler>(); // this is throws an error
            await handler.ExecuteAsync(parsed);
        }
    }
  • ABP Framework version: v5.0.0
  • UI type: Angular
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): yes
  • Exception message and stack trace:

2023-05-21 17:07:47.946 +03:00 [ERR] An exception was thrown while deserializing the token. Microsoft.AspNetCore.Antiforgery.AntiforgeryValidationException: The antiforgery token could not be decrypted. ---> System.Security.Cryptography.CryptographicException: The key {d8fbc7f5-259b-455a-b1f4-89121eb1d364} was not found in the key ring. For more information go to http://aka.ms/dataprotectionwarning at Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingBasedDataProtector.UnprotectCore(Byte[] protectedData, Boolean allowOperationsOnRevokedKeys, UnprotectStatus& status) at Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingBasedDataProtector.DangerousUnprotect(Byte[] protectedData, Boolean ignoreRevocationErrors, Boolean& requiresMigration, Boolean& wasRevoked) at Microsoft.AspNetCore.DataProtection.KeyManagement.KeyRingBasedDataProtector.Unprotect(Byte[] protectedData) at Microsoft.AspNetCore.Antiforgery.DefaultAntiforgeryTokenSerializer.Deserialize(String serializedToken) --- End of inner exception stack trace --- at Microsoft.AspNetCore.Antiforgery.DefaultAntiforgeryTokenSerializer.Deserialize(String serializedToken) at Microsoft.AspNetCore.Antiforgery.DefaultAntiforgery.GetCookieTokenDoesNotThrow(HttpContext httpContext)

  • ABP Framework version: v5.0.0
  • UI type: Angular
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): yes
  • Lepton theme projects and volo account projects source modules are added to the solution
  • This issue appeared when we migrated from abp 4.2.1 to 5.0.0

An unhandled exception occurred while processing the request. AbpException: Could not find the bundle file '/libs/bootstrap/css/bootstrap.rtl.css' for the bundle 'Lepton.Global'! Volo.Abp.AspNetCore.Mvc.UI.Bundling.TagHelpers.AbpTagHelperResourceService.ProcessAsync(ViewContext viewContext, TagHelper tagHelper, TagHelperContext context, TagHelperOutput output, List<BundleTagHelperItem> bundleItems, string bundleName)

Stack Query Cookies Headers Routing AbpException: Could not find the bundle file '/libs/bootstrap/css/bootstrap.rtl.css' for the bundle 'Lepton.Global'! Volo.Abp.AspNetCore.Mvc.UI.Bundling.TagHelpers.AbpTagHelperResourceService.ProcessAsync(ViewContext viewContext, TagHelper tagHelper, TagHelperContext context, TagHelperOutput output, List<BundleTagHelperItem> bundleItems, string bundleName) Volo.Abp.AspNetCore.Mvc.UI.Bundling.TagHelpers.AbpBundleTagHelperService<TTagHelper, TService>.ProcessAsync(TagHelperContext context, TagHelperOutput output) Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperRunner.<RunAsync>g__Awaited|0_0(Task task, TagHelperExecutionContext executionContext, int i, int count) AspNetCore._Themes_Lepton_Layouts_Account_Default+<>c__DisplayClass32_0+<<ExecuteAsync>b__0>d.MoveNext() in Default.cshtml + <abp-style-bundle name="@LeptonThemeBundles.Styles.Global" /> Microsoft.AspNetCore.Razor.Runtime.TagHelpers.TagHelperExecutionContext.SetOutputContentAsync() AspNetCore._Themes_Lepton_Layouts_Account_Default.ExecuteAsync() in Default.cshtml + <html lang="@CultureInfo.CurrentCulture.Name" dir="@langDir"> Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderPageCoreAsync(IRazorPage page, ViewContext context) Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderPageAsync(IRazorPage page, ViewContext context, bool invokeViewStarts) Microsoft.AspNetCore.Mvc.Razor.RazorView.RenderLayoutAsync(ViewContext context, ViewBufferTextWriter bodyWriter)

  • ABP Framework version: v4.2.1
  • UI type: Angular
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): no

I need to configure Hangfire with abp 4.2.1 I need to do the following: 1- Control the number of instances of each server 2- Divide jobs into queues, I want to add some queues dynamically 3- I need to add more servers (I can create a replica of the Host project), But I need to configure with job work on which server 4- I want to control the time span between jobs in the same queue 5- I want to be able to configure AddHangfireServer not only AddHangfire

Thank you

ABP Framework version: v4.2.1

UI type: Angular

DB provider: EF Core

Tiered (MVC) or Identity Server Separated (Angular): no

Steps to reproduce the issue:"

Node Js: v14.18.0 npm: 8.1.4 yarn : 1.22.5

When I run (abp generate-proxy -t ng) in terminal I get this error:

[10:46:47 INF] ABP CLI (https://abp.io)
[10:46:47 INF] Version 4.2.2 (Stable)
[10:46:48 WRN] ABP CLI has a newer stable version 6.0.1, please update to get the latest features and fixes.
[10:46:48 WRN] 
[10:46:48 WRN] Update Command:
[10:46:48 WRN] dotnet tool update -g Volo.Abp.Cli
[10:46:48 WRN]
[10:46:48 WRN] Couldn't determinate version of "@abp/ng.schematics" package.
"SchematicsAbpGenerateProxy" schema is using the keyword "id" which its support is deprecated. Use "$id" for schema ID.
[Project Not Found] Either define a default project in your workspace or specify the project name in schematics options.

I tried to change the id property to schema files in my node_modules folder, so I could get rid of the warning but I still get the same error in last line:

[10:49:13 INF] ABP CLI (https://abp.io)
[10:49:14 INF] Version 4.2.2 (Stable)
[10:49:15 WRN] ABP CLI has a newer stable version 6.0.1, please update to get the latest features and fixes.
[10:49:15 WRN]
[10:49:15 WRN] Update Command:
[10:49:15 WRN] dotnet tool update -g Volo.Abp.Cli
[10:49:15 WRN]
[10:49:15 WRN] Couldn't determinate version of "@abp/ng.schematics" package.
[Project Not Found] Either define a default project in your workspace or specify the project name in schematics options.

I found that I have in my dev dependencies: "@abp/ng.schematics": "^4.3.3" so I downgraded it to "@abp/ng.schematics": "^4.2.1" but still the same error

I tried removing node modules and installing it, I get the same errors

I tried to use abp 4.2.2 or 4.2.1 , I get the same errors

Please note that the system was working but when I upgraded the abp and nodejs and then I rolled back to the same old versions I got the errors above

  • ABP Framework version: v4.2.1
  • UI type: Angular
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): no
  • Steps to reproduce the issue:"

I added a new controller to the project: Volo.Abp.Account.Pro.Public.Web I created a new controller for a custom scenario, in the api I create a user using IdentityUserManager.CreateAsync , I always get the error messages in English regardless the current context, Please note that I pass to the api in the header: Accept-Language : ar so I expect to get it in Arabic resource not Arabic, or Accept-Language : tr for Turkish

Other localization resources working fine, only resources related to (Volo.Abp.Identity.Localization.IdentityResource) from Volo.Abp.Identity.Domain.Shared , does not work! I tried to add in the constructor: LocalizationResource = typeof(IdentityResource); but did not work, I added dependency to my module : [DependsOn(typeof(AbpIdentityDomainSharedModule))] did not work neither, I tried to inherit my controller from AbpController or from AccountControllerBase did not work neither,

Sample code:

var result = (await this.userManager.CreateAsync(user, input.Password));
    try
    {
        result.CheckErrors();
    }
    catch 
    {
        var msg = result.Errors.FirstOrDefault().Description;
    }

the msg is always : Passwords must be at least 6 characters. // it takes the English resource: Passwords must be at least {0} characters. The expected result must be by current language such as : Şifre en az 6 karakter uzunluğunda olmalı. or يجب أن تتكون كلمات المرور من 6 حرف على الأقل.

I also tried the following solution but I got: System.NullReferenceException: Object reference not set to an instance of an object. link

public IExceptionToErrorInfoConverter ExceptionToErrorInfoConverter { get; }
var result = (await this.userManager.CreateAsync(user, input.Password));
try
{
    result.CheckErrors();
}
catch(AbpIdentityResultException e)
{   
    var msg = ExceptionToErrorInfoConverter.Convert(e, false).Message;
}

Please note that I have posted this question to another link but it was closed without being able to reply

  • ABP Framework version: v4.2.1
  • UI type: Angular
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): no
  • Steps to reproduce the issue:"

I added a new controller to the project: Volo.Abp.Account.Pro.Public.Web I created a new controller for a custom scenario, in the api I create a user using IdentityUserManager.CreateAsync , I always get the error messages in English regardless the current context, Please note that I pass to the api in the header: Accept-Language : ar so I expect to get it in Arabic resource not Arabic, or Accept-Language : tr for Turkish

Other localization resources working fine, only resources related to (Volo.Abp.Identity.Localization.IdentityResource) from Volo.Abp.Identity.Domain.Shared , does not work! I tried to add in the constructor: LocalizationResource = typeof(IdentityResource); but did not work, I added dependency to my module : [DependsOn(typeof(AbpIdentityDomainSharedModule))] did not work neither, I tried to inherit my controller from AbpController or from AccountControllerBase did not work neither,

Sample code:

var result = (await this.userManager.CreateAsync(user, input.Password));
    try
    {
        result.CheckErrors();
    }
    catch 
    {
        var msg = result.Errors.FirstOrDefault().Description;
    }

the msg is always : Passwords must be at least 6 characters. // it takes the English resource: Passwords must be at least {0} characters. The expected result must be by current language such as : Şifre en az 6 karakter uzunluğunda olmalı. or يجب أن تتكون كلمات المرور من 6 حرف على الأقل.

Question
  • ABP Framework version: v4.2.1
  • UI type: Angular
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): no
  • Exception message and stack trace:
2022-09-29 12:18:10.641 +03:00 [ERR] An exception has been raised that is likely due to a transient failure. Consider enabling transient error resiliency by adding 'EnableRetryOnFailure()' to the 'UseSqlServer' call.
System.InvalidOperationException: An exception has been raised that is likely due to a transient failure. Consider enabling transient error resiliency by adding 'EnableRetryOnFailure()' to the 'UseSqlServer' call.
 ---> Microsoft.Data.SqlClient.SqlException (0x80131904): Transaction (Process ID 78) was deadlocked on lock resources with another process and has been chosen as the deadlock victim. Rerun the transaction.
   at Microsoft.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at Microsoft.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
   at Microsoft.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
   at Microsoft.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
   at Microsoft.Data.SqlClient.SqlDataReader.TryHasMoreRows(Boolean& moreRows)
   at Microsoft.Data.SqlClient.SqlDataReader.TryReadInternal(Boolean setTimeout, Boolean& more)
   at Microsoft.Data.SqlClient.SqlDataReader.ReadAsyncExecute(Task task, Object state)
   at Microsoft.Data.SqlClient.SqlDataReader.InvokeAsyncCall[T](AAsyncCallContext`1 context)
--- End of stack trace from previous location ---
   at Microsoft.EntityFrameworkCore.Query.Internal.BufferedDataReader.BufferedDataRecord.InitializeAsync(DbDataReader reader, IReadOnlyList`1 columns, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.Query.Internal.BufferedDataReader.InitializeAsync(IReadOnlyList`1 columns, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.Query.Internal.BufferedDataReader.InitializeAsync(IReadOnlyList`1 columns, CancellationToken cancellationToken)
   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.SplitQueryingEnumerable`1.AsyncEnumerator.InitializeReaderAsync(DbContext _, Boolean result, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerExecutionStrategy.ExecuteAsync[TState,TResult](TState state, Func`4 operation, Func`4 verifySucceeded, CancellationToken cancellationToken)
ClientConnectionId:46d1ae2d-400a-417a-8945-7fd4da3d9b5f
Error Number:1205,State:52,Class:13
   --- End of inner exception stack trace ---
   at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerExecutionStrategy.ExecuteAsync[TState,TResult](TState state, Func`4 operation, Func`4 verifySucceeded, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.Query.Internal.SplitQueryingEnumerable`1.AsyncEnumerator.MoveNextAsync()
   at Microsoft.EntityFrameworkCore.Query.ShapedQueryCompilingExpressionVisitor.SingleAsync[TSource](IAsyncEnumerable`1 asyncEnumerable, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.Query.ShapedQueryCompilingExpressionVisitor.SingleAsync[TSource](IAsyncEnumerable`1 asyncEnumerable, CancellationToken cancellationToken)
   at ***** REPO
   at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo)
   at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue`1.ProceedAsync()
   at Volo.Abp.Uow.UnitOfWorkInterceptor.InterceptAsync(IAbpMethodInvocation invocation)
   at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter`1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func`3 proceed)
   at **** APP SERVICE
   at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo)
   at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue`1.ProceedAsync()
   at Volo.Abp.Authorization.AuthorizationInterceptor.InterceptAsync(IAbpMethodInvocation invocation)
   at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter`1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func`3 proceed)
   at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo)
   at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue`1.ProceedAsync()
   at Volo.Abp.Auditing.AuditingInterceptor.InterceptAsync(IAbpMethodInvocation invocation)
   at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter`1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func`3 proceed)
   at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo)
   at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue`1.ProceedAsync()
   at Volo.Abp.Validation.ValidationInterceptor.InterceptAsync(IAbpMethodInvocation invocation)
   at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter`1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func`3 proceed)
   at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo)
   at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapterWithReturnValue`1.ProceedAsync()
   at Volo.Abp.Uow.UnitOfWorkInterceptor.InterceptAsync(IAbpMethodInvocation invocation)
   at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter`1.InterceptAsync[TResult](IInvocation invocation, IInvocationProceedInfo proceedInfo, Func`3 proceed)
   at lambda_method8904(Closure , Object )
   at Microsoft.AspNetCore.Mvc.Infrastructure.ActionMethodExecutor.AwaitableObjectResultExecutor.Execute(IActionResultTypeMapper mapper, ObjectMethodExecutor executor, Object controller, Object[] arguments)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.&lt;InvokeActionMethodAsync&gt;g__Awaited|12_0(ControllerActionInvoker invoker, ValueTask`1 actionResultValueTask)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ControllerActionInvoker.<InvokeNextActionFilterAsync>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.<InvokeInnerFilterAsync>g__Awaited|13_0(ControllerActionInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
   at Microsoft.AspNetCore.Mvc.Infrastructure.ResourceInvoker.<InvokeNextExceptionFilterAsync>g__Awaited|25_0(ResourceInvoker invoker, Task lastTask, State next, Scope scope, Object state, Boolean isCompleted)
  • Steps to reproduce the issue:"
  • This issue occurs sometimes on production, sometimes we do not get such error, and sometimes we get this issue

I tried to configure EF Context to support retry on db context configurations:

 Configure<AbpDbContextOptions>(options =>
            {
                options.UseSqlServer(r => r.EnableRetryOnFailure(
                    maxRetryCount: 10,
                    maxRetryDelay: TimeSpan.FromSeconds(30),
                    errorNumbersToAdd: null
                ));
            });

but this did not work I got another error:

[ERR] An exception occurred while iterating over the results of a query for context type 'Physic.EntityFrameworkCore.PhysicDbContext'.
System.InvalidOperationException: The configured execution strategy 'SqlServerRetryingExecutionStrategy' does not support user-initiated transactions. Use the execution strategy returned by 'DbContext.Database.CreateExecutionStrategy()' to execute all the operations in the transaction as a retriable unit.
   at Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.OnFirstExecution()
   at Microsoft.EntityFrameworkCore.Storage.ExecutionStrategy.ExecuteAsync[TState,TResult](TState state, Func`4 operation, Func`4 verifySucceeded, CancellationToken cancellationToken)

If you're creating a bug/problem report, please include followings:

  • ABP Framework version: v4.4.3
  • UI type: Angular
  • DB provider: EF Core
  • Tiered (MVC) or Identity Server Separated (Angular): no
  • Exception message and stack trace: No exception, but it gives user is unauthorized when using load balancer
  • Steps to reproduce the issue:"

Create a new project and deploy it on load balancer, it will gives sometimes (user not authorized)

Showing 1 to 10 of 13 entries
Made with ❤️ on ABP v8.2.0-preview Updated on March 25, 2024, 15:11