7
votes

I have a problem with Azure Service Fabric.

I have installed it (on Windows 7) as it was said in https://azure.microsoft.com/en-gb/documentation/articles/service-fabric-get-started/.

Then I have tried to run a Service Fabric application from Visual Studio 2015. I got an error “Connect-ServiceFabricCluster : No cluster endpoint is reachable, please check if there is connectivity/firewall/DNS issue”.

Here is the fill log of that run:

1>------ Build started: Project: Application2, Configuration: Debug x64 ------
2>------ Deploy started: Project: Application2, Configuration: Debug x64 ------
-------- Package started: Project: Application2, Configuration: Debug x64 ------
  Application2 -> c:\temp\Application2\Application2\pkg\Debug
-------- Package: Project: Application2 succeeded, Time elapsed: 00:00:01.7361084 --------
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 setup...
2>Please wait while we setup the Local Service Fabric Cluster. This may take few minutes...
2>
2>Using Cluster Data Root: C:\SfDevCluster\Data
2>Using Cluster Log Root: C:\SfDevCluster\Log
2>
2>Create node configuration succeeded
2>Starting service FabricHostSvc. This may take a few minutes...
2>
2>Waiting for Service Fabric Cluster to be ready. This may take a few minutes...
2>Local Cluster ready status: 4% completed.
2>Local Cluster ready status: 8% completed.
2>Local Cluster ready status: 12% completed.
2>Local Cluster ready status: 17% completed.
2>Local Cluster ready status: 21% completed.
2>Local Cluster ready status: 25% completed.
2>Local Cluster ready status: 29% completed.
2>Local Cluster ready status: 33% completed.
2>Local Cluster ready status: 38% completed.
2>Local Cluster ready status: 42% completed.
2>Local Cluster ready status: 46% completed.
2>Local Cluster ready status: 50% completed.
2>Local Cluster ready status: 54% completed.
2>Local Cluster ready status: 58% completed.
2>Local Cluster ready status: 62% completed.
2>Local Cluster ready status: 67% completed.
2>Local Cluster ready status: 71% completed.
2>Local Cluster ready status: 75% completed.
2>Local Cluster ready status: 79% completed.
2>Local Cluster ready status: 83% completed.
2>Local Cluster ready status: 88% completed.
2>Local Cluster ready status: 92% completed.
2>Local Cluster ready status: 96% completed.
2>Local Cluster ready status: 100% completed.
2>WARNING: Service Fabric Cluster is taking longer than expected to connect.
2>
2>Waiting for Naming Service to be ready. This may take a few minutes...
2>Connect-ServiceFabricCluster : **No cluster endpoint is reachable, please check 
2>if there is connectivity/firewall/DNS issue.**
2>At C:\Program Files\Microsoft SDKs\Service 
2>Fabric\Tools\Scripts\ClusterSetupUtilities.psm1:521 char:12
2>+     [void](Connect-ServiceFabricCluster @connParams)
2>+            ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
2>    + CategoryInfo          : InvalidOperation: (:) [Connect-ServiceFabricClus 
2>   ter], FabricException
2>    + FullyQualifiedErrorId : TestClusterConnectionErrorId,Microsoft.ServiceFa 
2>   bric.Powershell.ConnectCluster
2> 
2>Naming Service ready status: 8% completed.
2>Naming Service ready status: 17% completed.
2>Naming Service ready status: 25% completed.
2>Naming Service ready status: 33% completed.
2>Naming Service ready status: 42% completed.
2>Naming Service ready status: 50% completed.
2>Naming Service ready status: 58% completed.
2>Naming Service ready status: 67% completed.
2>Naming Service ready status: 75% completed.
2>Naming Service ready status: 83% completed.
2>Naming Service ready status: 92% completed.
2>Naming Service ready status: 100% completed.
2>WARNING: Naming Service is taking longer than expected to be ready...
2>Local Service Fabric Cluster created successfully.
2>--------------------------------------------------
2>Launching Service Fabric Local Cluster Manager...
2>You can use Service Fabric Local Cluster Manager (system tray application) to manage your local dev cluster.
2>Finished executing script 'Set-LocalClusterReady'.
2>Time elapsed: 00:07:01.8147993
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 ==========
6
Have you tried to access the endpoint with browser?cassandrad
Yes I have. I have tried to go to Windows tray \ Service Fabric Local Cluster Manager and open the Explorer tool (this is the localhost:19080/Explorer). Of course I have got the error. An attempt to open localhost:19080/Explorer in brows has brought “This site can’t be reached” message. This is expectable – I see that programs like Fabric.exe or FabricGateway have not started. In other words – my local Fabric Cluster has been created (as the folder on C:) but its programs have not started.Victor Sotnikov
is FabricHostSvc service started?cassandrad
"is FabricHostSvc service started?" - it failed to start initially, under the default account Local System. I have changed the account ti NETWORK SERVICE - it the service started working. But - who knows - maybe this change has introduced the problem I am talking about.Victor Sotnikov
Did you try the options from this page? azure.microsoft.com/en-us/documentation/articles/…LoekD

6 Answers

12
votes

This worked for me and I stumbled upon the solution on an MSDN forum.

Most likely your C++ runtime is corrupt and that needs to be reinstalled. You will have to manually execute vcredist_x64.exe which can be found at

C:\Program Files\Microsoft Service Fabric\bin\Fabric\Fabric.Code\vcredist_x64.exe

Once that is done, you can choose to reboot your machine or not, I chose to reboot it and then ran the following commands

 C:\Program Files\Microsoft SDKs\Service Fabric\ClusterSetup\CleanCluster.ps1
C:\Program Files\Microsoft SDKs\Service Fabric\ClusterSetup\DevClusterSetup.ps1

I hope this helps!

2
votes

I had to disconnect my VPN from my office as well as the directions that Varun had shown above.

Thanks @Varun for sharing this!!

Once I connected my VPN I could not run the system again.

Hope this helps someone.

1
votes

After trying many solutions, I found that this GitHub Issue helped to add an entry to the setup configuration then I had to recreate the cluster.

Configuration File

C:\Program Files\Microsoft SDKs\Service Fabric\ClusterSetup\NonSecure\OneNode\ClusterManifestTemplate.json:

Entry to add

{
  "name": "FabricContainerAppsEnabled",
  "value": "false"
}
0
votes

By default Service Fabric development instance is running to listen only on the loopback address(simply run netstat -an command in your CMD to see which ports are open):

enter image description here

As you can see on the screen above my SF instance are listen on the port 19000 for all addresses(available external connections)

By default port 19000 listen only on the loopback address(127.0.0.1)

[::1]:19000

All you need is to change your IPAddressOrFQDN from localhost to your IPv4 external address. The hange should be visible in manifest file:

enter image description here

All SF cluster configuration files in windows 7 are located in C:\SfDevCluster\Data. There you can find many XML documents like:

  • clusterManifest
  • FabricHostSettings

To change IPAddressOrFQDN I have replaced all occurrences of the word 'localhost' over 'my.ip.address.here'. The files to be modified are also deeper:

  • C:\SfDevCluster\Data\_Node_0\Fabric
  • C:\SfDevCluster\Data\_Node_0\Fabric\Fabric.Data
  • C:\SfDevCluster\Data\_Node_0\Fabric\Fabric.Config.0.0
  • and so on

enter image description here

before changes stop your cluster:

enter image description here

And after all run it again:

enter image description here


There is another - better method. You can change generating scripts in directory C:\Program Files\Microsoft SDKs\Service Fabric\ClusterSetup.

After cluster reset this settings will be lost. Remember that you do it at your own risk, the development version is unsecure and should not be used in a production environment.

If after hanges you cannot connect to SF - make sure the firewall doesn't block the port(you can temporary disable your firewall)

0
votes

If the C++ runtime does not solve your issue you can narrow the solution down to just firewall issue. The network is not allowing the User to run the FabricHostSvc Service which you can check in services.msc ,which is due to security issues. If you just are able to disable your firewall/change to network without restrictions the issue should resolve on its own.

If you are able to get the FabricHostSvc started your issue will be solved.

Hope this helps.....

0
votes

Hey First answer ( @Varun Rathore gave ) worked for me. But as I was trying to deploy container on service fabric locally, switching from 1 node cluster to 5 node cluster again and again, this error comes often. So what I did is open powershell as Administrator and follow the next 2 steps.

  1. First go to following Path

    cd "C:\Program Files\Microsoft SDKs\Service Fabric\ClusterSetup"

  2. Second run these 2 files

    .\CleanCluster.ps1

    .\DevClusterSetup.ps1

This will setup 1 node cluster on your local machine. You can do this from service fabric cluster manager but it did not work for me. And every time repair vcredist_x64.exe file and reboot your computer (windows 10 Pro) is frustating. This works for me.