Activities of "jpatron"

Hi,

Would you mind elaborating on your response a bit more? Are you talking about the user edit page in the ABP application? Or are you referring to edit the user directly on Azure AD B2C?

  • ABP Framework version: v6.0.3
  • UI Type: MVC
  • Database System: EF Core (SQL Server)
  • Tiered (for MVC) or Auth Server Separated (for Angular): no
  • Exception message and full stack trace: N/A
  • Steps to reproduce the issue: N/A

Hello,

I am in the process of integrating Azure AD B2C with one of our applications using ABP Commercial framework. Azure AD B2C users are able to login to our application successfully after signing up for an account, and I noticed that ABP treats them as external users and I could not find any trace of stored information in our application database when it comes to the user and its roles, permissions, etc. So my question is, how do we assign roles and permissions to users that only exist in Azure AD B2C?

Thanks!

We used the CLI instead of the Suite to create the solution. Another difference I just noticed between this solution we are having issues with and the other one for a different application is that we have an entity with navigation properties. Do you think that might be related to this issue?

In the meantime, I'll try to create a new solution using CLI, add the missing entities without navigation properties this time and see how that goes.

Thanks for reviewing the logs! We do not have any instance of "HasPrincipalKey" across our solution. I can create a new solution using Suite, but I am not sure how that would help us to reproduce this issue, could you elaborate a little further?

Hi, I emailed you the logs earlier today. Please let me know if you got the attachments. Thanks!

I would like to send you the logs of the last 3 failed builds in our CI/CD process but the character limit here prevents me to do so. Is there an email address I can send you the logs as attachments?

We removed the primary keys from our solution but the error still occurs randomly. Like I have said before, the steps are:

  1. Clean solution
  2. Run all tests

I am not sure how to provide you with a copy of our solution in a secure way, though.

Thanks for the links, but as I mentioned before, we are using ABP Commercial v.6.0.3, which seems to rely on Microsoft.EntityFrameworkCore v.6.0.5 so the second link doesn't quite apply to us. Based on the first link you provided, is the only solution to this issue for us to remove the foreign keys from our solution?

There are no particular steps to reproduce the error. The issue occurs randomly while running all unit tests either locally via Visual Studio or while part of our CI/CD process. We made a previous solution for a different application and we never found this issue there, though. The main difference between this new solution (let's call it "Solution B") and the one we made for the previous application ("Solution A") is that we have foreign keys between a couple of tables in Solution B.

Question
  • ABP Framework version: v6.0.3

  • 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: [xUnit.net 00:00:16.32] Volo.Abp.AbpInitializationException : An error occurred during the initialize Volo.Abp.Modularity.OnApplicationInitializationModuleLifecycleContributor phase of the module MyApp.MyAppTestBaseModule, MyApp.TestBase, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null: The property 'Provstate.Id' is part of a key and so cannot be modified or marked as modified. To change the principal of an existing entity with an identifying foreign key, first delete the dependent and invoke 'SaveChanges', and then associate the dependent with the new principal.. See the inner exception for details. [xUnit.net 00:00:16.32] ---- System.InvalidOperationException : The property 'Provstate.Id' is part of a key and so cannot be modified or marked as modified. To change the principal of an existing entity with an identifying foreign key, first delete the dependent and invoke 'SaveChanges', and then associate the dependent with the new principal. [xUnit.net 00:00:16.32] Stack Trace: [xUnit.net 00:00:16.32] at Volo.Abp.Modularity.ModuleManager.InitializeModules(ApplicationInitializationContext context) [xUnit.net 00:00:16.32] at Volo.Abp.AbpApplicationBase.InitializeModules() [xUnit.net 00:00:16.32] at Volo.Abp.AbpApplicationWithExternalServiceProvider.Initialize(IServiceProvider serviceProvider) [xUnit.net 00:00:16.32] at Microsoft.AspNetCore.Builder.AbpApplicationBuilderExtensions.InitializeApplication(IApplicationBuilder app) [xUnit.net 00:00:16.32] C:\Code\MyApp.Abp\test\MyApp.Web.Tests\MyAppWebTestStartup.cs(16,0): at MyApp.MyAppWebTestStartup.Configure(IApplicationBuilder app, ILoggerFactory loggerFactory) [xUnit.net 00:00:16.32] at System.RuntimeMethodHandle.InvokeMethod(Object target, Span1& arguments, Signature sig, Boolean constructor, Boolean wrapExceptions) [xUnit.net 00:00:16.32] at System.Reflection.RuntimeMethodInfo.Invoke(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture) [xUnit.net 00:00:16.32] at Microsoft.AspNetCore.Hosting.ConfigureBuilder.Invoke(Object instance, IApplicationBuilder builder) [xUnit.net 00:00:16.32] at Microsoft.AspNetCore.Hosting.ConfigureBuilder.<>c__DisplayClass4_0.<Build>b__0(IApplicationBuilder builder) [xUnit.net 00:00:16.32] at Microsoft.AspNetCore.Hosting.GenericWebHostBuilder.<>c__DisplayClass15_0.<UseStartup>b__1(IApplicationBuilder app) [xUnit.net 00:00:16.32] at Microsoft.AspNetCore.Mvc.Filters.MiddlewareFilterBuilderStartupFilter.<>c__DisplayClass0_0.<Configure>g__MiddlewareFilterBuilder|0(IApplicationBuilder builder) [xUnit.net 00:00:16.32] at Microsoft.AspNetCore.HostFilteringStartupFilter.<>c__DisplayClass0_0.<Configure>b__0(IApplicationBuilder app) [xUnit.net 00:00:16.32] at Microsoft.AspNetCore.Hosting.GenericWebHostService.StartAsync(CancellationToken cancellationToken) [xUnit.net 00:00:16.32] at Microsoft.Extensions.Hosting.Internal.Host.StartAsync(CancellationToken cancellationToken) [xUnit.net 00:00:16.32] at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.Start(IHost host) [xUnit.net 00:00:16.32] at Volo.Abp.AspNetCore.TestBase.AbpAspNetCoreIntegratedTestBase1..ctor() [xUnit.net 00:00:16.32] at MyApp.MyAppWebTestBase..ctor() [xUnit.net 00:00:16.32] at MyApp.Pages.Questionnaire_Tests..ctor() [xUnit.net 00:00:16.32] at System.RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean wrapExceptions) [xUnit.net 00:00:16.32] ----- Inner Stack Trace ----- [xUnit.net 00:00:16.32] at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.InternalEntityEntry.SetPropertyModified(IProperty property, Boolean changeState, Boolean isModified, Boolean isConceptualNull, Boolean acceptChanges) [xUnit.net 00:00:16.32] at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.ChangeDetector.DetectValueChange(InternalEntityEntry entry, IProperty property) [xUnit.net 00:00:16.32] at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.ChangeDetector.LocalDetectChanges(InternalEntityEntry entry) [xUnit.net 00:00:16.32] at Microsoft.EntityFrameworkCore.ChangeTracking.Internal.ChangeDetector.DetectChanges(IStateManager stateManager) [xUnit.net 00:00:16.32] at Microsoft.EntityFrameworkCore.ChangeTracking.ChangeTracker.DetectChanges() [xUnit.net 00:00:16.32] at Microsoft.EntityFrameworkCore.ChangeTracking.ChangeTracker.TryDetectChanges() [xUnit.net 00:00:16.32] at Microsoft.EntityFrameworkCore.ChangeTracking.ChangeTracker.Entries() [xUnit.net 00:00:16.32] at Volo.Abp.EntityFrameworkCore.AbpDbContext1.HandlePropertiesBeforeSave() [xUnit.net 00:00:16.32] at Volo.Abp.EntityFrameworkCore.AbpDbContext1.SaveChangesAsync(Boolean acceptAllChangesOnSuccess, CancellationToken cancellationToken) [xUnit.net 00:00:16.32] at Volo.Abp.Uow.UnitOfWork.SaveChangesAsync(CancellationToken cancellationToken) [xUnit.net 00:00:16.32] C:\Code\MyApp.Abp\src\MyApp.Domain\Seed\MyAppDataSeedContributor.cs(117,0): at MyApp.Seed.MyAppDataSeedContributor.SeedFormTypes() [xUnit.net 00:00:16.32] C:\Code\MyApp.Abp\src\MyApp.Domain\Seed\MyAppDataSeedContributor.cs(59,0): at MyApp.Seed.MyAppDataSeedContributor.SeedAsync(DataSeedContext context) [xUnit.net 00:00:16.32] at Volo.Abp.Data.DataSeeder.SeedAsync(DataSeedContext context) [xUnit.net 00:00:16.32] at Castle.DynamicProxy.AsyncInterceptorBase.ProceedAsynchronous(IInvocation invocation, IInvocationProceedInfo proceedInfo) [xUnit.net 00:00:16.32] at Volo.Abp.Castle.DynamicProxy.CastleAbpMethodInvocationAdapter.ProceedAsync() [xUnit.net 00:00:16.32] at Volo.Abp.Uow.UnitOfWorkInterceptor.InterceptAsync(IAbpMethodInvocation invocation) [xUnit.net 00:00:16.32] at Volo.Abp.Castle.DynamicProxy.CastleAsyncAbpInterceptorAdapter1.InterceptAsync(IInvocation invocation, IInvocationProceedInfo proceedInfo, Func3 proceed) [xUnit.net 00:00:16.32] C:\Code\MyApp.Abp\test\MyApp.TestBase\MyAppTestBaseModule.cs(40,0): at MyApp.MyAppTestBaseModule.<>c__DisplayClass2_0.<<SeedTestData>b__0>d.MoveNext() [xUnit.net 00:00:16.32] --- End of stack trace from previous location --- [xUnit.net 00:00:16.32] at Nito.AsyncEx.Synchronous.TaskExtensions.WaitAndUnwrapException(Task task) [xUnit.net 00:00:16.32] at Nito.AsyncEx.AsyncContext.<>c__DisplayClass15_0.<Run>b__0(Task t) [xUnit.net 00:00:16.32] at System.Threading.Tasks.ContinuationTaskFromTask.InnerInvoke() [xUnit.net 00:00:16.32] at System.Threading.Tasks.Task.<>c.<.cctor>b__272_0(Object obj) [xUnit.net 00:00:16.32] at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) [xUnit.net 00:00:16.32] --- End of stack trace from previous location --- [xUnit.net 00:00:16.32] at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) [xUnit.net 00:00:16.32] at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread) [xUnit.net 00:00:16.32] --- End of stack trace from previous location --- [xUnit.net 00:00:16.32] at Nito.AsyncEx.Synchronous.TaskExtensions.WaitAndUnwrapException(Task task) [xUnit.net 00:00:16.32] at Nito.AsyncEx.AsyncContext.Run(Func1 action) [xUnit.net 00:00:16.32] at Volo.Abp.Threading.AsyncHelper.RunSync(Func1 action) [xUnit.net 00:00:16.32] C:\Code\MyApp.Abp\test\MyApp.TestBase\MyAppTestBaseModule.cs(37,0): at MyApp.MyAppTestBaseModule.SeedTestData(ApplicationInitializationContext context) [xUnit.net 00:00:16.32] C:\Code\MyApp.Abp\test\MyApp.TestBase\MyAppTestBaseModule.cs(32,0): at MyApp.MyAppTestBaseModule.OnApplicationInitialization(ApplicationInitializationContext context) [xUnit.net 00:00:16.32] at Volo.Abp.Modularity.OnApplicationInitializationModuleLifecycleContributor.Initialize(ApplicationInitializationContext context, IAbpModule module) [xUnit.net 00:00:16.32] at Volo.Abp.Modularity.ModuleManager.InitializeModules(ApplicationInitializationContext context)

  • Steps to reproduce the issue:

    1. Run all tests

We have an issue where random unit tests fail randomly but the error message is consistent (see stack trace above). I did some research and you may have solved a similar issue in newer versions of ABP: https://support.abp.io/QA/Questions/5204/Randomly-test-are-failing

My question is whether I can implement that solution in v.6.0.3. If so, can you provide some guidance on how to do such implementation? Thanks!

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