microsoft / service-fabric

Service Fabric is a distributed systems platform for packaging, deploying, and managing stateless and stateful distributed applications and containers at large scale.
https://docs.microsoft.com/en-us/azure/service-fabric/
MIT License
3.02k stars 399 forks source link

Unable to get ServicePackage Health #536

Open karthikalavala opened 4 years ago

karthikalavala commented 4 years ago

I am using Service Fabric SDK to get the health of the Deployed Service. I am using code from here (https://docs.microsoft.com/en-us/dotnet/api/system.fabric.fabricclient.healthclient.getdeployedservicepackagehealthasync?view=azure-dotnet).

This particular call throws exception // Get the deployed service package health. deployedServicePackageHealth = fabricClient.HealthManager.GetDeployedServicePackageHealthAsync(applicationName, deployedApplicationHealth.DeployedServicePackageHealthStates[0].ServiceManifestName, deployedApplicationHealthState.NodeName).Result;

with exception: Entity not found in Health Store. at System.Fabric.Interop.NativeClient.IFabricHealthClient4.EndGetDeployedServicePackageHealth2(IFabricAsyncOperationContext context) at System.Fabric.FabricClient.HealthClient.GetDeployedServicePackageHealthEndWrapper(IFabricAsyncOperationContext context) at System.Fabric.Interop.AsyncCallOutAdapter2`1.Finish(IFabricAsyncOperationContext context, Boolean expectedCompletedSynchronously)

I can see the service in the service fabric explorer: Marked red.

image

I can see the service manifest is correctly retrieved.

masnider commented 4 years ago

Is the service actually running on the node you're specifying? If it is crashing at the time the query is issued, then the entity might not be in health (since SF cleans up "Crashed" entities from the health store pretty aggressively and relies on health reports at the higher levels to point to the other issues.

Adding some folks to help out. @Christina-Kang