Missing assemblies?

Hi All,

Thanks for testing that out for me. It looks like this has actually succeeded for all of you (Exit code: 0) but for some reason Pascal’s system is writing to STDERR even though we’ve caught the exception.

We’ll ship this today to unblock you all, and I’ll continue to investigate why Pascal’s system is behaving differently. Got any ideas about special group policies etc Pascal?

Hope that helps!

Hi Pascal,

Could you try again with this script (only difference is including the $ErrorActionPreference explicitly in this part of the script:

$ErrorActionPreference = "Stop"

# Try AesCryptoServiceProvider first (requires .NET 3.5+), otherwise fall back to RijndaelManaged (.NET 2.0)
# Note using RijndaelManaged will fail in FIPS compliant environments: https://support.microsoft.com/en-us/kb/811833
$algorithm = $null
try {
    Add-Type -AssemblyName System.Core
    $algorithm = [System.Security.Cryptography.SymmetricAlgorithm] (New-Object System.Security.Cryptography.AesCryptoServiceProvider)
} catch {
    Write-Verbose "Could not load AesCryptoServiceProvider, falling back to RijndaelManaged (.NET 2.0)."
    $algorithm = [System.Security.Cryptography.SymmetricAlgorithm] (New-Object System.Security.Cryptography.RijndaelManaged)


Hi Mike,

Same thing:

Task ID:        ServerTasks-4965
Task status:    Success
Task queued:    Monday, November 23, 2015 10:02 PM
Task started:   Monday, November 23, 2015 10:02 PM
Task duration:  5 seconds
Server version: 3.2.0+Branch.master.Sha.391e7e2a161abf18405930022a65470fbfeb195d

                    | == Success: Script run from management console ==
22:02:17   Info     |   Script run from management console
                    |   == Success: Run script on: NLHLM1STAGUI01 ==
22:02:22   Verbose  |     Octopus Deploy: Calamari version 3.1.2+Branch.master.Sha.08f592c501569f343a331d542df3878d35959e69
22:02:22   Error    |     Add-Type : Could not load file or assembly 'System.Core, Version=, Cultu
22:02:22   Error    |     re=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. The sy
22:02:22   Error    |     stem cannot find the file specified.
22:02:22   Error    |     At D:\Octopus\Work\20151123210217-10\Bootstrap.Script.ps1:3 char:9
22:02:22   Error    |     + Add-Type <<<<  -AssemblyName System.Core
22:02:22   Error    |     + CategoryInfo          : NotSpecified: (:) [Add-Type], FileNotFoundExcept
22:02:22   Error    |     ion
22:02:22   Error    |     + FullyQualifiedErrorId : System.IO.FileNotFoundException,Microsoft.PowerS
22:02:22   Error    |     hell.Commands.AddTypeCommand
22:02:22   Verbose  |     Could not load AesCryptoServiceProvider, falling back to RijndaelManaged (.NET 2.0).
22:02:22   Info     |     Exit code: 0



Hi All,

We’ve released Octopus 3.2.5 this morning with the proposed bug fix. Please get back in touch and let me know how it works in your environments.

Pascal, I’m still trying to figure out what could possibly be causing the behaviour you are seeing. Could you confirm for me that your deployments start succeeding, perhaps with these misleading error logs buried within, or if the deployment still fails.


Good news, Mike! With the new version 3.2.5, my System.Core error has gone and everything works fine now. Great!



Hi Pascal,

That’s great news, thanks for getting back to let me know.

Happy Deployments!

I think the same problem is also in this file:
Bootstrap.Octopus.Features.WindowsService_AfterPreDeploy.ps1:78 char:10

(Running on 3.2.6)

Add-Type : Could not load file or assembly 'System.Core, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. The system cannot find the file specified.
At C:\Octopus\Applications\Production\Test\1.0.15315.3_1\Bootstrap.Octopus.Features.WindowsService_AfterPreDeploy.ps1:78 char:10
+ Add-Type <<<<  -AssemblyName System.Core -ErrorAction SilentlyContinue
+ CategoryInfo          : NotSpecified: (:) [Add-Type], FileNotFoundException
+ FullyQualifiedErrorId : System.IO.FileNotFoundException,Microsoft.PowerShell.Commands.AddTypeCommand

Hi All,

I have to apologise for some confusion - we shipped this particular fix as part of 3.2.5 but discovered a very mysterious issue where extra padding is being added to the end of decrypted values in a different set of cases. In the end we narrowed it down to this particular code change.

We’ve ended up removing the 3.2.5 release and shipped 3.2.6 as an emergency hotfix, with this code reverted.

So Luuk, that’s why you’re seeing the behaviour in 3.2.6 in Bootstrap.Octopus.Features.WindowsService_AfterPreDeploy.ps1 - it’s actually the bootstrap.ps1 back in the state that doesn’t work with PowerShell 2.0 and .NET 2.0.

Long story short, we are working very hard to figure out how to get both bug fixes completed and are planning to ship that today in 3.2.7 after we can reliably reproduce (and prove we’ve fixed) both problem cases.

Again, I’m sorry for the confusion but be assured we are working to resolve this issue as quickly as we can.

Hope that helps.

Hold the press, Mike! With 3.2.6, I’m back at my old error:

16:33:52   Verbose  |       Name                           Value
16:33:52   Verbose  |       ----                           -----
16:33:52   Verbose  |       CLRVersion                     2.0.50727.5485
16:33:52   Verbose  |       BuildVersion                   6.1.7601.17514
16:33:52   Verbose  |       PSVersion                      2.0
16:33:52   Verbose  |       WSManStackVersion              2.0
16:33:52   Verbose  |       PSCompatibleVersions           {1.0, 2.0}
16:33:52   Verbose  |       SerializationVersion 
16:33:52   Verbose  |       PSRemotingProtocolVersion      2.1
16:33:52   Error    |       Add-Type : Could not load file or assembly 'System.Core, Version=, Cultu
16:33:52   Error    |       re=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. The sy
16:33:52   Error    |       stem cannot find the file specified.
16:33:52   Error    |       At D:\Octopus\Work\20151126153349-4\Bootstrap.Script.ps1:78 char:10
16:33:52   Error    |       +     Add-Type <<<<  -AssemblyName System.Core -ErrorAction SilentlyContinue
16:33:52   Error    |       + CategoryInfo          : NotSpecified: (:) [Add-Type], FileNotFoundExcept
16:33:52   Error    |       ion
16:33:52   Error    |       + FullyQualifiedErrorId : System.IO.FileNotFoundException,Microsoft.PowerS
16:33:52   Error    |       hell.Commands.AddTypeCommand
16:33:53   Fatal    |       The remote script failed with exit code 1

I just finished another manual rollback to 3.2.5 to get things to work again.

So I was hopeful of continuing with 3.2.5 and I deployed a tentacle to another server. But on this one I’m getting another error. :frowning: Not sure it’s related:

21:32:14   Verbose  |       Creating 'd:\inetpub\ibe\Octopus.Features.IISWebSite_BeforePostDeploy.ps1' from embedded resource
21:32:14   Verbose  |       Executing 'd:\inetpub\ibe\Octopus.Features.IISWebSite_BeforePostDeploy.ps1'
21:32:15   Verbose  |       Name                           Value
21:32:15   Verbose  |       ----                           -----
21:32:15   Verbose  |       CLRVersion                     2.0.50727.5485
21:32:15   Verbose  |       BuildVersion                   6.1.7601.17514
21:32:15   Verbose  |       PSVersion                      2.0
21:32:15   Verbose  |       WSManStackVersion              2.0
21:32:15   Verbose  |       PSCompatibleVersions           {1.0, 2.0}
21:32:15   Verbose  |       SerializationVersion 
21:32:15   Verbose  |       PSRemotingProtocolVersion      2.1
21:32:15   Verbose  |       Could not load AesCryptoServiceProvider, falling back to RijndaelManaged (.NET 2.0).
21:32:15   Verbose  |       Could not load AesCryptoServiceProvider, falling back to RijndaelManaged (.NET 2.0).
21:32:15   Error    |       ForEach-Object : Exception calling "Parse" with "1" argument(s): "String was no
21:32:15   Error    |       t recognized as a valid Boolean."
21:32:15   Error    |       At D:\inetpub\ibe\Octopus.Features.IISWebSite_BeforePostDeploy.ps1:127 char:44
21:32:15   Error    |       +     $bindingString.Split("|") | foreach-object <<<<  {
21:32:15   Error    |       + CategoryInfo          : NotSpecified: (:) [ForEach-Object], MethodInvoca
21:32:15   Error    |       tionException
21:32:15   Error    |       + FullyQualifiedErrorId : DotNetMethodException,Microsoft.PowerShell.Comma
21:32:15   Error    |       nds.ForEachObjectCommand
21:32:15   Verbose  |       Deleting 'd:\inetpub\ibe\Octopus.Features.IISWebSite_BeforePostDeploy.ps1'
21:32:15   Error    |       Script 'd:\inetpub\ibe\Octopus.Features.IISWebSite_BeforePostDeploy.ps1' returned non-zero exit code: 1
21:32:15   Error    |       Running rollback conventions...

Hope you can sort this out quickly…

Thanks, Pascal

Hi All,

Just wanted to let you know we’ve found a middle-ground solution that works for all of these scenarios we’ve discussed on this thread, and the other thread.

It will ship with Octopus 3.2.7. We have also been able to implement end-to-end tests that covers these failure scenarios more completely.

Pascal, could you please raise another support request for the String was not recognized as a valid boolean? It’s unrelated.

Hope that helps, and again, I’m sorry for the confusion.

Hi Mike,

Sorry, the “String was not recognized as a valid boolean” error was a misconfiguration from my side. I thought it might be related when I saw the “Could not load AesCryptoServiceProvider, falling back to RijndaelManaged (.NET 2.0).” message. But luckily it wasn’t.

Looking forward to version 3.2.7.


This is critical, do we have a clear ETA for 3.2.7?

Hi All,

We’ve shipped Octopus Deploy 3.2.7 with the promised “middle ground” solution that should work for all of the scenarios we’ve identified.

Please don’t hesitate to get back in touch if you have any issues moving forwards.

Happy Deployments!