neozhu / RazorPageCleanArchitecture

This is a solution for creating the Razor Pages Application with ASP.NET Core(.net 7.0) following the principles of Clean Architecture
https://commercial.blazorserver.com/
MIT License
401 stars 94 forks source link

Running docker-compose -f 'docker-compose.yml' up --build resulted in an error #102

Closed dizhenx closed 6 months ago

dizhenx commented 1 year ago

Running docker-compose -f 'docker-compose.yml' up --build resulted in an error. The error message is as follows:

webui_1 | ClientConnectionId:00000000-0000-0000-0000-000000000000 webui_1 | --- End of inner exception stack trace --- webui_1 | at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions) webui_1 | at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken) webui_1 | at System.Threading.Tasks.Task.Wait() webui_1 | at WorkflowCore.Services.WorkflowHost.Start() webui_1 | at CleanArchitecture.Razor.Infrastructure.DependencyInjection.UseWorkflow(IApplicationBuilder app) in /src/src/Infrastructure/DependencyInjection.cs:line 129 webui_1 | at CleanArchitecture.Razor.Infrastructure.Extensions.ApplicationBuilderExtensions.UseInfrastructure(IApplicationBuilder app, IConfiguration config) in /src/src/Infrastructure/Extensions/ApplicationBuilderExtensions.cs:line 50 webui_1 | at Program.

$(String[] args) in /src/src/SmartAdmin.WebUI/Program.cs:line 78 webui_1 | at Program.
(String[] args) razorpagecleanarchitecture_webui_1 exited with code 139

"How can I resolve this error?"

neozhu commented 1 year ago

I'm not sure, as I haven't maintained this project for a long time. The error you're encountering is likely related to a self-signed certificate. You can Google for information on deploying self-signed certificates with Docker.

dizhenx commented 1 year ago

I'm not sure, as I haven't maintained this project for a long time. The error you're encountering is likely related to a self-signed certificate. You can Google for information on deploying self-signed certificates with Docker.

webui_1 | ClientConnectionId:7629eb9c-e134-4de2-948c-31cdb77cb299 webui_1 | Error Number:-2146893019,State:0,Class:20 webui_1 | --- End of inner exception stack trace --- webui_1 | at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions) webui_1 | at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken) webui_1 | at System.Threading.Tasks.Task.Wait() webui_1 | at WorkflowCore.Services.WorkflowHost.Start() webui_1 | at CleanArchitecture.Razor.Infrastructure.DependencyInjection.UseWorkflow(IApplicationBuilder app) in /src/src/Infrastructure/DependencyInjection.cs:line 129 webui_1 | at CleanArchitecture.Razor.Infrastructure.Extensions.ApplicationBuilderExtensions.UseInfrastructure(IApplicationBuilder app, IConfiguration config) in /src/src/Infrastructure/Extensions/ApplicationBuilderExtensions.cs:line 50 webui_1 | at Program.

$(String[] args) in /src/src/SmartAdmin.WebUI/Program.cs:line 78 webui_1 | at Program.
(String[] args) razorpagecleanarchitecture_webui_1 exited with code 139

Is this error related to the self-signed certificate? I followed the configuration for self-signed certificate on CentOS as mentioned in your readme, and it showed successful configuration

This SQL Server error, with error code -2146893019, indicates an SSL/TLS connection failure. It is suggested online to set Encrypt=False in the ConnectionStrings section. I have set it as follows in appsettings.json:

"ConnectionStrings": { "DefaultConnection": "Server=(localdb)\mssqllocaldb;Database=CleanArchitecture.RazorDb;Trusted_Connection=True;MultipleActiveResultSets=true;Encrypt=False;" }

However, it doesn't work, and the same error persists. Is it caused by the expiration of the SQL Server certificate or some other reason?

kino3 commented 1 year ago

@dizhenx @neozhu I am also trying to use this docker-compose.yml but encountered other errors.

docker-compose.yml (modified)

services:
  webui:
    image: ${DOCKER_REGISTRY-}webui
    build:
      context: .
      dockerfile: src/SmartAdmin.WebUI/Dockerfile
    environment:
      - "UseInMemoryDatabase=false"
      - "ConnectionStrings__DefaultConnection=Server=db;Database=CleanArchitectureDb.slim;TrustServerCertificate=True;Encrypt=false;User=sa;Password=<mypassword>;MultipleActiveResultSets=true;"
      - "ASPNETCORE_URLS=https://+;http://+"
      - "ASPNETCORE_HTTPS_PORT=5001"
      - "ASPNETCORE_ENVIRONMENT=Development"

Encrypt=false is just a tentative solution in my mind, but it shows the next error below. I'm not sure, but I believe the "invalid column name" error is caused by a difference between the entity class definition and the database definition. Please let me know if you know anything about this.

razorpagecleanarchitecture-webui-1  | 2023-07-13 06:30:34.753 +00:00 [ERR] Failed executing DbCommand (0ms) [Parameters=[@__normalizedUserName_0='?' (Size = 256)], CommandType='Text', CommandTimeout='30']
razorpagecleanarchitecture-webui-1  | SELECT TOP(1) [a].[Id], [a].[AccessFailedCount], [a].[ConcurrencyStamp], [a].[DisplayName], [a].[Email], [a].[EmailConfirmed], [a].[IsActive], [a].[IsLive], [a].[LockoutEnabled], [a].[LockoutEnd], [a].[NormalizedEmail], [a].[NormalizedUserName], [a].[PasswordHash], [a].[PhoneNumber], [a].[PhoneNumberConfirmed], [a].[ProfilePictureDataUrl], [a].[RefreshToken], [a].[RefreshTokenExpiryTime], [a].[SecurityStamp], [a].[Site], [a].[TwoFactorEnabled], [a].[UserName]
razorpagecleanarchitecture-webui-1  | FROM [AspNetUsers] AS [a]
razorpagecleanarchitecture-webui-1  | WHERE [a].[NormalizedUserName] = @__normalizedUserName_0  <s:Microsoft.EntityFrameworkCore.Database.Command>
razorpagecleanarchitecture-webui-1  | [06:30:34 ERR] Failed executing DbCommand (0ms) [Parameters=[@__normalizedUserName_0='?' (Size = 256)], CommandType='Text', CommandTimeout='30']
razorpagecleanarchitecture-webui-1  | SELECT TOP(1) [a].[Id], [a].[AccessFailedCount], [a].[ConcurrencyStamp], [a].[DisplayName], [a].[Email], [a].[EmailConfirmed], [a].[IsActive], [a].[IsLive], [a].[LockoutEnabled], [a].[LockoutEnd], [a].[NormalizedEmail], [a].[NormalizedUserName], [a].[PasswordHash], [a].[PhoneNumber], [a].[PhoneNumberConfirmed], [a].[ProfilePictureDataUrl], [a].[RefreshToken], [a].[RefreshTokenExpiryTime], [a].[SecurityStamp], [a].[Site], [a].[TwoFactorEnabled], [a].[UserName]
razorpagecleanarchitecture-webui-1  | FROM [AspNetUsers] AS [a]
razorpagecleanarchitecture-webui-1  | WHERE [a].[NormalizedUserName] = @__normalizedUserName_0
razorpagecleanarchitecture-webui-1  | 2023-07-13 06:30:34.804 +00:00 [ERR] An exception occurred while iterating over the results of a query for context type 'CleanArchitecture.Razor.Infrastructure.Persistence.ApplicationDbContext'.
razorpagecleanarchitecture-webui-1  | Microsoft.Data.SqlClient.SqlException (0x80131904): Invalid column name 'IsLive'.
razorpagecleanarchitecture-webui-1  |    at Microsoft.Data.SqlClient.SqlCommand.<>c.<ExecuteDbDataReaderAsync>b__208_0(Task`1 result)
razorpagecleanarchitecture-webui-1  |    at System.Threading.Tasks.ContinuationResultTaskFromResultTask`2.InnerInvoke()
razorpagecleanarchitecture-webui-1  |    at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
razorpagecleanarchitecture-webui-1  | --- End of stack trace from previous location ---
razorpagecleanarchitecture-webui-1  |    at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
razorpagecleanarchitecture-webui-1  |    at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
razorpagecleanarchitecture-webui-1  | --- End of stack trace from previous location ---
razorpagecleanarchitecture-webui-1  |    at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)       
razorpagecleanarchitecture-webui-1  |    at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteReaderAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken)       
razorpagecleanarchitecture-webui-1  |    at Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable`1.AsyncEnumerator.InitializeReaderAsync(AsyncEnumerator enumerator, CancellationToken cancellationToken)
razorpagecleanarchitecture-webui-1  |    at Microsoft.EntityFrameworkCore.SqlServer.Storage.Internal.SqlServerExecutionStrategy.ExecuteAsync[TState,TResult](TState state, Func`4 operation, Func`4 verifySucceeded, CancellationToken cancellationToken)
razorpagecleanarchitecture-webui-1  |    at Microsoft.EntityFrameworkCore.Query.Internal.SingleQueryingEnumerable`1.AsyncEnumerator.MoveNextAsync()
razorpagecleanarchitecture-webui-1  | ClientConnectionId:ae9362c7-4997-44a7-8433-ea05126718d0
razorpagecleanarchitecture-webui-1  | Error Number:207,State:1,Class:16  <s:Microsoft.EntityFrameworkCore.Query>
razorpagecleanarchitecture-webui-1  | Microsoft.Data.SqlClient.SqlException (0x80131904): Invalid column name 'IsLive'.
razorpagecleanarchitecture-webui-1  |    at Microsoft.Data.SqlClient.SqlCommand.<>c.<ExecuteDbDataReaderAsync>b__208_0(Task`1 result)
razorpagecleanarchitecture-webui-1  |    at System.Threading.Tasks.ContinuationResultTaskFromResultTask`2.InnerInvoke()
razorpagecleanarchitecture-webui-1  |    at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
razorpagecleanarchitecture-webui-1  | --- End of stack trace from previous location ---
razorpagecleanarchitecture-webui-1  |    at System.Threading.ExecutionContext.RunInternal(ExecutionContext executionContext, ContextCallback callback, Object state)
razorpagecleanarchitecture-webui-1  |    at System.Threading.Tasks.Task.ExecuteWithThreadLocal(Task& currentTaskSlot, Thread threadPoolThread)
razorpagecleanarchitecture-webui-1  | --- End of stack trace from previous location ---
neozhu commented 1 year ago

The error message suggests that the 'IsLive' field is missing in the 'AspNetUsers' table. Try adding it manually, or delete the database and run it again.

kino3 commented 1 year ago

@neozhu Thank you for the prompt reply. However, I'm not sure why I'm getting this error (since it's odd that the code and DB definitions don't match in the first place). I am working on the main branch, would another branch or tag be better?

neozhu commented 1 year ago

Give it a shot deploying with the code from the 'dev' branch.

kino3 commented 1 year ago

I tried with the dev branch and had the following errors. @neozhu

razorpagecleanarchitecture-webui-1  | 2023-07-14 00:30:43.579 +00:00 [INF] Starting background tasks   <s:WorkflowCore.Services.WorkflowHost>
razorpagecleanarchitecture-webui-1  | [00:30:43 INF] Starting background tasks
razorpagecleanarchitecture-webui-1  | 2023-07-14 00:30:43.808 +00:00 [ERR] Failed executing DbCommand (0ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
razorpagecleanarchitecture-webui-1  | CREATE TABLE [ApprovalDatas] (
razorpagecleanarchitecture-webui-1  |     [WorkflowId] nvarchar(50) NOT NULL,
razorpagecleanarchitecture-webui-1  |     [WorkflowName] nvarchar(max) NULL,
razorpagecleanarchitecture-webui-1  |     [Status] nvarchar(max) NULL,
razorpagecleanarchitecture-webui-1  |     [DocumentName] nvarchar(max) NULL,
razorpagecleanarchitecture-webui-1  |     [DocumentId] int NOT NULL,
razorpagecleanarchitecture-webui-1  |     [Url] nvarchar(max) NULL,
razorpagecleanarchitecture-webui-1  |     [Applicant] nvarchar(max) NULL,
razorpagecleanarchitecture-webui-1  |     [Approver] nvarchar(max) NULL,
razorpagecleanarchitecture-webui-1  |     [Outcome] nvarchar(max) NULL,
razorpagecleanarchitecture-webui-1  |     [Comments] nvarchar(max) NULL,
razorpagecleanarchitecture-webui-1  |     [ApprovedDateTime] datetime2 NULL,
razorpagecleanarchitecture-webui-1  |     [RequestDateTime] datetime2 NOT NULL,
razorpagecleanarchitecture-webui-1  |     [Created] datetime2 NOT NULL,
razorpagecleanarchitecture-webui-1  |     [CreatedBy] nvarchar(max) NULL,
razorpagecleanarchitecture-webui-1  |     [LastModified] datetime2 NULL,
razorpagecleanarchitecture-webui-1  |     [LastModifiedBy] nvarchar(max) NULL,
razorpagecleanarchitecture-webui-1  |     CONSTRAINT [PK_ApprovalDatas] PRIMARY KEY ([WorkflowId])
razorpagecleanarchitecture-webui-1  | );   <s:Microsoft.EntityFrameworkCore.Database.Command>
razorpagecleanarchitecture-webui-1  | [00:30:43 ERR] Failed executing DbCommand (0ms) [Parameters=[], CommandType='Text', CommandTimeout='30']
razorpagecleanarchitecture-webui-1  | CREATE TABLE [ApprovalDatas] (
razorpagecleanarchitecture-webui-1  |     [WorkflowId] nvarchar(50) NOT NULL,
razorpagecleanarchitecture-webui-1  |     [WorkflowName] nvarchar(max) NULL,
razorpagecleanarchitecture-webui-1  |     [Status] nvarchar(max) NULL,
razorpagecleanarchitecture-webui-1  |     [DocumentName] nvarchar(max) NULL,
razorpagecleanarchitecture-webui-1  |     [DocumentId] int NOT NULL,
razorpagecleanarchitecture-webui-1  |     [Url] nvarchar(max) NULL,
razorpagecleanarchitecture-webui-1  |     [Applicant] nvarchar(max) NULL,
razorpagecleanarchitecture-webui-1  |     [Approver] nvarchar(max) NULL,
razorpagecleanarchitecture-webui-1  |     [Outcome] nvarchar(max) NULL,
razorpagecleanarchitecture-webui-1  |     [Comments] nvarchar(max) NULL,
razorpagecleanarchitecture-webui-1  |     [ApprovedDateTime] datetime2 NULL,
razorpagecleanarchitecture-webui-1  |     [RequestDateTime] datetime2 NOT NULL,
razorpagecleanarchitecture-webui-1  |     [Created] datetime2 NOT NULL,
razorpagecleanarchitecture-webui-1  |     [CreatedBy] nvarchar(max) NULL,
razorpagecleanarchitecture-webui-1  |     [LastModified] datetime2 NULL,
razorpagecleanarchitecture-webui-1  |     [LastModifiedBy] nvarchar(max) NULL,
razorpagecleanarchitecture-webui-1  |     CONSTRAINT [PK_ApprovalDatas] PRIMARY KEY ([WorkflowId])
razorpagecleanarchitecture-webui-1  | );
razorpagecleanarchitecture-webui-1  | 2023-07-14 00:30:43.810 +00:00 [ERR] An error occurred while migrating or seeding the database.   <s:Program>
razorpagecleanarchitecture-webui-1  | Microsoft.Data.SqlClient.SqlException (0x80131904): There is already an object named 'ApprovalDatas' in the database.   
razorpagecleanarchitecture-webui-1  |    at Microsoft.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
razorpagecleanarchitecture-webui-1  |    at Microsoft.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
razorpagecleanarchitecture-webui-1  |    at Microsoft.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
razorpagecleanarchitecture-webui-1  |    at Microsoft.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
razorpagecleanarchitecture-webui-1  |    at Microsoft.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean isAsync, Int32 timeout, Boolean asyncWrite)
razorpagecleanarchitecture-webui-1  |    at Microsoft.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, Boolean sendToPipe, Int32 timeout, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry, String methodName)
razorpagecleanarchitecture-webui-1  |    at Microsoft.Data.SqlClient.SqlCommand.ExecuteNonQuery()
razorpagecleanarchitecture-webui-1  |    at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteNonQuery(RelationalCommandParameterObject parameterObject)
razorpagecleanarchitecture-webui-1  |    at Microsoft.EntityFrameworkCore.Migrations.MigrationCommand.ExecuteNonQuery(IRelationalConnection connection, IReadOnlyDictionary`2 parameterValues)
razorpagecleanarchitecture-webui-1  |    at Microsoft.EntityFrameworkCore.Migrations.Internal.MigrationCommandExecutor.ExecuteNonQuery(IEnumerable`1 migrationCommands, IRelationalConnection connection)
razorpagecleanarchitecture-webui-1  |    at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.Migrate(String targetMigration)
razorpagecleanarchitecture-webui-1  |    at Microsoft.EntityFrameworkCore.RelationalDatabaseFacadeExtensions.Migrate(DatabaseFacade databaseFacade)
razorpagecleanarchitecture-webui-1  |    at Program.<Main>$(String[] args) in /src/src/SmartAdmin.WebUI/Program.cs:line 66
razorpagecleanarchitecture-webui-1  | ClientConnectionId:5ca8a345-5f5d-408b-ac7b-a8dace572c9e
razorpagecleanarchitecture-webui-1  | Error Number:2714,State:6,Class:16
razorpagecleanarchitecture-webui-1  | [00:30:43 ERR] An error occurred while migrating or seeding the database.
razorpagecleanarchitecture-webui-1  | Microsoft.Data.SqlClient.SqlException (0x80131904): There is already an object named 'ApprovalDatas' in the database.   
razorpagecleanarchitecture-webui-1  |    at Microsoft.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
razorpagecleanarchitecture-webui-1  |    at Microsoft.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
razorpagecleanarchitecture-webui-1  |    at Microsoft.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
razorpagecleanarchitecture-webui-1  |    at Microsoft.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
razorpagecleanarchitecture-webui-1  |    at Microsoft.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean isAsync, Int32 timeout, Boolean asyncWrite)
razorpagecleanarchitecture-webui-1  |    at Microsoft.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, Boolean sendToPipe, Int32 timeout, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry, String methodName)
razorpagecleanarchitecture-webui-1  |    at Microsoft.Data.SqlClient.SqlCommand.ExecuteNonQuery()
razorpagecleanarchitecture-webui-1  |    at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteNonQuery(RelationalCommandParameterObject parameterObject)
razorpagecleanarchitecture-webui-1  |    at Microsoft.EntityFrameworkCore.Migrations.MigrationCommand.ExecuteNonQuery(IRelationalConnection connection, IReadOnlyDictionary`2 parameterValues)
razorpagecleanarchitecture-webui-1  |    at Microsoft.EntityFrameworkCore.Migrations.Internal.MigrationCommandExecutor.ExecuteNonQuery(IEnumerable`1 migrationCommands, IRelationalConnection connection)
razorpagecleanarchitecture-webui-1  |    at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.Migrate(String targetMigration)
razorpagecleanarchitecture-webui-1  |    at Microsoft.EntityFrameworkCore.RelationalDatabaseFacadeExtensions.Migrate(DatabaseFacade databaseFacade)
razorpagecleanarchitecture-webui-1  |    at Program.<Main>$(String[] args) in /src/src/SmartAdmin.WebUI/Program.cs:line 66
razorpagecleanarchitecture-webui-1  | ClientConnectionId:5ca8a345-5f5d-408b-ac7b-a8dace572c9e
razorpagecleanarchitecture-webui-1  | Error Number:2714,State:6,Class:16
razorpagecleanarchitecture-webui-1  | Unhandled exception. Microsoft.Data.SqlClient.SqlException (0x80131904): There is already an object named 'ApprovalDatas' in the database.
razorpagecleanarchitecture-webui-1  |    at Microsoft.Data.SqlClient.SqlConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
razorpagecleanarchitecture-webui-1  |    at Microsoft.Data.SqlClient.SqlInternalConnection.OnError(SqlException exception, Boolean breakConnection, Action`1 wrapCloseInAction)
razorpagecleanarchitecture-webui-1  |    at Microsoft.Data.SqlClient.TdsParser.ThrowExceptionAndWarning(TdsParserStateObject stateObj, Boolean callerHasConnectionLock, Boolean asyncClose)
razorpagecleanarchitecture-webui-1  |    at Microsoft.Data.SqlClient.TdsParser.TryRun(RunBehavior runBehavior, SqlCommand cmdHandler, SqlDataReader dataStream, BulkCopySimpleResultSet bulkCopyHandler, TdsParserStateObject stateObj, Boolean& dataReady)
razorpagecleanarchitecture-webui-1  |    at Microsoft.Data.SqlClient.SqlCommand.RunExecuteNonQueryTds(String methodName, Boolean isAsync, Int32 timeout, Boolean asyncWrite)
razorpagecleanarchitecture-webui-1  |    at Microsoft.Data.SqlClient.SqlCommand.InternalExecuteNonQuery(TaskCompletionSource`1 completion, Boolean sendToPipe, Int32 timeout, Boolean& usedCache, Boolean asyncWrite, Boolean inRetry, String methodName)
razorpagecleanarchitecture-webui-1  |    at Microsoft.Data.SqlClient.SqlCommand.ExecuteNonQuery()
razorpagecleanarchitecture-webui-1  |    at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteNonQuery(RelationalCommandParameterObject parameterObject)
razorpagecleanarchitecture-webui-1  |    at Microsoft.EntityFrameworkCore.Migrations.MigrationCommand.ExecuteNonQuery(IRelationalConnection connection, IReadOnlyDictionary`2 parameterValues)
razorpagecleanarchitecture-webui-1  |    at Microsoft.EntityFrameworkCore.Migrations.Internal.MigrationCommandExecutor.ExecuteNonQuery(IEnumerable`1 migrationCommands, IRelationalConnection connection)
razorpagecleanarchitecture-webui-1  |    at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.Migrate(String targetMigration)
razorpagecleanarchitecture-webui-1  |    at Microsoft.EntityFrameworkCore.RelationalDatabaseFacadeExtensions.Migrate(DatabaseFacade databaseFacade)
razorpagecleanarchitecture-webui-1  |    at Program.<Main>$(String[] args) in /src/src/SmartAdmin.WebUI/Program.cs:line 66
razorpagecleanarchitecture-webui-1  |    at Program.<Main>(String[] args)
razorpagecleanarchitecture-webui-1  | ClientConnectionId:5ca8a345-5f5d-408b-ac7b-a8dace572c9e
razorpagecleanarchitecture-webui-1  | Error Number:2714,State:6,Class:16
razorpagecleanarchitecture-webui-1 exited with code 139
neozhu commented 1 year ago

From the prompt, it is repeated creation, so you need to delete the created database first

kino3 commented 1 year ago

@neozhu Thank you for your comments. I just set up my local docker-compose environment. Comparing docker-compose.yml in the main branch and dev branch, I found the following steps.

  1. use dev branch
  2. add the following to the docker-compose.yml
      - "ASPNETCORE_Kestrel__Certificates__Default__Password=<your cert pass>"
      - "ASPNETCORE_Kestrel__Certificates__Default__Path=/root/.aspnet/https/<your pfx name>.pfx"
  3. if exists, remove all volume data in ${USERPROFILE}\mssql_data etc.
  4. docker compose -f .\docker-compose.yml up --build

I will send you a pull request later.