分区低于目标副本或实例数
Partition is below target replica or instance count
尝试将 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 以及指向上述行的堆栈跟踪外,没有其他有用的异常信息。为什么此应用程序无法加载到我的本地集群?
很难说没有实际的异常消息或堆栈跟踪,但根据抛出异常的位置以及问题在第二天早上自行解决的事实来判断,最有可能 和 最常见的 原因是您试图用来打开 Web 侦听器的端口当时被其他进程占用,第二天早上该端口被再次免费。顺便说一下,这并不是 Service Fabric 特有的。您只是想在别人占用的端口上打开一个套接字。
老实说,我更好奇您为什么不能检查异常。我可以想到三件事来帮助解决这个问题:
- 使用 "throw" 而不是 "throw ex",这样您就不会重置堆栈跟踪。
- 看看你的日志。看起来您正在 catch 块中写出一个 ETW 事件。它说了什么?
- 使用 Visual Studio 调试器:只需在 catch 块中设置一个断点,然后按 F5 启动应用程序进行调试。
尝试将 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 以及指向上述行的堆栈跟踪外,没有其他有用的异常信息。为什么此应用程序无法加载到我的本地集群?
很难说没有实际的异常消息或堆栈跟踪,但根据抛出异常的位置以及问题在第二天早上自行解决的事实来判断,最有可能 和 最常见的 原因是您试图用来打开 Web 侦听器的端口当时被其他进程占用,第二天早上该端口被再次免费。顺便说一下,这并不是 Service Fabric 特有的。您只是想在别人占用的端口上打开一个套接字。
老实说,我更好奇您为什么不能检查异常。我可以想到三件事来帮助解决这个问题:
- 使用 "throw" 而不是 "throw ex",这样您就不会重置堆栈跟踪。
- 看看你的日志。看起来您正在 catch 块中写出一个 ETW 事件。它说了什么?
- 使用 Visual Studio 调试器:只需在 catch 块中设置一个断点,然后按 F5 启动应用程序进行调试。