1

We have a ServiceFabric service, which is running the latest .NET Core 3.1. We publish & deploy it as self-contained x64 app. After a recent update, we are unable to deploy it anymore. ServiceFabric gives very little information why. This is what we see:

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.

It tries that several times and then gives up. By digging into SF events I was able to find this as well:

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

When using a local Service Fabric Cluster, everything is deployed just fine.

Does anybody know who to get more info out of the deployment process? More logs. Some clue which will help us what exactly is going wrong with the deployment.

Dmytro Gokun
  • 405
  • 3
  • 24
  • 1
    Sounds like something environment related is causing the service to crash on startup. This could be existing state, config etc. Best way to find out exactly would be to log any exception thrown in `Program.cs / Main`. – Oliver Jul 13 '20 at 20:31
  • That I've already tried. It does not look my code is even executed. So no logs are produced :( – Dmytro Gokun Jul 13 '20 at 20:35
  • Could it be your log configuration that’s causing the error? – Preben Huybrechts Jul 14 '20 at 05:05
  • I do not think so. It worked just fine before the problematic nuget package were updated. And that package has nothing to do with logging. As far as I can tell our Main function is not get called at all. That makes me think SF fails to load some depencies. But how do I know which exactly? That's the question. – Dmytro Gokun Jul 14 '20 at 18:20

1 Answers1

3

So, indeed our code was not running at all. Thus, we did not get any logs from it. But, there is a way to get some log from Service Fabric runtime itself. As described here: 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 we added

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

to our ServiceManifest.xml. As a result, we got some useful logs. Particularly we got this:

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'

and this gives us some clues to start working on the actual problem.

Dmytro Gokun
  • 405
  • 3
  • 24