we are planning to deploy our ASP.net core 6.0 MVC application in a linux instance, however when running
“dotnet MyApp.dll” in Linux (Ubuntu) terminal, the application just hangs-up in
“Start installing Hangfire SQL objects…”
sometimes, if we run it with a docker image we get a time out error like this
2023-02-20 23:39:10 warn: Hangfire.SqlServer.SqlServerObjectsInstaller[0]
2023-02-20 23:39:10 An exception occurred while trying to perform the migration. Retrying...
2023-02-20 23:39:10 System.Data.SqlClient.SqlException (0x80131904): A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible. Verify that the instance name is correct and that SQL Server is configured to allow remote connections. (provider: TCP Provider, error: 40 - Could not open a connection to SQL
This is without docker or anything, just plain straight up terminal run.
Our database is SQL Server and it has a public IP where the hangfire connects to it, running the same command in Windows is ok and it can server our site correctly.
we have done nothing special, just straight up
services.AddHangfireServer();
...
services.AddHangfire(x =>
{
x.UseSqlServerStorage(builder.Configuration.GetConnectionString("DpScopicAARP"));
BackgroundJobsManager.Initialize();
});
...
app.UseHangfireDashboard();
I tried to ping the database IP and even telnet the IP and port and it can connect succesfuly.
Hangfire version is 1.7.32 for AspNetCore
EntityFramework (6.4.4)
we are litteraly blank of what to do next or how to debug this,
Please let us know what to look, or what information you guys need to help us resolve this.
Any help is appreaciated