Connection string seem ok for me bug maybe it's not the expected format ? I haven't found information on docs.
Additional context
bagetter | Unhandled exception. System.ArgumentException: Format of the initialization string does not conform to specification starting at index 0.
bagetter | at System.Data.Common.DbConnectionOptions.GetKeyValuePair(String connectionString, Int32 currentPosition, StringBuilder buffer, Boolean useOdbcRules, String& keyname, String& keyvalue)
bagetter | at System.Data.Common.DbConnectionOptions.ParseInternal(Dictionary2 parsetable, String connectionString, Boolean buildChain, Dictionary2 synonyms, Boolean firstKey)
bagetter | at System.Data.Common.DbConnectionOptions..ctor(String connectionString, Dictionary2 synonyms, Boolean useOdbcRules) bagetter | at System.Data.Common.DbConnectionStringBuilder.set_ConnectionString(String value) bagetter | at Npgsql.NpgsqlConnectionStringBuilder..ctor(String connectionString) bagetter | at Npgsql.EntityFrameworkCore.PostgreSQL.Storage.Internal.NpgsqlDatabaseCreator.Exists(Boolean async, CancellationToken cancellationToken) bagetter | at Microsoft.EntityFrameworkCore.Migrations.HistoryRepository.ExistsAsync(CancellationToken cancellationToken) bagetter | at Microsoft.EntityFrameworkCore.Migrations.HistoryRepository.GetAppliedMigrationsAsync(CancellationToken cancellationToken) bagetter | at Npgsql.EntityFrameworkCore.PostgreSQL.Migrations.Internal.NpgsqlMigrator.MigrateAsync(String targetMigration, CancellationToken cancellationToken) bagetter | at BaGetter.Core.AbstractContext1.RunMigrationsAsync(CancellationToken cancellationToken)
bagetter | at BaGetter.Database.PostgreSql.PostgreSqlContext.RunMigrationsAsync(CancellationToken cancellationToken)
bagetter | at BaGetter.Web.IHostExtensions.RunMigrationsAsync(IHost host, CancellationToken cancellationToken)
bagetter | at BaGetter.Program.<>cDisplayClass0_0.<
b1>d.MoveNext()
bagetter | --- End of stack trace from previous location ---
bagetter | at McMaster.Extensions.CommandLineUtils.CommandLineApplicationExtensions.<>cDisplayClass8_0.<b0>d.MoveNext()
bagetter | --- End of stack trace from previous location ---
bagetter | at McMaster.Extensions.CommandLineUtils.CommandLineApplication.ExecuteAsync(String[] args, CancellationToken cancellationToken)
bagetter | at BaGetter.Program.Main(String[] args)
bagetter | at BaGetter.Program.
(String[] args)
Describe the bug
Can't make bagetter working with postgres ...any idea ?
To Reproduce
Docker Compose :
services:
db: container_name: postgres image: postgres:latest pull_policy: always env_file: .env ports:
/home/postgres:/var/lib/postgresql/data
bagetter: container_name: bagetter image: bagetter/bagetter:latest restart: unless-stopped pull_policy: always env_file: .env depends_on:
.env
DatabaseConnectionString=postgres://bagetter:bagetter@db:5432/bagetter DatabaseType=PostgreSql
Expected behavior
Connection string seem ok for me bug maybe it's not the expected format ? I haven't found information on docs.
Additional context
bagetter | Unhandled exception. System.ArgumentException: Format of the initialization string does not conform to specification starting at index 0. bagetter | at System.Data.Common.DbConnectionOptions.GetKeyValuePair(String connectionString, Int32 currentPosition, StringBuilder buffer, Boolean useOdbcRules, String& keyname, String& keyvalue) bagetter | at System.Data.Common.DbConnectionOptions.ParseInternal(Dictionary
2 parsetable, String connectionString, Boolean buildChain, Dictionary
2 synonyms, Boolean firstKey) bagetter | at System.Data.Common.DbConnectionOptions..ctor(String connectionString, Dictionary2 synonyms, Boolean useOdbcRules) bagetter | at System.Data.Common.DbConnectionStringBuilder.set_ConnectionString(String value) bagetter | at Npgsql.NpgsqlConnectionStringBuilder..ctor(String connectionString) bagetter | at Npgsql.EntityFrameworkCore.PostgreSQL.Storage.Internal.NpgsqlDatabaseCreator.Exists(Boolean async, CancellationToken cancellationToken) bagetter | at Microsoft.EntityFrameworkCore.Migrations.HistoryRepository.ExistsAsync(CancellationToken cancellationToken) bagetter | at Microsoft.EntityFrameworkCore.Migrations.HistoryRepository.GetAppliedMigrationsAsync(CancellationToken cancellationToken) bagetter | at Npgsql.EntityFrameworkCore.PostgreSQL.Migrations.Internal.NpgsqlMigrator.MigrateAsync(String targetMigration, CancellationToken cancellationToken) bagetter | at BaGetter.Core.AbstractContext
1.RunMigrationsAsync(CancellationToken cancellationToken) bagetter | at BaGetter.Database.PostgreSql.PostgreSqlContext.RunMigrationsAsync(CancellationToken cancellationToken) bagetter | at BaGetter.Web.IHostExtensions.RunMigrationsAsync(IHost host, CancellationToken cancellationToken) bagetter | at BaGetter.Program.<>cDisplayClass0_0.< b1>d.MoveNext() bagetter | --- End of stack trace from previous location --- bagetter | at McMaster.Extensions.CommandLineUtils.CommandLineApplicationExtensions.<>cDisplayClass8_0.<b0>d.MoveNext() bagetter | --- End of stack trace from previous location --- bagetter | at McMaster.Extensions.CommandLineUtils.CommandLineApplication.ExecuteAsync(String[] args, CancellationToken cancellationToken) bagetter | at BaGetter.Program.Main(String[] args) bagetter | at BaGetter.Program. (String[] args)