microsoft / service-fabric-issues

This repo is for the reporting of issues found with Azure Service Fabric.
168 stars 21 forks source link

Unable to reset local cluster #1509

Closed rajucomp closed 5 years ago

rajucomp commented 5 years ago

I have been trying to reset the local cluster but to no success. So we decided to manually run the powershell scripts that are employed in resetting the local cluster. We identified these scripts as "ClusterSetupUtilities" and "DevClusterSetup". We opened VS Code as Administrator and stared debugging the "DevClusterSetup" file where we land to the function "RemoveFolder" that checks whether the directories "C:\SfDevCluster\Data" and "C:\SfDevCluster\Log" exist and, if they do, delete them via this cmd command snippet "cmd /c rmdir /S /Q $folderPath > $null". However this is the exact step where we are facing issues. We always get an exception that says `Program 'cmd.exe' failed to run: Access is deniedAt line:1 char:1

Here is a bit more detailed exception :-

`Exception : System.Management.Automation.ApplicationFailedException: Program 'cmd.exe' failed to run: Access is deniedAt C:\Program Files\Microsoft SDKs\Service Fabric\Tools\Scripts\ClusterSetupUtilities.psm1:76 char:9

`

We tried commenting the error-generating command and replaced it with the equivalent commands in powershell for removing directories like this "Remove-Item -LiteralPath $folderPath -Force -Recurse > $null". However , we are still getting this exception. We are trying to troubleshoot this problem for the past three days but to no avail.

Any help would be greatly appreciated.

jdvor commented 5 years ago

Maybe it's just a file-system ACL issue.

vshan commented 5 years ago

Hi @rajucomp , have the above suggestions mitigated your issue?

rajucomp commented 5 years ago

Hi @vshan, sorry for the late reply. I ran the scripts as admin and checked owner and permissions but could not get success. For a temporary workaround, we had to manually delete the folders "C:\SfDevCluster\Data" and "C:\SfDevCluster\Log" and then ran the scripts successfully. This is weird considering we can manually delete the folders but not in the scripts that we run as admin. Anyways, we really appreciate the community for their support and development. Thanks !