Base solution for your next web application
Open Closed

Deploy to Linux Issues #11703


User avatar
0
osweater created

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.


3 Answer(s)
  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi @osweater

    Do oyu use SQL Server or any other database provider ? These scripts are designed for SQL Server.

  • User Avatar
    0
    osweater created

    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.

  • User Avatar
    0
    ismcagdas created
    Support Team

    Hi,

    You can use Npgsql.EnableLegacyTimestampBehavior , see https://github.com/npgsql/npgsql/issues/4279#issuecomment-1380525054

    But, we will investigate this problem deeper.