locked
Throw Exception in my Self-Host program RRS feed

  • Question

  • User-80687829 posted

    Hello, I have a corporate chat service that is currently running for employees and customers.

    The number of connections in the last months has multiplied by 5x. The application is steadily following. But yesterday burst the following error below:

    NOTE: There were 400 connections at the time of the error

    Can you help me? =)

    My self-host program:

    namespace BQChat.Application.SelfHost
    {
    
    class Program
    {
    
        static void Main(string[] args)
        {
            string url = ConfigurationManager.AppSettings["HostDirect"];
            using (WebApp.Start(url))
            {
                Console.WriteLine("Direct Server running on {0}", url);
                Console.ReadLine();
            }            
        }
    }
    
    class Startup
    {
    
        public void Configuration(IAppBuilder app)
        {
            
            app.UseCors(CorsOptions.AllowAll);
            var chatProviderService = AutofacConfig.Container.Resolve<IChatProviderService>();
            GlobalHost.DependencyResolver.Register(typeof(AppHub), () => new AppHub(chatProviderService));
            GlobalHost.Configuration.DefaultMessageBufferSize = 850;
            
            app.Map("/signalr", map =>
            {
                map.UseCors(CorsOptions.AllowAll);
                var hubConfiguration = new HubConfiguration()
                {
                    EnableDetailedErrors = true,
                    EnableJSONP = true
                };
                map.RunSignalR(hubConfiguration);
            });
    
    
        }
    
    }

    Error

    `15:08:25

    Nome do aplicativo com falha: BQChat.Application.SelfHost.exe, versão: 1.0.0.0, carimbo de data/hora: 0x5b682a9f
    Nome do módulo com falha: KERNELBASE.dll, versão: 6.3.9600.18264, carimbo de data/hora: 0x56e1b34d
    Código de exceção: 0xe0434352
    Deslocamento da falha: 0x00015b68
    ID do processo com falha: 0x365c
    Hora de início do aplicativo com falha: 0x01d4300bf6098fdc
    Caminho do aplicativo com falha: C:\BQChat\host\BQChat.Application.SelfHost.exe
    Caminho do módulo com falha: C:\Windows\SYSTEM32\KERNELBASE.dll
    ID do Relatório: 35490950-9bff-11e8-80d6-00505680a589
    Nome completo do pacote com falha:
    ID do aplicativo relativo ao pacote com falha:

    15:08:24

    Aplicativo: BQChat.Application.SelfHost.exe
    Versão do Framework: v4.0.30319
    Descrição: O processo foi terminado devido a uma exceção sem tratamento.
    Informações da Exceção: System.Net.HttpListenerException
    em System.Net.HttpListener.AddAllPrefixes()
    em System.Net.HttpListener.Start()
    em Microsoft.Owin.Host.HttpListener.OwinHttpListener.Start(System.Net.HttpListener, System.Func2<System.Collections.Generic.IDictionary2<System.String,System.Object>,System.Threading.Tasks.Task>, System.Collections.Generic.IList1<System.Collections.Generic.IDictionary2<System.String,System.Object>>, System.Collections.Generic.IDictionary2<System.String,System.Object>, System.Func2<System.String,System.Func6<System.Diagnostics.TraceEventType,Int32,System.Object,System.Exception,System.Func3<System.Object,System.Exception,System.String>,Boolean>>)
    em Microsoft.Owin.Host.HttpListener.OwinServerFactory.Create(System.Func2<System.Collections.Generic.IDictionary2<System.String,System.Object>,System.Threading.Tasks.Task>, System.Collections.Generic.IDictionary`2<System.String,System.Object>)

    Informações da Exceção: System.Reflection.TargetInvocationException
    em System.RuntimeMethodHandle.InvokeMethod(System.Object, System.Object[], System.Signature, Boolean)
    em System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal(System.Object, System.Object[], System.Object[])
    em System.Reflection.RuntimeMethodInfo.Invoke(System.Object, System.Reflection.BindingFlags, System.Reflection.Binder, System.Object[], System.Globalization.CultureInfo)
    em Microsoft.Owin.Hosting.ServerFactory.ServerFactoryAdapter.Create(Owin.IAppBuilder)
    em Microsoft.Owin.Hosting.Engine.HostingEngine.StartServer(Microsoft.Owin.Hosting.Engine.StartContext)
    em Microsoft.Owin.Hosting.Engine.HostingEngine.Start(Microsoft.Owin.Hosting.Engine.StartContext)
    em Microsoft.Owin.Hosting.Starter.DirectHostingStarter.Start(Microsoft.Owin.Hosting.StartOptions)
    em Microsoft.Owin.Hosting.Starter.HostingStarter.Start(Microsoft.Owin.Hosting.StartOptions)
    em Microsoft.Owin.Hosting.WebApp.StartImplementation(System.IServiceProvider, Microsoft.Owin.Hosting.StartOptions)
    em Microsoft.Owin.Hosting.WebApp.Start(Microsoft.Owin.Hosting.StartOptions)
    em Microsoft.Owin.Hosting.WebApp.Start(System.String)
    em BQChat.Application.SelfHost.Program.Main(System.String[])

    Friday, August 10, 2018 2:24 PM

All replies

  • User283571144 posted

    Hi nandomegaman,

    According to your description and error message, I couldn't find something useful information.

    Could you please post the details error message with server status like 400, 404, 503?

    Besides, since this forum is in English, I suggest you could convert the error message to English.

    If you could do this, it will be more easily for us to understand your issue and find the solution.

    Best Regards,

    Brando

    Monday, August 13, 2018 5:21 AM
  • User-80687829 posted

    Hi. Ok.

    15:08:25

    Name the application with the option: BQChat.Application.SelfHost.exe, version 1.0.0.0, timestamp: 0x5b682a9f
    Module Name with Failure: KERNELBASE.dll, Version: 6.3.9600.18264, Timestamp: 0x56e1b34d
    Exception code: 0xe0434352
    Typing error: 0x00015b68
    Process id with failure: 0x365c
    Application start time with failure:
    0x01d4300bf6098fdc
    Module path with: C: \ BQChat \ host \ BQChat.Application.SelfHost.exe crashes: C: \ Windows \ SYSTEM32 \ KERNELBASE.dll
    Report ID: 35490950-9bff-11e8-80d6-00505680a589
    Full package name with
    ID: 35490950-9bff-11e8-80d6-00505680a589

    15:08:24

    Application: BQChat.Application.SelfHost.exe
    Framework Version: v4.0.30319
    Description: The process terminated due to an unhandled exception.
    Exception information: System.Net.HttpListenerException
    in System.Net.HttpListener.AddAllPrefixes ()
    in System.Net.HttpListener.Start ()
    at System.Net.HttpListener, System.Collections.Generic.IDictionary2, System.Collections.Generic.IList 1 <System.Collections.Generic.IDictionary2 <System.String, System.Object >>, System.Collections.Generic.IDictionary 2 <System.String, System.Object>, System.Func2 <System .String, System.Func 6 <System.Diagnostics.TraceEventType, Int32, System.Object, System.Exception, System.Func3 <System.Object, System.Exception, System.String>, Boolean >>)
    at System.Collections.Generic.IDictionary2. .String, System.Object>)

    Exception information: System.Reflection.TargetInvocationException
    at System.RuntimeMethodHandle.InvokeMethod (System.Object, System.Object [], System.Signature, Boolean)
    at System.Reflection.RuntimeMethodInfo.UnsafeInvokeInternal (System.Object, System.Object [], System.Object [])
    at System.Reflection.RuntimeMethodInfo.Invoke (System.Object, System.Reflection.BindingFlags, System.Reflection.Binder, System.Object [], System.Globalization.CultureInfo)
    in Microsoft.Owin.Hosting .ServerFactory.ServerFactoryAdapter.Create (Owin.IAppBuilder)
    in Microsoft.Owin.Hosting.Engine.HostingEngine.StartServer (Microsoft.Owin.Hosting.Engine.StartContext)
    in Microsoft.Owin.Hosting.Engine.HostingEngine.Start (Microsoft.Owin .Hosting.Engine.StartContext)
    in Microsoft.Owin.Hosting.Starter.DirectHostingStarter.Start (Microsoft.Owin.Hosting.StartOptions)
    in Microsoft.Owin.Hosting.Starter.HostingStarter.Start (Microsoft.Owin.Hosting.StartOptions)
    in Microsoft.Owin.Hosting.WebApp .StartImplementation (System.IServiceProvider, Microsoft.Owin.Hosting.StartOptions)
    in Microsoft.Owin.Hosting.WebApp.Start (Microsoft.Owin.Hosting.StartOptions)
    in Microsoft.Owin.Hosting.WebApp.Start (System.String)
    in BQChat.Application.SelfHost.Program.Main (System.String [])

    Monday, August 13, 2018 11:12 AM
  • User283571144 posted

    Hi nandomegaman,

    According to your error exception, we still couldn't find the useful information.

    I suggest you could try to enable the stdoutLogEnabled in the web config to see the details error.

        <aspNetCore processPath="%LAUNCHER_PATH%" arguments="%LAUNCHER_ARGS%" stdoutLogEnabled="true" stdoutLogFile=".\logs\stdout" />
    

    Best Regards,

    Brando

    Tuesday, August 14, 2018 7:28 AM