Open Closed

No database update when adding Forms module #2870


User avatar
0
Mikael created

ABP version: 5.2.0 Commercial User interface: MVC Database: EF Core Issue: Adding Forms module using ABP Suite does not create tables the database causing the following issue. In EFCore migrations files, there are no reference of the Frm tables.

I tried creating brand new project with only adding the Forms module, same effect.

2022-04-07 18:41:55.149 +02:00 [DBG] Found in the cache: pn:R,pk:admin,n:Forms.Form 2022-04-07 18:41:55.263 +02:00 [ERR] Failed executing DbCommand (10ms) [Parameters=[@__ef_filter__p_0='?' (DbType = Boolean), @__ef_filter__p_1='?' (DbType = Boolean), @__p_0='?' (DbType = Int32), @__p_1='?' (DbType = Int32)], CommandType='"Text"', CommandTimeout='30'] SELECT [f].[Id], [f].[CanEditResponse], [f].[ConcurrencyStamp], [f].[CreationTime], [f].[CreatorId], [f].[DeleterId], [f].[DeletionTime], [f].[Description], [f].[ExtraProperties], [f].[HasLimitOneResponsePerUser], [f].[IsAcceptingResponses], [f].[IsCollectingEmail], [f].[IsDeleted], [f].[IsQuiz], [f].[LastModificationTime], [f].[LastModifierId], [f].[RequiresLogin], [f].[TenantId], [f].[Title] FROM [FrmForms] AS [f] WHERE ((@__ef_filter__p_0 = CAST(1 AS bit)) OR ([f].[IsDeleted] = CAST(0 AS bit))) AND ((@__ef_filter__p_1 = CAST(1 AS bit)) OR [f].[TenantId] IS NULL) ORDER BY [f].[LastModificationTime] DESC OFFSET @__p_0 ROWS FETCH NEXT @__p_1 ROWS ONLY 2022-04-07 18:41:55.320 +02:00 [ERR] An exception occurred while iterating over the results of a query for context type 'Volo.Forms.EntityFrameworkCore.FormsDbContext'. Microsoft.Data.SqlClient.SqlException (0x80131904): Invalid object name 'FrmForms'. at Microsoft.Data.SqlClient.SqlCommand.<>c.b__188_0(Task1 result) at System.Threading.Tasks.ContinuationResultTaskFromResultTask2.InnerInvoke() at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) --- End of stack trace from previous location --- at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread) --- End of stack trace from previous location --- 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.SplitQueryingEnumerable1.AsyncEnumerator.InitializeReaderAsync(AsyncEnumerator enumerator, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerExecutionStrategy.ExecuteAsync[TState,TResult](TState state, Func4 operation, Func4 verifySucceeded, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.Query.Internal.SplitQueryingEnumerable1.AsyncEnumerator.MoveNextAsync() ClientConnectionId:5f1a8f00-c78e-4ad2-a66b-149f08f1b49b Error Number:208,State:1,Class:16 Microsoft.Data.SqlClient.SqlException (0x80131904): Invalid object name 'FrmForms'. at Microsoft.Data.SqlClient.SqlCommand.<>c.b__188_0(Task1 result) at System.Threading.Tasks.ContinuationResultTaskFromResultTask2.InnerInvoke() at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state) --- End of stack trace from previous location --- at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread) --- End of stack trace from previous location --- 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.SplitQueryingEnumerable1.AsyncEnumerator.InitializeReaderAsync(AsyncEnumerator enumerator, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerExecutionStrategy.ExecuteAsync[TState,TResult](TState state, Func4 operation, Func4 verifySucceeded, CancellationToken cancellationToken) at Microsoft.EntityFrameworkCore.Query.Internal.SplitQueryingEnumerable1.AsyncEnumerator.MoveNextAsync() at Microsoft.EntityFrameworkCore.EntityFrameworkQueryableExtensions.ToListAsync[TSource](IQueryable`1 source, CancellationToken cancellationToken) ClientConnectionId:5f1a8f00-c78e-4ad2-a66b-149f08f1b49b Error Number:208,State:1,Class:16 2022-04-07 18:41:55.358 +02:00 [ERR] ---------- RemoteServiceErrorInfo ----------


12 Answer(s)
  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    I can't reproduce the problem, can you share the full steps to reproduce it? thanks.

  • User Avatar
    0
    Mikael created

    Hi,

    My dev environment: Visual Studio 2022 Pro v17.1.3 ABP Commercial 5.2.0 (with 5.2.0 RC2, database was created but there was other issues) Local SQL Here are the steps:

    1. Create a new MVC solution using ABP Suite
    2. Open and build solution in VS
    3. Execute DBMigrator project
    4. Back in ABP SUite, add the Forms module to the solution (which is successful in ABP Suite)
    5. Back in VS, there is no added Migration file in EntityFramework project (I tried to run again DBMigrator project also)
    6. In SQL Management, there are no ABPFrm tables
    7. Starting the project is successful but as I click on Forms in the menu, I have "An internal error occurred during your request"

    I tried several times. I tried to uninstall and reinstall ABP and ABP Suite Here is the test project: TestForm project

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Hi,

    I will check it, and please make the repo to private,it includes your AbpLicenseCode, I think you don't want to expose it.

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    May I ask what suite version are you using?

  • User Avatar
    0
    Mikael created

    Repo is now private, sorry.

    ABB Suite 5.2.0 stable

  • User Avatar
    0
    Mikael created

    In the CLI, I see this error: No project was found. Change the current working directory or use the --project option.

  • User Avatar
    0
    Mikael created

    It tries to find the project in my root User folder instead of the project location

  • User Avatar
    0
    Mikael created

    I guess that if I change the directory within ABP CLI before running ABP Suite, it is going to work

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    I tiered your steps and got no problem, still works.

  • User Avatar
    0
    Mikael created

    I was able to make it work with this additional steps (but I guess this is not the expected behavior):

    1. Create a new MVC solution using ABP Suite
    2. Open and build solution in VS
    3. Execute DBMigrator project => Shutdown ABP Suite => Change directory in ABP CLI to go to project folder => Start ABP Suite
    4. Back in ABP Suite, add the Forms module to the solution (which is successful in ABP Suite)

    The final step (ef migration) only works if the CLI is in the project directory. This was not the case in previous versions.

  • User Avatar
    0
    liangshiwei created
    Support Team Fullstack Developer

    Can I check it remotely? (because I can't reproduce it) shiwei.liang@volosoft.com

  • User Avatar
    0
    yekalkan created
    Support Team Fullstack Developer

    https://github.com/abpframework/abp/pull/12226

Made with ❤️ on ABP v8.2.0-preview Updated on March 25, 2024, 15:11