Base solution for your next web application

Activities of "osweater"

Hi all,

I've deployed the project to Linux using docker compose, the only problem I'm facing is the DB migration since I can't find the Migrator.exe file. I tried to use the run-migrator.ps1 script but I got this error while building the image:

 => ERROR [mycompanyname.abpzerotemplate.migrator build  7/10] RUN dotnet restore "src/Bone.Migrator/Bone.Migrator.csproj"                                                                                 1.4s
------
 > [mycompanyname.abpzerotemplate.migrator build  7/10] RUN dotnet restore "src/Bone.Migrator/Bone.Migrator.csproj":
1.055   Determining projects to restore...
1.252 /usr/share/dotnet/sdk/6.0.414/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.TargetFrameworkInference.targets(144,5): error NETSDK1045: The current .NET SDK does not support targeting .NET 7.0.  Either target .NET 6.0 or lower, or use a version of the .NET SDK that supports .NET 7.0. [/src/src/Bone.EntityFrameworkCore/Bone.EntityFrameworkCore.csproj]
1.255 /usr/share/dotnet/sdk/6.0.414/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.TargetFrameworkInference.targets(144,5): error NETSDK1045: The current .NET SDK does not support targeting .NET 7.0.  Either target .NET 6.0 or lower, or use a version of the .NET SDK that supports .NET 7.0. [/src/src/Bone.Core/Bone.Core.csproj]
1.286 /usr/share/dotnet/sdk/6.0.414/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.TargetFrameworkInference.targets(144,5): error NETSDK1045: The current .NET SDK does not support targeting .NET 7.0.  Either target .NET 6.0 or lower, or use a version of the .NET SDK that supports .NET 7.0. [/src/src/Bone.Migrator/Bone.Migrator.csproj]
------
failed to solve: process "/bin/sh -c dotnet restore \"src/Bone.Migrator/Bone.Migrator.csproj\"" did not complete successfully: exit code: 1

What is the best way to migrate the production DB when the project is hosted in a Linux machine?

Why I can't find the Migrator.exe file?

Thanks @ismcagdas

The problem have been solved, we changed the connection string after we've migrated to Postgresql

But now I have another issue when opening the Host project (mydomain.com/Ui/Login) from the browser, I got the following error:

InvalidCastException: Cannot write DateTime with Kind=Local to PostgreSQL type 'timestamp with time zone', only UTC is supported. Note that it's not possible to mix DateTimes with different Kinds in an array/range. See the Npgsql.EnableLegacyTimestampBehavior AppContext switch to enable legacy behavior.

Question

Hi all,

We face issues while deploying the app to a Linux server. We've tried multiple methods to deploy the app. First, we tested the build-mvc.ps1 script on a Windows machine to build the docker images, and they've been built successfully and using the following connection string we were able to run the app successfully:

Server=HOST_NAME,1433;Initial Catalog=DATABASE;Persist Security Info=False;User ID=USERNAME;Password=PASSWORD;MultipleActiveResultSets=False;Encrypt=True;TrustServerCertificate=False;Connection Timeout=30;

But when we tried to follow the same instructions on a Linux machine we faced an issue with the connection string:

 Abp.BackgroundJobs.BackgroundJobManager  - System.ArgumentException: Couldn't set initial catalog (Parameter 'initial catalog')
 ---> System.Collections.Generic.KeyNotFoundException: The given key was not present in the dictionary.

What we've missed in the deployment process, we will appreciate your help.

Question

Hi, I am trying to use Postgres on the latest zero version but when updating the database I get this error

`Failed executing DbCommand (225ms) [Parameters=[], CommandType='Text', CommandTimeout='30'] CREATE UNIQUE INDEX "IX_AppSubscriptionPaymentsExtensionData_SubscriptionPaymentId_Key_IsDeleted" ON "AppSubscriptionPaymentsExtensionData" ("SubscriptionPaymentId", "Key", "IsDeleted") WHERE [IsDeleted] = 0; Npgsql.PostgresException (0x80004005): 42601: syntax error at or near "["

POSITION: 193 at Npgsql.Internal.NpgsqlConnector.g__ReadMessageLong|234_0(NpgsqlConnector connector, Boolean async, DataRowLoadingMode dataRowLoadingMode, Boolean readingNotifications, Boolean isReadingPrependedMessage) at Npgsql.NpgsqlDataReader.NextResult(Boolean async, Boolean isConsuming, CancellationToken cancellationToken) at Npgsql.NpgsqlDataReader.NextResult(Boolean async, Boolean isConsuming, CancellationToken cancellationToken) at Npgsql.NpgsqlDataReader.NextResult() at Npgsql.NpgsqlCommand.ExecuteReader(CommandBehavior behavior, Boolean async, CancellationToken cancellationToken) at Npgsql.NpgsqlCommand.ExecuteReader(CommandBehavior behavior, Boolean async, CancellationToken cancellationToken) at Npgsql.NpgsqlCommand.ExecuteNonQuery(Boolean async, CancellationToken cancellationToken) at Npgsql.NpgsqlCommand.ExecuteNonQuery() at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteNonQuery(RelationalCommandParameterObject parameterObject) at Microsoft.EntityFrameworkCore.Migrations.MigrationCommand.ExecuteNonQuery(IRelationalConnection connection, IReadOnlyDictionary2 parameterValues) at Microsoft.EntityFrameworkCore.Migrations.Internal.MigrationCommandExecutor.ExecuteNonQuery(IEnumerable1 migrationCommands, IRelationalConnection connection) at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.Migrate(String targetMigration) at Microsoft.EntityFrameworkCore.Design.Internal.MigrationsOperations.UpdateDatabase(String targetMigration, String connectionString, String contextType) at Microsoft.EntityFrameworkCore.Design.OperationExecutor.UpdateDatabaseImpl(String targetMigration, String connectionString, String contextType) at Microsoft.EntityFrameworkCore.Design.OperationExecutor.UpdateDatabase.<>c__DisplayClass0_0.<.ctor>b__0() at Microsoft.EntityFrameworkCore.Design.OperationExecutor.OperationBase.Execute(Action action) Exception data: Severity: ERROR SqlState: 42601 MessageText: syntax error at or near "[" Position: 193 File: scan.l Line: 1188 Routine: scanner_yyerror 42601: syntax error at or near "["`

I think its in this block of code migrationBuilder.CreateIndex( name: "IX_AppSubscriptionPaymentsExtensionData_SubscriptionPaymentId_~", table: "AppSubscriptionPaymentsExtensionData", columns: new[] { "SubscriptionPaymentId", "Key", "IsDeleted" }, unique: true, filter: "[IsDeleted] = 0");

Thanks in advance,

Showing 1 to 4 of 4 entries