分区低于目标副本或实例计数

时间:2016-08-10 02:31:32

标签: azure-service-fabric

尝试将Service Fabric应用程序发布到本地群集时,群集无法加载应用程序,说明标题中的错误。堆栈跟踪将我指向OwinCommunicationListener.cs中的异常行:

        try
        {
            this.eventSource.LogInfo("Starting web server on " + this.listeningAddress);

            this.webApp = WebApp.Start(this.listeningAddress, appBuilder => this.startup.Invoke(appBuilder));

            this.eventSource.LogInfo("Listening on " + this.publishAddress);

            return Task.FromResult(this.publishAddress);
        }
        catch (Exception ex)
        {
            var logString = $"Web server failed to open endpoint {endpointName}. {ex.ToString()}";
            this.eventSource.LogFatal(logString);

            this.StopWebServer();

            throw ex; // points to this line from cluster manager
        }

我无法检查抛出的异常,但除了TargetInvocationException以外,没有有用的异常信息,其堆栈跟踪指向上述行。为什么这个应用程序会在我的本地群集上加载?

1 个答案:

答案 0 :(得分:1)

如果没有实际的异常消息或堆栈跟踪很难说,但是根据抛出异常的位置以及第二天早上问题自行解决的事实来判断很可能最常见的原因是您尝试用来打开Web侦听器的端口当时被其他一些进程占用,第二天早上该端口再次被释放。顺便说一下,这并不是Service Fabric的特定功能。您只是试图在其他人占用的端口上打开套接字。

老实说,我更好奇为什么你不能检查异常。我可以想到三件事情,以帮助解决这个问题:

  1. 使用" throw"而不是"抛出"所以你不要重置堆栈跟踪。
  2. 查看您的日志。看起来你在catch块中写出了一个ETW事件。这是什么意思?
  3. 使用Visual Studio调试器:只需在catch块中设置断点,然后按F5启动应用程序并进行调试。