Asp.net core based docker image failing

I have been running a docker based asp.net core app, initially when i set it up a month back it was working but now we are getting an error. We tried reverting to the original deployment which was working earlier but still it is not working.

Microsoft.AspNetCore.Server.Kestrel[0], Unable to start Kestrel. System.Net.Sockets.SocketException (13): Permission denied,

I tried explicitly setting the port but still the same issue exists.

Hi @Pramod_Pallath_Vasud, welcome to the Render community!

I took a look at your service and it looks like you specify port 80 in your environment variable which may be the cause of the permission denied error. Based on what I found in this thread, .NET 5 - Unable to start Kestrel - System.Net.Sockets.SocketException (13): Permission denied · Issue #29139 · dotnet/aspnetcore · GitHub you might need to specify a port > 1024. Can you try that and see if it helps?

Thanks. That worked. For anyone who faced this issue, Added an environment variable called PORT and used the port 1025.

in the asp.net core application also i made the following change

public static IHostBuilder CreateHostBuilder(string args) =>
Host.CreateDefaultBuilder(args)
.ConfigureWebHostDefaults(webBuilder =>
{
// webBuilder.UseStartup();

                var port = Environment.GetEnvironmentVariable("PORT");
                webBuilder.UseStartup<Startup>()
                .UseUrls("http://*:" + port);
            });