Skip to content
This repository was archived by the owner on Dec 19, 2018. It is now read-only.

Useless error message #826

Closed
imperugo opened this issue Jul 27, 2016 · 4 comments
Closed

Useless error message #826

imperugo opened this issue Jul 27, 2016 · 4 comments

Comments

@imperugo
Copy link

Hi,
today I had a problem deploying my aspnet core application on Azure.
The error message was saying:

Application: Gaia.Bmw.Admin.exe
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: Microsoft.AspNetCore.Server.Kestrel.Internal.Networking.UvException
   at Microsoft.AspNetCore.Server.Kestrel.Internal.Networking.Libuv.Check(Int32)
   at Microsoft.AspNetCore.Server.Kestrel.Internal.Networking.Libuv.tcp_bind(Microsoft.AspNetCore.Server.Kestrel.Internal.Networking.UvTcpHandle, Microsoft.AspNetCore.Server.Kestrel.Internal.Networking.SockAddr ByRef, Int32)
   at Microsoft.AspNetCore.Server.Kestrel.Internal.Networking.UvTcpHandle.Bind(Microsoft.AspNetCore.Server.Kestrel.ServerAddress)
   at Microsoft.AspNetCore.Server.Kestrel.Internal.Http.TcpListenerPrimary.CreateListenSocket()
   at Microsoft.AspNetCore.Server.Kestrel.Internal.Http.Listener+<>c.<StartAsync>b__6_0(System.Object)
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(System.Threading.Tasks.Task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(System.Threading.Tasks.Task)
   at Microsoft.AspNetCore.Server.Kestrel.Internal.Http.ListenerPrimary+<StartAsync>d__11.MoveNext()

Exception Info: System.AggregateException
   at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean)
   at System.Threading.Tasks.Task.Wait(Int32, System.Threading.CancellationToken)
   at Microsoft.AspNetCore.Server.Kestrel.Internal.KestrelEngine.CreateServer(Microsoft.AspNetCore.Server.Kestrel.ServerAddress)
   at Microsoft.AspNetCore.Server.Kestrel.KestrelServer.Start[[Microsoft.AspNetCore.Hosting.Internal.HostingApplication+Context, Microsoft.AspNetCore.Hosting, Version=1.0.0.0, Culture=neutral, PublicKeyToken=adb9793829ddae60]](Microsoft.AspNetCore.Hosting.Server.IHttpApplication`1<Context>)
   at Microsoft.AspNetCore.Hosting.Internal.WebHost.Start()
   at Microsoft.AspNetCore.Hosting.WebHostExtensions.Run(Microsoft.AspNetCore.Hosting.IWebHost, System.Threading.CancellationToken, System.String)
   at Microsoft.AspNetCore.Hosting.WebHostExtensions.Run(Microsoft.AspNetCore.Hosting.IWebHost)
   at Gaia.Bmw.Admin.Program.Main(System.String[])

After few hours I noticed that the order on program.cs file was wrong.

.UseIISIntegration()must be after .UseUrls()

I don't know if it is my fault or not (for me the order wasn't so important, otherwise I should get a compilation error) but the error message wasn't helpful.

@Tratcher
Copy link
Member

This issue was moved to aspnet/KestrelHttpServer#1020

@davidfowl
Copy link
Member

The order is important because the ASP.NET Core module passes the port to Kestrel when running behind IIS. It's the equivalent in node when you do this:

 app.set('port', process.env.PORT || 3000);

In ASP.NET it's the reverse:

.UseUrls(...) -> // defaults
.UseIISIntegration() // override when IIS active

As for the unhelpful error message, that's a kestrel issue:

/cc @CesarBS @halter73

@imperugo
Copy link
Author

imperugo commented Jul 27, 2016

Hi @davidfowl
thanks for the quick answer.
If the order is important, I'm not should be able to do it, right?

You can "play" with fluent interfaces to prevent this error. doesn't it?

@Tratcher
Copy link
Member

Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants