Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Azure Service Fabric Application stuck in Deleting state

I had a deployment on my service fabric cluster go wrong; I attempted to delete an application and for some reason, the deletion never seemed to and now the application is stuck in the deleting state, while all my deployments remain. I can't delete or upgrade the application since I get a status of "deleting"

Is there a way to update the status of the application so I can then proceed to delete it (for real) this time?

like image 228
Daniel Avatar asked Jun 17 '16 23:06

Daniel


1 Answers

You'll most likely need to use power shell and execute an application delete that way, I had this issue as well when starting out with service fabric.

For instructions on how to connect to the cluster using powershell click here.

$nodes = Get-ServiceFabricNode

foreach ($node in $nodes)
{
    $replicas = Get-ServiceFabricDeployedReplica -NodeName $node.NodeName -ApplicationName "fabric:/AppNameHere"

    foreach ($replica in $replicas)
    {
        Remove-ServiceFabricReplica -ForceRemove -NodeName $node.NodeName -PartitionId $replica.PartitionId -ReplicaOrInstanceId $replica.ReplicaOrInstanceId
    }
}

Deletions that get stuck, in my experience, are often due to the application not honoring cancellation tokens. What kind of application did you deploy?

like image 85
Brian Avatar answered Sep 22 '22 20:09

Brian