Similar Posts

Leave a Reply

Your email address will not be published. Required fields are marked *

8 Comments

  1. Can you give instructions on how to do this without docker? Also https cert configuration info will be helpful.

    1. I noticed the same and I was lucky to find this command elsewhere. Without it the install step says that the SDKs/runtimes don’t even exist.

  2. This is a good article, but there are many important steps missing. I had to add them, and if I had used this document two weeks ago I would not have been able to figure them out.

    To name a few:

    1) the addition of the dotnet executable is missing (sudo yum install dotnet)

    2) Without this command

    sudo rpm -Uvh https://packages.microsoft.com/config/centos/7/packages-microsoft-prod.rpm

    the dotnet runtimes/SDKs cannot be installed, they give uninformative error messages that the packages don’t even exist. I found this in another document but I would have been blocked without it

    3) Initial database setup is not explained. As written, the postegres connection string refers to a database that has not been created. In this case the ProductDB database does not exist, and the migration does not include CREATE DATABASE. The migration builder does not include this command.

    4) the docker-compose YML file only include HTTP, not HTTPS; this is a horrible omission, HTTPS configuration is quite difficult and NOBODY uses HTTP anymore.

    5) there is no mention of connecting to the contained Postgres database with pgAdmin. Without this, testing the service on AWS is impossible . It would be better to have the Postgres database outside the container as far as I can see.

    Please help me with the HTTPS setup.

  3. I am getting this error
    Unhandled exception. Npgsql.NpgsqlException (0x80004005): Failed to connect to [::1]:5432
    —> System.Net.Sockets.SocketException (99): Cannot assign requested address [::1]:5432
    at System.Net.Sockets.Socket.DoConnect(EndPoint endPointSnapshot, SocketAddress socketAddress)
    at System.Net.Sockets.Socket.Connect(EndPoint remoteEP)
    at Npgsql.Internal.NpgsqlConnector.Connect(NpgsqlTimeout timeout)
    at Npgsql.Internal.NpgsqlConnector.Connect(NpgsqlTimeout timeout)
    at Npgsql.Internal.NpgsqlConnector.RawOpen(SslMode sslMode, NpgsqlTimeout timeout, Boolean async, CancellationToken cancellationToken, Boolean isFirstAttempt)
    at Npgsql.Internal.NpgsqlConnector.g__OpenCore|213_1(NpgsqlConnector conn, SslMode sslMode, NpgsqlTimeout timeout, Boolean async, CancellationToken cancellationToken, Boolean isFirstAttempt)
    at Npgsql.Internal.NpgsqlConnector.Open(NpgsqlTimeout timeout, Boolean async, CancellationToken cancellationToken)
    at Npgsql.UnpooledDataSource.Get(NpgsqlConnection conn, NpgsqlTimeout timeout, Boolean async, CancellationToken cancellationToken)
    at Npgsql.NpgsqlConnection.g__OpenAsync|42_0(Boolean async, CancellationToken cancellationToken)
    at Npgsql.NpgsqlConnection.Open()
    at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.OpenDbConnection(Boolean errorsExpected)
    at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.OpenInternal(Boolean errorsExpected)
    at Microsoft.EntityFrameworkCore.Storage.RelationalConnection.Open(Boolean errorsExpected)
    at Npgsql.EntityFrameworkCore.PostgreSQL.Storage.Internal.NpgsqlDatabaseCreator.Exists(Boolean async, CancellationToken cancellationToken)
    at Npgsql.EntityFrameworkCore.PostgreSQL.Storage.Internal.NpgsqlDatabaseCreator.Exists(Boolean async, CancellationToken cancellationToken)
    at Npgsql.EntityFrameworkCore.PostgreSQL.Storage.Internal.NpgsqlDatabaseCreator.Exists()
    at Microsoft.EntityFrameworkCore.Migrations.HistoryRepository.Exists()
    at Microsoft.EntityFrameworkCore.Migrations.HistoryRepository.GetAppliedMigrations()
    at Microsoft.EntityFrameworkCore.RelationalDatabaseFacadeExtensions.GetAppliedMigrations(DatabaseFacade databaseFacade)
    at Microsoft.EntityFrameworkCore.RelationalDatabaseFacadeExtensions.GetPendingMigrations(DatabaseFacade databaseFacade)
    at Program.$(String[] args) in /home/ubuntu/repos/TaraDataEntryApi/src/TaraDataEntryApi.Api/Program.cs:line 121
    at Program.(String[] args)