对 Service Fabric 服务部署进行故障排除

Troubleshoot Service Fabric service deployment

我们有一个 ServiceFabric 服务,它是 运行 最新的 .NET Core 3.1。我们将其发布和部署为独立的 x64 应用程序。最近更新后,我们无法再部署它。 ServiceFabric 提供的信息很少。这是我们看到的:

Service package for manifest 'XXXX' and service package activation ID 'XXXX' is in Error.
        'System.Hosting' reported Error for property 'ServiceTypeRegistration:XXX'.
        The ServiceType was disabled on the node.

它尝试了几次然后放弃了。 通过深入研究 SF 事件,我也找到了这个:

There was an error during CodePackage activation.The process/container terminated with exit code:2147516556.

使用本地 Service Fabric 集群时,一切都部署得很好。

有人知道谁可以从部署过程中获取更多信息吗?更多日志。一些线索可以帮助我们了解部署到底出了什么问题。

所以,实际上我们的代码根本不是 运行。因此,我们没有从中获得任何日志。但是,有一种方法可以从 Service Fabric 运行时本身获取一些日志。如此处所述:https://devblogs.microsoft.com/premier-developer/service-fabric-how-to-troubleshoot-deployment-errors-in-service-fabric-windows-cluster/#:~:text=Debug%20service%20errors%20using%20the%20log%20files 我们添加了

<ConsoleRedirection FileRetentionCount="5" FileMaxSizeInKb="2048"/>

我们的 ServiceManifest.xml。结果,我们得到了一些有用的日志。特别是我们得到了这个:

Error:
  An assembly specified in the application dependencies manifest (XXXX.deps.json) was not found:
    package: 'Microsoft.Data.SqlClient.SNI.runtime', version: '2.0.0'
    path: 'runtimes/win-x64/native/Microsoft.Data.SqlClient.SNI.pdb'

这为我们提供了一些开始解决实际问题的线索。