Hi,
I've discovered that all of the getcountasync and getlistasync tests that abp suite generates seem to fail, I'm getting an error related to the foreign key against all of my navigation properties. I updated to the lastest version and reran the abp suite to regenerate all the tests in case there was a bug in v7.0.0 but I'm getting the same result.
ABP Framework version: v7.0.3
UI type: Blazor
DB provider: EF Core
Tiered (MVC) or Identity Server Separated (Angular): no
Exception message and stack trace: DbUpdateException: An error occurred while saving the entity changes. See the inner exception for details. SqliteException: SQLite Error 19: 'FOREIGN KEY constraint failed'.
Steps to reproduce the issue:" Create any dataset using abp suite that has a navigation property then the entityframeworkcore.test project
5 Answer(s)
-
0
could you provide us the entity JSON files.
-
0
could you provide us the entity JSON files.
-
0
@Callum I've deleted the link in your reply since it may contain private data. I'll check this problem.
-
0
-
0
I've created an entity named
book
and then created anauthor
entity with a navigation property tobook
entity. Tests are successful. See the screenshot below:Is there anything extra that had to be done to reproduce this problem?
All my entities are tenanted, maybe that is causing the error? It seems to be happening on all my entities, even those without navigation properties.
`Message: Volo.Abp.AbpInitializationException : An error occurred during the initialize Volo.Abp.Modularity.OnApplicationInitializationModuleLifecycleContributor phase of the module CSAM.AssetTracker.AssetTrackerTestBaseModule, CSAM.AssetTracker.TestBase, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null: An error occurred while saving the entity changes. See the inner exception for details.. See the inner exception for details. ---- Microsoft.EntityFrameworkCore.DbUpdateException : An error occurred while saving the entity changes. See the inner exception for details. -------- Microsoft.Data.Sqlite.SqliteException : SQLite Error 19: 'FOREIGN KEY constraint failed'.
Stack Trace: ModuleManager.InitializeModules(ApplicationInitializationContext context) AbpApplicationBase.InitializeModules() AbpApplicationWithExternalServiceProvider.Initialize(IServiceProvider serviceProvider) AbpIntegratedTest
1.ctor() AssetTrackerTestBase
1.ctor() AssetTrackerEntityFrameworkCoreTestBase.ctor() AssetDescriptionRepositoryTests.ctor() line 15 RuntimeType.CreateInstanceDefaultCtor(Boolean publicOnly, Boolean wrapExceptions) ----- Inner Stack Trace ----- ReaderModificationCommandBatch.ExecuteAsync(IRelationalConnection connection, CancellationToken cancellationToken) <30 more frames...> ModuleManager.InitializeModules(ApplicationInitializationContext context) ----- Inner Stack Trace ----- SqliteException.ThrowExceptionForRC(Int32 rc, sqlite3 db) SqliteDataReader.NextResult() SqliteCommand.ExecuteReader(CommandBehavior behavior) SqliteCommand.ExecuteReaderAsync(CommandBehavior behavior, CancellationToken cancellationToken) SqliteCommand.ExecuteDbDataReaderAsync(CommandBehavior behavior, CancellationToken cancellationToken) RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken) RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken) ReaderModificationCommandBatch.ExecuteAsync(IRelationalConnection connection, CancellationToken cancellationToken)`