Error "Failed to find a value for the client certificate." when deploying to Service Fabric

We are having trouble deploying to Service Fabric using the “Deploy a Service Fabric app” step template. We get the following error:

15:47:43 Verbose | Loading connection parameters for the ‘Client Certificate’ security mode.
15:47:43 Info | Attempt 1 of 5 failed: Failed to find a value for the client certificate.
15:47:43 Info | Waiting for 5 seconds before retrying…
15:47:48 Info | Retrying…
15:47:48 Verbose | Loading connection parameters for the ‘Client Certificate’ security mode.
15:47:48 Info | Attempt 2 of 5 failed: Failed to find a value for the client certificate.
15:47:48 Info | Waiting for 5 seconds before retrying…
15:47:53 Info | Retrying…
15:47:53 Verbose | Loading connection parameters for the ‘Client Certificate’ security mode.
15:47:53 Info | Attempt 3 of 5 failed: Failed to find a value for the client certificate.
15:47:53 Info | Waiting for 5 seconds before retrying…
15:47:58 Info | Retrying…
15:47:58 Verbose | Loading connection parameters for the ‘Client Certificate’ security mode.
15:47:58 Info | Attempt 4 of 5 failed: Failed to find a value for the client certificate.
15:47:58 Info | Waiting for 5 seconds before retrying…
15:48:03 Info | Retrying…
15:48:03 Verbose | Loading connection parameters for the ‘Client Certificate’ security mode.
15:48:03 Error | # Prepare a dictionary of connection parameters that we’ll use to connect
15:48:03 Error | below.
15:48:03 Error | $ClusterConnectionParameters = @{}
15:48:03 Error | $ClusterConnectionParameters[“ConnectionEndpoint”] =
15:48:03 Error | $OctopusFabricConnectionEndpoint
15:48:03 Error | If ($OctopusFabricSecurityMode -eq “SecureClientCertificate”) {
15:48:03 Error | # Secure client certificate
15:48:03 Error | Write-Verbose “Loading connection parameters for the ‘Client
15:48:03 Error | Certificate’ security mode.”
15:48:03 Error | $validationMsg = ValidationMessageForClientCertificateParameters
15:48:03 Error | if ($validationMsg) {
15:48:03 Error | Write-Error $validationMsg
15:48:03 Error | Exit
15:48:03 Error | }

The certificate has been uploaded to Octopus Deploy under Library / Certificates.

A variable set “SF cluster” with the certificates as variables has been created.

The variable has been set in the deploy step.

The cert has been installed on the Octopus server.

We’re missing something but can’t find it. Help please!

Hi, thanks for reaching out.

To help resolve this issue we’ll need to get some additional information. Can you enable variable debugging using the instructions at https://octopus.com/docs/support/debug-problems-with-octopus-variables#DebugproblemswithOctopusvariables-Writethevariablestothedeploymentlog and then attach the full raw logs for the deployment using the instructions at https://octopus.com/docs/support/get-the-raw-output-from-a-task. There are some log messages that would appear before the snippet shown here that might be useful to identifying the underlying cause.

Regards
Matthew Casperson

Attaching a redacted log. Hope it helps!ServerTasks-1310.log-redacted.txt (53.0 KB)

Hi,

I think the issue here is that the Client Certificate Variable has been set to sf-clientadmin-certificate, but sf-clientadmin-certificate is not a variable that points to a certificate.

In your variables you should find sf-clientadmin-certificate defined as a certificate variable, like in the screenshot below.

If configuring this variable does not resolve the issue, can I get you to grab a screenshot of the variables page, as well as a screenshot of the Service Fabric step. In particular the screenshot should show the value assigned to the Client Certificate Variable field.

As you can see in the screenshot below this drop down list will show the variable that references the certificate.

Regards
Matthew Casperson

Actually, the variable is imported as a Library variable, like this:

Also, the screenshot of the Service Fabric step:

We looked into it some more. Turns out, if the certificate is added as a “Project Variable” it works. Using a variable from a Library Set does not work. Should we open a bug on this?

Hi Christoffer,

That sounds like it needs to be addressed. If you raise an issue in our GitHub issues we can address.

Regards
Ben