bagetter / BaGetter

A lightweight NuGet and symbol server
https://www.bagetter.com
MIT License
269 stars 57 forks source link

PostGresL .... Not Working ? #193

Closed Nonobis closed 1 week ago

Nonobis commented 1 week ago

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:

.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(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)

Nonobis commented 1 week ago

Found it : Database__ConnectionString=Server=db;Port=5432;Database=bagetter;User ID=bagetter;Password=bagetter; :)