Check the docs before asking a question: https://docs.abp.io/en/commercial/latest/ Check the samples, to see the basic tasks: https://docs.abp.io/en/commercial/latest/samples/index The exact solution to your question may have been answered before, please use the search on the homepage.
- ABP Framework version: v4.0.0
- UI type: Angular
- Tiered (MVC) or Identity Server Seperated (Angular): yes
- Exception message and stack trace:
* An exception occurred while iterating over the results of a query for context type 'Volo.Abp.IdentityServer.EntityFrameworkCore.IdentityServerDbContext'.
System.Data.SqlTypes.SqlNullValueException: Data is Null. This method or property cannot be called on Null values.
at Microsoft.Data.SqlClient.SqlBuffer.ThrowIfNull()
at Microsoft.Data.SqlClient.SqlBuffer.get_Boolean()
at Microsoft.Data.SqlClient.SqlDataReader.GetBoolean(Int32 i)
at Microsoft.EntityFrameworkCore.Query.Internal.BufferedDataReader.BufferedDataRecord.ReadBool(DbDataReader reader, Int32 ordinal, ReaderColumn column)
at Microsoft.EntityFrameworkCore.Query.Internal.BufferedDataReader.BufferedDataRecord.ReadRow()
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)
at Microsoft.EntityFrameworkCore.Query.Internal.SplitQueryingEnumerable`1.AsyncEnumerator.MoveNextAsync()
System.Data.SqlTypes.SqlNullValueException: Data is Null. This method or property cannot be called on Null values.
at Microsoft.Data.SqlClient.SqlBuffer.ThrowIfNull()
at Microsoft.Data.SqlClient.SqlBuffer.get_Boolean()
at Microsoft.Data.SqlClient.SqlDataReader.GetBoolean(Int32 i)
at Microsoft.EntityFrameworkCore.Query.Internal.BufferedDataReader.BufferedDataRecord.ReadBool(DbDataReader reader, Int32 ordinal, ReaderColumn column)
at Microsoft.EntityFrameworkCore.Query.Internal.BufferedDataReader.BufferedDataRecord.ReadRow()
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)
at Microsoft.EntityFrameworkCore.Query.Internal.SplitQueryingEnumerable`1.AsyncEnumerator.MoveNextAsync()
D:\Projile\ABP-Suite\aspnet-core\src\Ezpand.DbMigrator\bin\Debug\net5.0\Ezpand.DbMigrator.exe (process 13132) exited with code -1.
To automatically close the console when debugging stops, enable Tools->Options->Debugging->Automatically close the console when debugging stops.
Press any key to close this window . . .
- Steps to reproduce the issue:
Migrating current applicaiton from 3.3.1 to 4.0.0. Not able to run DBMigration service. Getting exception as above.
25 Answer(s)
-
0
hi shobhit
Identity Server 4 has a lot of breaking changes, have you applied to your project?
https://docs.abp.io/en/abp/latest/Migration-Guides/Abp-4_0#upgraded-to-identity-server-4-1-1
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) -
0
Hello maliming, Can you help me in the quick manner as i have upgraded my project and it is not running so i have all deliverable pending, Also ABP suite is also not working even if i do roll back. Please help.
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) -
0
hi
You can create a new project of version 4.0. Then compare the code.
If possible you can provide me with a project, I can download and check to it. liming.ma@volosoft.com
How can I install a specific version of ABP Suite?
https://support.abp.io/QA/Questions/287/How-can-I-install-a-specific-version-of-ABP-Suite
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) -
0
hi
You can consider deleting all migrations and then adding a new one. You can delete the Migrations folder.
Please backup the database before trying.
Re-adding the migration will solve your problem.
This is a simple way, otherwise I need to get the source code of your project to check.
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) -
0
Please back up the code and database.
- delete the Migrations folder.
- run
dotnet ef migrations add Initialcommand inxxx.EntityFrameworkCore.DbMigrationsfolder. - run
dotnet ef database updatecommand or runxxx.DbMigratorto apply.
https://docs.microsoft.com/en-us/ef/core/managing-schemas/migrations/
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) -
0
As per instruction. 1- i have created new database 2- deleted migration folder 3- run "dotnet ef migrations add myproject" command 4- it generated migration folder again 5- run the "DBMigrator" 6- Error: Failed executing DbCommand (439ms) [Parameters=[@__providerName_0='?' (Size = 64)], CommandType='Text', CommandTimeout='30'] SELECT [a].[Id], [a].[Name], [a].[ProviderKey], [a].[ProviderName], [a].[Value] FROM [AbpSettings] AS [a] WHERE ([a].[ProviderName] = @__providerName_0) AND [a].[ProviderKey] IS NULL [14:42:25 ERR] An exception occurred while iterating over the results of a query for context type 'Volo.Abp.SettingManagement.EntityFrameworkCore.SettingManagementDbContext'. Microsoft.Data.SqlClient.SqlException (0x80131904): Invalid object name 'AbpSettings'.
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) -
0
hi @shobhit
Can you reproduce the problem in the 4.0 template project? Because I see you are using different connection strings for different modules.
https://docs.abp.io/en/abp/latest/Entity-Framework-Core-Migrations
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) -
0
hi
I mean can you find some differences between your project and the template project that might be causing the problem.
That is, if you copy some code of your project to the template project, the above problem occurs.
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post) -
0
Ok.
So as per suggestion i have created new ABP4.0 project. I run the DBMigrator and it has created the fresh db schema. Now when i am running DBMigrator again it is throwing error:
[22:26:00 INF] Started database migrations... [22:26:00 INF] Migrating schema for host database... [22:26:05 ERR] Failed executing DbCommand (367ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] CREATE TABLE [AbpAuditLogs] ( [Id] uniqueidentifier NOT NULL, [ApplicationName] nvarchar(96) NULL, [UserId] uniqueidentifier NULL, [UserName] nvarchar(256) NULL, [TenantId] uniqueidentifier NULL, [TenantName] nvarchar(max) NULL, [ImpersonatorUserId] uniqueidentifier NULL, [ImpersonatorTenantId] uniqueidentifier NULL, [ExecutionTime] datetime2 NOT NULL, [ExecutionDuration] int NOT NULL, [ClientIpAddress] nvarchar(64) NULL, [ClientName] nvarchar(128) NULL, [ClientId] nvarchar(64) NULL, [CorrelationId] nvarchar(64) NULL, [BrowserInfo] nvarchar(512) NULL, [HttpMethod] nvarchar(16) NULL, [Url] nvarchar(256) NULL, [Exceptions] nvarchar(4000) NULL, [Comments] nvarchar(256) NULL, [HttpStatusCode] int NULL, [ExtraProperties] nvarchar(max) NULL, [ConcurrencyStamp] nvarchar(40) NULL, CONSTRAINT [PK_AbpAuditLogs] PRIMARY KEY ([Id]) );
Markdown supported.Copy, paste, or drag & drop images and files (max 100 MB per file, 100 MB total per post)