I deployed the application to a standalone 5 node cluster. Deployment succeeded. But the application did not start due to some error in the application. I tried to remove the application from the cluster using Fabric Explorer, but this failed.
The health state of the application is โErrorโ, and the status is โDeleteโ. The application has 9 services. 6 services show the state of health "Unknown" with a question mark and the status of "Unknown". 3 services show a health status of Good, but with a status of Uninstall.
I also tried removing it using powershell:
Remove-ServiceFabricApplication -ApplicationName fabric:/appname -Force -ForceRemove
As a result, the operation was disabled.
I also tried the script below, which I found in another post.
Connect-ServiceFabricCluster -ConnectionEndpoint localhost:19000 $nodes = Get-ServiceFabricNode foreach($node in $nodes) { $replicas = Get-ServiceFabricDeployedReplica -NodeName $node.NodeName - ApplicationName "fabric:/MyApp" foreach ($replica in $replicas) { Remove-ServiceFabricReplica -ForceRemove -NodeName $node.NodeName -PartitionId $replica.Partitionid -ReplicaOrInstanceId $replica.ReplicaOrInstanceId } }
Also there is no result, the script did not find a replica to delete.
At the same time, we started uninstalling the application, and one of the system services also changed state. The Fabric: / System / NamingService service displays the status of the Warning state. This is on the section 00000000-0000-0000-0000-000000001002. The main replica shows:
Unhealthy event: SourceId = 'System.NamingService', Property = 'Duration_PrimaryRecovery', HealthState = 'Warning', OpinWarningAsError = false. PrimaryRecovery began on 2016-10-06 07: 55: 21.252 takes over 30: 00.000.
I also restarted each node (1 at a time) with no result.
How to force uninstall an application without re-creating the cluster, because this is not an option for a production environment.