azure-service-fabricoctopus-deployservice-fabric-on-premises

Service fabric - Connect-ServiceFabricCluster : An error occurred during this operation


I have been tasked with updating Certificates on a service fabric cluster, I believe I have done this on the cluster but now octopus is producing this error. I have added the certificate into the machine and my users certificate stores and I can see the service fabric portal.

I can happily connect from the command line on the same machine, which I would imagine is what it is doing under the hood!

Connect-ServiceFabricCluster -ConnectionEndpoint "MyMachine.test.local:19000" -X509Credential -ServerCertThumbprint "ABCE35ECEDDEB4BB81039BC1745BA7087EBB8123" -FindType FindByThumbprint -FindValue "ABCE35ECEDDEB4BB81039BC1745BA7087EBB8123" -StoreLocation LocalMachine -StoreName My

Where might I find more detailed logs, where the heck are the so called trace logs for more details?

Loading connection parameters for the 'Client Certificate' security mode.
17:05:18   Verbose  |       Authenticating with Service Fabric.
17:05:18   Verbose  |       Using ConnectionParameters:
17:05:18   Verbose  |       ConnectionEndpoint=MyMachine.test.local:19000
17:05:18   Verbose  |       StoreLocation=LocalMachine
17:05:18   Verbose  |       FindType=FindByThumbprint
17:05:18   Verbose  |       ServerCertThumbprint=ABCE35ECEDDEB4BB81039BC1745BA7087EBB8123
17:05:18   Verbose  |       FindValue=ABCE35ECEDDEB4BB81039BC1745BA7087EBB8123
17:05:18   Verbose  |       X509Credential=True
17:05:18   Verbose  |       StoreName=MY
17:05:18   Error    |       Connect-ServiceFabricCluster : An error occurred during this operation.
17:05:18   Error    |       Please check the trace logs for more details.
17:05:18   Error    |       At C:\Octopus\Work\20221004160424-291654-3733\staging\Octopus.AzureServiceFabri
17:05:18   Error    |       cContext.ps1:210 char:16
17:05:18   Error    |       + ...      [void](Connect-ServiceFabricCluster @ClusterConnectionParameters ...
17:05:18   Error    |       +                 ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
17:05:18   Error    |       + CategoryInfo          : InvalidOperation: (:) [Connect-ServiceFabricClus
17:05:18   Error    |       ter], FabricException
17:05:18   Error    |       + FullyQualifiedErrorId : CreateClusterConnectionErrorId,Microsoft.Service
17:05:18   Error    |       Fabric.Powershell.ConnectCluster

Solution

  • The issues was that the octopus server where this is running also needed the certificate added to the machines LocalMachine MY (Personal) location. Once the certificate was added it deployed fine!

    If we look at an example connection call we can see its asking for a certificate by the thumbprint, and this certificate needs to be on the machine that runs this command.

    Connect-ServiceFabricCluster -ConnectionEndpoint "MyMachine.test.local:19000" -X509Credential -ServerCertThumbprint "ABCE35ECEDDEB4BB81039BC1745BA7087EBB8123" -FindType FindByThumbprint -FindValue "ABCE35ECEDDEB4BB81039BC1745BA7087EBB8123" -StoreLocation LocalMachine -StoreName My
    

    Now to look at more shocking service fabric cluster issues :( ...