Uninstalling the application using the service fabric is not performed

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.

+7
source share
2 answers

Yes, this can happen if you do not allow your code to exit RunAsync or Open / Close from your ICommunicationListener.

Some background:

Your service has a life cycle that is managed by Service Fabric. A small component in your service โ€” you know how FabricRuntime does โ€” manages this. For stateless service instances, this is a simple open / close lifecycle. For stateful services, this is a bit trickier. The state service replicator opens and closes, but also changes the role between primary, secondary, and none. Lifecycle changes are triggered by the Fabric service and appear as a trigger to call a method or token token in your code. For example, when a replica switches to primary, we call your RunAsync method. When it switches from the main to something else or turns off, the cancellation token is triggered. In any case, the system is waiting for you to complete your work.

When you delete a service, we inform your service of the role change and closure. If your code does not respond, then it will get stuck in this state.

To exit this state, you can run Remove-ServiceFabricReplica -ForceRemove . This significantly reduces the replica from the system - as far as the Service Fabric is concerned, the replica is gone. But your process is still working. So you have to go and kill the process too.

+6
source

The error in the script is related to "- ApplicationName" and should be "-ApplicationName".

And after correcting the parameter, this DID deletes the hidden parts and returns me to be able to fix and redeploy the application in the cluster.

0
source

Source: https://habr.com/ru/post/1257784/


All Articles