I have seen some posts similar to mine where users are unable to deploy a website using the “IIS web site and application pool” feature from octopus deploy when they have a HTTPS binding in the deployment step.
The error seems to occur when running the powershell script: Octopus.Features.IISWebSite_BeforePostDeploy.ps1
However, other users posts seem to occur during the section of the script where it searches for the SSL certificate in the certificate store.
My issue is a little different in that it fails in the section above the certificate bind:
# Each binding string consists of a protocol/binding information (IP, port, hostname)/SSL thumbprint/enabled/sslFlags
# Binding strings are pipe (|) separated to allow multiple to be specified
$bindingString.Split("|") | foreach-object {
$bindingParts = $_.split("/")
$skip = $false
if ($bindingParts.Length -ge 4) {
if (![String]::IsNullOrEmpty($bindingParts[3]) -and [Bool]::Parse($bindingParts[3]) -eq $false) {
$skip = $true
}
}
I have not been able to find other posts failing at this specific section of the script.
The error I receive in the build log is as follows:
foreach-object : Exception calling "Parse" with "1" argument(s): "String was
not recognized as a valid Boolean."
At D:\Octopus\Applications\.SQ-KEN-DEV-IS033-6625FB14\Octopus.Tentacle\2.6.0.77
8\Scripts\Octopus.Features.IISWebSite_BeforePostDeploy.ps1:86 char:29
+ $bindingString.Split("|") | foreach-object {
+ ~~~~~~~~~~~~~~~~
+ CategoryInfo : NotSpecified: (:) [ForEach-Object], MethodInvoca
tionException
+ FullyQualifiedErrorId : FormatException,Microsoft.PowerShell.Commands.ForEachObjectCommand
PowerShell script returned a non-zero exit code: 1
In my deployment step I have both an HTTP and HTTPS binding. If I leave just the HTTP binding in the deployment step, the website will deploy successfully. If I add in the HTTPS binding, or if I have only the HTTPS binding, the step will fail.
Version Information:
Tentacle version (x64): 2.5.11.614
Octopus Deploy version: 2.6.0.778
Client OS: Windows Server 2012 R2 Std
Octopus Server OS: Windows Server 2012 R2 Std
Thanks for getting in touch! Could you please provide a screenshot of your binding when set to https.
Please feel free to mark this thread as private or send it through to support at octopusdeploy dot com
Attached is the screenshot you requested. I can tell you that I have replaced the HostHeader variable with the actual host header. I also have verified the SSL cert thumbprint matches the cert in the computer Personal store on the machine this is deploying to.
Thanks for that! See how SNI is listed as undefined? This is causing the error. If you could delete that record (you can’t edit it to fix it) and re-make it, the SNI should not be listed as undefined and your bindings should work.
I think the problem turned out to be that I was trying to use the same release. Once I re-added the binding AND created a new release to promote to that environment, it worked.
I had the same issue. I saw this post so deleted the HTTPS binding and re-created but same problem occurred. The SNI kept displaying as “undefined”. I eventually checked the SNI checkbox saved it then unchecked the box saved again and it resolved the issue. Using version: 2.6.0.778
Update: If you check the SNI checkbox and uncheck it again when first setting up it seems to work as well and it doesn’t display the “undefined”. Seems to be a bug though.