Coder Social home page Coder Social logo

Comments (7)

weiwxg avatar weiwxg commented on June 24, 2024

detail message:

[10:31:13 INF] Started database migrations...
[10:31:13 INF] Migrating schema for host database...
[10:31:14 ERR] Failed executing DbCommand (2ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
CREATE TABLE [AbpAuditLogs] (
    [Id] char(36) COLLATE ascii_general_ci NOT NULL,
    [ApplicationName] varchar(96) NULL,
    [UserId] char(36) COLLATE ascii_general_ci NULL,
    [UserName] varchar(256) NULL,
    [TenantId] char(36) COLLATE ascii_general_ci NULL,
    [TenantName] varchar(64) NULL,
    [ImpersonatorUserId] char(36) COLLATE ascii_general_ci NULL,
    [ImpersonatorUserName] varchar(256) NULL,
    [ImpersonatorTenantId] char(36) COLLATE ascii_general_ci NULL,
    [ImpersonatorTenantName] varchar(64) NULL,
    [ExecutionTime] datetime(6) NOT NULL,
    [ExecutionDuration] int NOT NULL,
    [ClientIpAddress] varchar(64) NULL,
    [ClientName] varchar(128) NULL,
    [ClientId] varchar(64) NULL,
    [CorrelationId] varchar(64) NULL,
    [BrowserInfo] varchar(512) NULL,
    [HttpMethod] varchar(16) NULL,
    [Url] varchar(256) NULL,
    [Exceptions] longtext NULL,
    [Comments] varchar(256) NULL,
    [HttpStatusCode] int NULL,
    [ExtraProperties] longtext NOT NULL,
    [ConcurrencyStamp] varchar(40) NOT NULL,
    CONSTRAINT [PK_AbpAuditLogs] PRIMARY KEY ([Id])
);
Unhandled exception. Microsoft.Data.SqlClient.SqlException (0x80131904): Invalid collation 'ascii_general_ci'.
Invalid collation 'ascii_general_ci'.
Invalid collation 'ascii_general_ci'.
Invalid collation 'ascii_general_ci'.
Invalid collation 'ascii_general_ci'.
   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.SqlCommand.InternalEndExecuteNonQuery(IAsyncResult asyncResult, Boolean isInternal, String endMethod)
   at Microsoft.Data.SqlClient.SqlCommand.EndExecuteNonQueryInternal(IAsyncResult asyncResult)
   at Microsoft.Data.SqlClient.SqlCommand.EndExecuteNonQueryAsync(IAsyncResult asyncResult)
   at Microsoft.Data.SqlClient.SqlCommand.<>c.<InternalExecuteNonQueryAsync>b__208_1(IAsyncResult result)
   at System.Threading.Tasks.TaskFactory`1.FromAsyncCoreLogic(IAsyncResult iar, Func`2 endFunction, Action`1 endAction, Task`1 promise, Boolean requiresSynchronization)
--- End of stack trace from previous location ---
   at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteNonQueryAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteNonQueryAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteNonQueryAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.MigrationCommandExecutor.ExecuteNonQueryAsync(IEnumerable`1 migrationCommands, IRelationalConnection connection, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.MigrationCommandExecutor.ExecuteNonQueryAsync(IEnumerable`1 migrationCommands, IRelationalConnection connection, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.MigrationCommandExecutor.ExecuteNonQueryAsync(IEnumerable`1 migrationCommands, IRelationalConnection connection, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.MigrationCommandExecutor.ExecuteNonQueryAsync(IEnumerable`1 migrationCommands, IRelationalConnection connection, CancellationToken cancellationToken)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.MigrateAsync(String targetMigration, CancellationToken cancellationToken)
   at Acme.BookStore.EntityFrameworkCore.EntityFrameworkCoreBookStoreDbSchemaMigrator.MigrateAsync() in C:\source-code\samples\Acme.BookStore\src\Acme.BookStore.EntityFrameworkCore\EntityFrameworkCore\EntityFrameworkCoreBookStoreDbSchemaMigrator.cs:line 29
   at Acme.BookStore.Data.BookStoreDbMigrationService.MigrateDatabaseSchemaAsync(Tenant tenant) in C:\source-code\samples\Acme.BookStore\src\Acme.BookStore.Domain\Data\BookStoreDbMigrationService.cs:line 95
   at Acme.BookStore.Data.BookStoreDbMigrationService.MigrateAsync() in C:\source-code\samples\Acme.BookStore\src\Acme.BookStore.Domain\Data\BookStoreDbMigrationService.cs:line 52
   at Acme.BookStore.DbMigrator.DbMigratorHostedService.StartAsync(CancellationToken cancellationToken) in C:\source-code\samples\Acme.BookStore\src\Acme.BookStore.DbMigrator\DbMigratorHostedService.cs:line 36
   at Microsoft.Extensions.Hosting.Internal.Host.<StartAsync>b__15_1(IHostedService service, CancellationToken token)
   at Microsoft.Extensions.Hosting.Internal.Host.ForeachService[T](IEnumerable`1 services, CancellationToken token, Boolean concurrent, Boolean abortOnFirstException, List`1 exceptions, Func`3 operation)
   at Microsoft.Extensions.Hosting.Internal.Host.<StartAsync>g__LogAndRethrow|15_3(<>c__DisplayClass15_0&)
   at Microsoft.Extensions.Hosting.Internal.Host.StartAsync(CancellationToken cancellationToken)
   at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
   at Microsoft.Extensions.Hosting.HostingAbstractionsHostExtensions.RunAsync(IHost host, CancellationToken token)
   at Acme.BookStore.DbMigrator.Program.Main(String[] args) in C:\source-code\samples\Acme.BookStore\src\Acme.BookStore.DbMigrator\Program.cs:line 30
   at Acme.BookStore.DbMigrator.Program.<Main>(String[] args)
ClientConnectionId:b11207e2-1789-4a71-8a5c-88bdcbcd6dff
Error Number:448,State:2,Class:16

from abp.

maliming avatar maliming commented on June 24, 2024

Please share the steps to reproduce this?
What's the DB provider are you using?

from abp.

weiwxg avatar weiwxg commented on June 24, 2024

Step1. Create solution >abp new Acme.BookStore --tiered --theme basic -csf
Step2. Open solution with Visual Studio 2022 Comunity
Step3. Run project Acme.BookStore.DbMigrator
Then, error appeared.

DB provider is (localdb)\MSSQLLocalDB

from abp.

maliming avatar maliming commented on June 24, 2024

Please try to run dotnet ef migrations script command in Acme.BookStore.EntityFrameworkCore project.

Acme.BookStore.EntityFrameworkCore % dotnet ef migrations script
Build started...
Build succeeded.
IF OBJECT_ID(N'[__EFMigrationsHistory]') IS NULL
BEGIN
    CREATE TABLE [__EFMigrationsHistory] (
        [MigrationId] nvarchar(150) NOT NULL,
        [ProductVersion] nvarchar(32) NOT NULL,
        CONSTRAINT [PK___EFMigrationsHistory] PRIMARY KEY ([MigrationId])
    );
END;
GO

BEGIN TRANSACTION;
GO

CREATE TABLE [AbpAuditLogs] (
    [Id] uniqueidentifier NOT NULL,
    [ApplicationName] nvarchar(96) NULL,
    [UserId] uniqueidentifier NULL,
    [UserName] nvarchar(256) NULL,
    [TenantId] uniqueidentifier NULL,
    [TenantName] nvarchar(64) NULL,
    [ImpersonatorUserId] uniqueidentifier NULL,
    [ImpersonatorUserName] nvarchar(256) NULL,
    [ImpersonatorTenantId] uniqueidentifier NULL,
    [ImpersonatorTenantName] nvarchar(64) 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(max) NULL,
    [Comments] nvarchar(256) NULL,
    [HttpStatusCode] int NULL,
    [ExtraProperties] nvarchar(max) NOT NULL,
    [ConcurrencyStamp] nvarchar(40) NOT NULL,
    CONSTRAINT [PK_AbpAuditLogs] PRIMARY KEY ([Id])
);
GO

from abp.

weiwxg avatar weiwxg commented on June 24, 2024

And then execute SQL script manual?

from abp.

maliming avatar maliming commented on June 24, 2024

Please share the script of CREATE TABLE [AbpAuditLogs]

from abp.

weiwxg avatar weiwxg commented on June 24, 2024
CREATE TABLE [AbpAuditLogs] (
    [Id] char(36) COLLATE ascii_general_ci NOT NULL,
    [ApplicationName] varchar(96) NULL,
    [UserId] char(36) COLLATE ascii_general_ci NULL,
    [UserName] varchar(256) NULL,
    [TenantId] char(36) COLLATE ascii_general_ci NULL,
    [TenantName] varchar(64) NULL,
    [ImpersonatorUserId] char(36) COLLATE ascii_general_ci NULL,
    [ImpersonatorUserName] varchar(256) NULL,
    [ImpersonatorTenantId] char(36) COLLATE ascii_general_ci NULL,
    [ImpersonatorTenantName] varchar(64) NULL,
    [ExecutionTime] datetime(6) NOT NULL,
    [ExecutionDuration] int NOT NULL,
    [ClientIpAddress] varchar(64) NULL,
    [ClientName] varchar(128) NULL,
    [ClientId] varchar(64) NULL,
    [CorrelationId] varchar(64) NULL,
    [BrowserInfo] varchar(512) NULL,
    [HttpMethod] varchar(16) NULL,
    [Url] varchar(256) NULL,
    [Exceptions] longtext NULL,
    [Comments] varchar(256) NULL,
    [HttpStatusCode] int NULL,
    [ExtraProperties] longtext NOT NULL,
    [ConcurrencyStamp] varchar(40) NOT NULL,
    CONSTRAINT [PK_AbpAuditLogs] PRIMARY KEY ([Id])
);

from abp.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.