24

I have created a service fabric stateless reliable service, in which i used OWIN to host a web API. When I deployed the application to the Local cluster, it worked fine and i could call the API.

When i deployed the application to the public cluster, The deployment completed successfully but when i inspected the cluster using Service fabric explorer,

the the replicas seemed to be in "In Build" status for sometime, then it moved to "Warning" State and finally the entire tree in the fabric explorer went red and there are no more replicas present under the partition. And showed the health status as Error. Showing the error "Partition is below target replica or instance count".

Also I used the allowed port for creating the OWIN web server.

This doesn't happen when i deploy the application in local cluster. Service Fabric Explorer Screenshot for public cluster , Service Fabric Explorer Screenshot for Local Cluster

Binu Vijayan
  • 803
  • 1
  • 9
  • 24

8 Answers8

20

Most of the time this error really just means "we couldn't get your service started." If an unhandled exception in your service is preventing it from starting, you can drill down to your service instance or replica in the Service Fabric Explorer to see a stack trace when it fails to start after multiple attempts.

BTW, I would recommend using the newer web-based Service Fabric Explorer. Just point a web browser to port 19080 on your cluster: e.g., http://mycluster.eastus.cloudapp.azure.com:19080/Explorer/index.htm.

Vaclav Turecek
  • 9,020
  • 24
  • 29
  • when i debugged the solution from visual studio i saw an Aggregate Exception in the output window. but still worked in the local cluster. So i moved all the code to a new solution and then it worked in public cluster. – Binu Vijayan Jan 21 '16 at 11:27
  • 9
    The problem was, I updated the nuget package for the Servcie fabric and the newer version is not supported in public cluster, i changed back the nuget version and it worked fine. – Binu Vijayan Mar 22 '16 at 06:55
15

Just a little comment from my side..after spending hours on this error the problem was in a low disk space on my C:\ drive. After increasing the free space from around 3GB to 8GB the error disappeared.

As stated here: https://github.com/Azure/service-fabric-issues/issues/15

The default installation requires around 10Gb of disk space today

Ivan Sivak
  • 7,178
  • 3
  • 36
  • 42
4

I came across this issue and it was a config error.

The error in service Fabric explorer on port 19080 said:

Error event: SourceId='System.FM', Property='State'.

Partition is below target replica or instance count. fabric:/MyApp/MyService 3 2 [partitionid] N/P RD _Node_0 Up [a long numeric] (Showing 1 out of 1 replicas. Total available replicas: 1.)

In my ApplicationManifest.xml I had :

  <Service Name="MyService">
  <StatefulService ServiceTypeName="MyServiceType" TargetReplicaSetSize=**"3"** MinReplicaSetSize=**"2"**>
    <SingletonPartition />
  </StatefulService>
</Service>

Reducing MinReplicaSetSize to 1 and TargetReplicaSetSize to 1 and republishing solved the problem on my end.

Classic Eye-Dee-Ten-Tee (ID10T) config issue :-D

Jersey_Guy
  • 867
  • 7
  • 18
2

I am using Azure Service Fabric to deploy my application and got this error.

After investigation, I found that it was because "TargetReplicaSetSize" and "MinReplicaSetSize" exceeded my node number.

To solve the problem, change "PartitionCount", "TargetReplicaSetSize" "MinReplicaSetSize" to 1 in ApplicationParameters/cloud.xml and re-deploy the application:

    <?xml version="1.0" encoding="utf-8"?>
    <Application xmlns:xsd="http://www.w3.org/2001/XMLSchema" 
    xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance" Name="fabric:/Voting" xmlns="http://schemas.microsoft.com/2011/01/fabric">
    <Parameters>
        <Parameter Name="xxx_PartitionCount" Value="1" />
        <Parameter Name="xxx_MinReplicaSetSize" Value="1" />
    </Parameters>
    </Application>
Liam
  • 27,717
  • 28
  • 128
  • 190
SLdragon
  • 1,477
  • 16
  • 19
1

Another reason is if you created a stateless service ( check ApplicationPackageRoot/ApplicationManifest.xml) but the service implements stateful service.

Prashant Saraswat
  • 838
  • 1
  • 8
  • 20
0

I just had the same error message. Turned out my container was not built yet. It took a few minutes but then the status changed to OK.

Ben K.
  • 98
  • 1
  • 9
0

I got the same issue today and besides the possible reasons mentioned by other answers, another possible reason is you are using old versions for SF runtime/SDK/library.

Please make sure your SF runtime & SDK & referenced DLLs in your project are latest!

Cheng Chen
  • 42,509
  • 16
  • 113
  • 174
0

My issue was as simple as: The service had two methods with the same name and the same number of arguments that were differing only in a parameter type only. As the service is accessed via API no overloading is allowed. Once I renamed the methods to distinguish them the deploy was working fine.

Honza P.
  • 1,165
  • 1
  • 11
  • 12