Octopus 3.1 Pre-release variable bug

I recently upgraded to the Octopus 3.1 pre-release to make use of the Azure Cloud Service deployment changes and leverage unpackaging to handle config transforms and variable replacement (which is pretty great).

But then one of my package deployments started running into an issue.

I started seeing an error like this:

The string starting: 08:19:13Error
At C:\Octopus\Work\20150909141912-277\Bootstrap.ps1:17 char:253
08:19:13Error + & "${env:TentacleHome}\Calamari\\Calamari.exe" deploy-package -
08:19:13Error package "C:\Octopus\Files\***.***.***.
08:19:13Error 7-898a-4f72-a826-0705f7a3b3e4" -variables "Variables.json" -sensitiveVariables=
08:19:13Error "Variables.secret <<<< " $variablePassword
08:19:13Error is missing the terminator: ".
08:19:13Error At C:\Octopus\Work\20150909141912-277\Bootstrap.ps1:23 char:1
08:19:13Error +  <<<< 
08:19:13Error   + CategoryInfo          : ParserError: ( $variablePassw...tExitCode 
08:19:13Error }
08:19:13Error :String) [], ParentContainsErrorRecordException
08:19:13Error     + FullyQualifiedErrorId : TerminatorExpectedAtEndOfString
08:19:14Error The remote script failed with exit code 1

After some trial and error and some googling and some sheer luck, I came across this issue: Sensitive variables with special character are not working in 3.1.

Seems that is the problem.

One of the variables in my project is marked as sensitive and has a special character in it.

I set the variable back to not marked as sensitive which is OK in my current environment as a temporary workaround, but may not be for others.

Alternatively, you could change the variable value to one without any special characters. But that could have ripple effects if you’re using variable sets and may need to redeploy affected projects.

I expect it will be fixed soon, but in the meantime this workaround should get you back to deploying.