Troubleshooting Tips on Getting Started with Azure Service Fabric Application Development

 

Azure Service Fabric is a PaaS service with which developers can build always-on, scalable, distributed applications microservice based apps. To get started, follow the steps outlined in the articles below.

I updated Service Fabric runtime SDK, and tools for Visual Studio 2015 on my workstation and ran into a couple issues related to how your computer is configured. It is easy to fix them you know how to. Otherwise, you could spend a few hours trying to figure out why you keep getting the errors in Visual Studio and in Service Fabric Manager in the browser.

Use local administrator account to run Visual Studio

After running the PowerShell command below, you may still get an error message saying your PowerShell script failed to execute. Looking into the VS output result, you will see that the compiler is complaining that you are not running as a local administrator. In my case, that is true because I was using a domain joined account even though the account was added to the local administrators group.

The Fix – Start Visual Studio using “Run as Administrator”.

 Set-ExecutionPolicy -ExecutionPolicy Unrestricted -Force -Scope CurrentUser

image

 

1>------ Build started: Project: ASFApp1, Configuration: Debug x64 ------
2>------ Deploy started: Project: ASFApp1, Configuration: Debug x64 ------
2>Started executing script 'Set-LocalClusterReady'.
2>Import-Module 'C:\Program Files\Microsoft SDKs\Service Fabric\Tools\Scripts\DefaultLocalClusterSetup.psm1'; Set-LocalClusterReady
2>--------------------------------------------
2>Local Service Fabric Cluster is not running...
2>Please wait while we start the Local Service Fabric Cluster. This may take few minutes...
2>EnsureAdminPrivileges : Not running as administrator. You need to run Visual Studio with administrator privileges to
2>start the local cluster.
2>At C:\Program Files\Microsoft SDKs\Service Fabric\Tools\Scripts\DefaultLocalClusterSetup.psm1:49 char:9
2>+         EnsureAdminPrivileges "Not running as administrator. You need ...
2>+         ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2>    + CategoryInfo          : NotSpecified: (:) [Write-Error], WriteErrorException
2>    + FullyQualifiedErrorId : Microsoft.PowerShell.Commands.WriteErrorException,EnsureAdminPrivileges
2>
2>ScriptHalted
2>At C:\Program Files\Microsoft SDKs\Service Fabric\Tools\Scripts\ClusterSetupUtilities.psm1:9 char:9
2>+         throw
2>+         ~~~~~
2>    + CategoryInfo          : OperationStopped: (:) [], RuntimeException
2>    + FullyQualifiedErrorId : ScriptHalted
2>
2>Finished executing script 'Set-LocalClusterReady'.
2>Time elapsed: 00:00:03.0272428
2>The PowerShell script failed to execute.
========== Build: 1 succeeded, 0 failed, 1 up-to-date, 0 skipped ==========
========== Deploy: 0 succeeded, 1 failed, 0 skipped ==========

 

Have 10GB or more free hard disk space on your computer

To reproduce the error, I reduced disk space on my computer to about 3 GB, and then removed the local cluster. After re-compiling the app and re-creating the cluster in Visual Studio, I saw the same error in Service Fabric Explorer as I did before, fabric:/System/FaultAnalysisService failed.

The Fix – free up space on your hard drive and re-start the process. Thanks to Matthew Snider for his comment at github.

This is usually just that you're out of disk space, which results in the reliable log file not being able to be generated. The default installation requires around 10Gb of disk space today.

 

image

The local cluster is up and running and healthy once there is adequate disk space.

image

If you check the folder on your computer, e.g.C:\SfDevCluster\Data\ReplicatorLog, you will see that the SfDevCluster folder takes about 9.5GB and the replicatorshared.log file itself takes about 8.5 GB.

image