You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
An unhandled Npgsql.PostgresException exception occurred at startup BTCPAYSERVER.
It looks like EF tries to apply already applied migrations for tables where schema is different from public.
Only affects databases where public isn't the main schema.
How did you encounter this bug?
Faced with the error after updating BTCPAYSERVER from 1.11.7 to 1.12.3 version
Relevant log output
Unhandled exception. Npgsql.PostgresException (0x80004005): 42P07: relation "__EFMigrationsHistory" already exists btcpayserver
at Npgsql.Internal.NpgsqlConnector.ReadMessageLong(Boolean async, DataRowLoadingMode dataRowLoadingMode, Boolean readingNotifications, Boolean isReadingPrependedMessage) btcpayserver
at System.Runtime.CompilerServices.PoolingAsyncValueTaskMethodBuilder`1.StateMachineBox`1.System.Threading.Tasks.Sources.IValueTaskSource<TResult>.GetResult(Int16 token) btcpayserver
at Npgsql.NpgsqlDataReader.NextResult(Boolean async, Boolean isConsuming, CancellationToken cancellationToken) btcpayserver
at Npgsql.NpgsqlDataReader.NextResult(Boolean async, Boolean isConsuming, CancellationToken cancellationToken) btcpayserver
at Npgsql.NpgsqlCommand.ExecuteReader(Boolean async, CommandBehavior behavior, CancellationToken cancellationToken) btcpayserver
at Npgsql.NpgsqlCommand.ExecuteReader(Boolean async, CommandBehavior behavior, CancellationToken cancellationToken) btcpayserver
at Npgsql.NpgsqlCommand.ExecuteNonQuery(Boolean async, CancellationToken cancellationToken) btcpayserver
at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteNonQueryAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken) btcpayserver
at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteNonQueryAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken) btcpayserver
at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteNonQueryAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken) btcpayserver
at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.MigrateAsync(String targetMigration, CancellationToken cancellationToken) btcpayserver
at Npgsql.EntityFrameworkCore.PostgreSQL.Migrations.Internal.NpgsqlMigrator.MigrateAsync(String targetMigration, CancellationToken cancellationToken) btcpayserver
at BTCPayServer.Hosting.MigrationStartupTask.Migrate(CancellationToken cancellationToken) in /source/BTCPayServer/Hosting/MigrationStartupTask.cs:line 862 btcpayserver
at BTCPayServer.Hosting.MigrationStartupTask.ExecuteAsync(CancellationToken cancellationToken) in /source/BTCPayServer/Hosting/MigrationStartupTask.cs:line 85 btcpayserver
at Microsoft.AspNetCore.Hosting.WebHostExtensions.StartWithTasksAsync(IWebHost webHost, CancellationToken cancellationToken) in /source/BTCPayServer/Extensions/WebHostExtensions.cs:line 19 btcpayserver
at BTCPayServer.Program.Main(String[] args) in /source/BTCPayServer/Program.cs:line 76 btcpayserver
at BTCPayServer.Program.Main(String[] args) in /source/BTCPayServer/Program.cs:line 103 btcpayserver
at BTCPayServer.Program.<Main>(String[] args) btcpayserver
Exception data: btcpayserver
Severity: ERROR btcpayserver
SqlState: 42P07 btcpayserver
MessageText: relation "__EFMigrationsHistory" already exists btcpayserver
File: heap.c btcpayserver
Line: 1162 btcpayserver
Routine: heap_create_with_catalog btcpayserver
at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteNonQueryAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken) btcpayserver
at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteNonQueryAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken) btcpayserver
at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.MigrateAsync(String targetMigration, CancellationToken cancellationToken) btcpayserver
at Npgsql.EntityFrameworkCore.PostgreSQL.Migrations.Internal.NpgsqlMigrator.MigrateAsync(String targetMigration, CancellationToken cancellationToken) btcpayserver
at BTCPayServer.Hosting.MigrationStartupTask.Migrate(CancellationToken cancellationToken) in /source/BTCPayServer/Hosting/MigrationStartupTask.cs:line 862 btcpayserver
at BTCPayServer.Hosting.MigrationStartupTask.ExecuteAsync(CancellationToken cancellationToken) in /source/BTCPayServer/Hosting/MigrationStartupTask.cs:line 85 btcpayserver
Exception data: btcpayserver
Severity: ERROR btcpayserver
SqlState: 42P07 btcpayserver
MessageText: relation "__EFMigrationsHistory" already exists btcpayserver
File: heap.c btcpayserver
Line: 1162 btcpayserver
Routine: heap_create_with_catalog btcpayserver
BTCPayServer.Hosting.MigrationStartupTask: Error on the MigrationStartupTask btcpayserver
Npgsql.PostgresException (0x80004005): 42P07: relation "__EFMigrationsHistory" already exists btcpayserver
at Npgsql.Internal.NpgsqlConnector.ReadMessageLong(Boolean async, DataRowLoadingMode dataRowLoadingMode, Boolean readingNotifications, Boolean isReadingPrependedMessage) btcpayserver
at System.Runtime.CompilerServices.PoolingAsyncValueTaskMethodBuilder`1.StateMachineBox`1.System.Threading.Tasks.Sources.IValueTaskSource<TResult>.GetResult(Int16 token) btcpayserver
at Npgsql.NpgsqlDataReader.NextResult(Boolean async, Boolean isConsuming, CancellationToken cancellationToken) btcpayserver
at Npgsql.NpgsqlDataReader.NextResult(Boolean async, Boolean isConsuming, CancellationToken cancellationToken) btcpayserver
at Npgsql.NpgsqlCommand.ExecuteReader(Boolean async, CommandBehavior behavior, CancellationToken cancellationToken) btcpayserver
at Npgsql.NpgsqlCommand.ExecuteReader(Boolean async, CommandBehavior behavior, CancellationToken cancellationToken) btcpayserver
at Npgsql.NpgsqlCommand.ExecuteNonQuery(Boolean async, CancellationToken cancellationToken) btcpayserver
at Microsoft.EntityFrameworkCore.Storage.RelationalCommand.ExecuteNonQueryAsync(RelationalCommandParameterObject parameterObject, CancellationToken cancellationToken) btcpayserver
2024-01-24T07:59:23Z New outbound-full-relay v1 peer connected: version: 70016, blocks=2575515, peer=4 bitcoind
What browser do you use?
No response
Additional information
No response
Are you sure this is a bug report?
I confirm this is a bug report
The text was updated successfully, but these errors were encountered:
In our project, we build a Docker file with a config where we define Search Path in PostgreSQL connectionString, e.g Host=;Port=;Database=;Search Path=boundedcontext;
Could you look at the next workaround with searchPaths? I believe it can solve this issue.
What is your BTCPay version?
BTCPAYSERVER: 1.12.3
How did you deploy BTCPay Server?
Docker
What happened?
An unhandled Npgsql.PostgresException exception occurred at startup BTCPAYSERVER.
It looks like EF tries to apply already applied migrations for tables where schema is different from
public
.Only affects databases where
public
isn't the main schema.How did you encounter this bug?
Faced with the error after updating BTCPAYSERVER from 1.11.7 to 1.12.3 version
Relevant log output
What browser do you use?
No response
Additional information
No response
Are you sure this is a bug report?
The text was updated successfully, but these errors were encountered: