Thanks for reaching out. We saw this issue a couple of weeks ago and shipped a fix for it https://github.com/OctopusDeploy/Issues/issues/2097 . You seem to be on a version that should include the fix though. Could you please update to the latest version of Octopus, then run a health check on your Tentacle and show us which version of Calamari is it running?
The reason why I’m asking you to upgrade to the latest Octopus, is because on 3.2.3 we shipped a feature to print the exact Calamari version on the health check .
If possible also please let us know which OS version and Powershell version of that particular server running.
I am also getting this error after migrating from 2.6 to 3.2.2. The error I’m getting doesn’t seem to be related to AES. Here is the stack trace. Let me know if you would like me to open a separate issue
The system cannot find the file specified.
At \1.1.022\Bootstrap.Octopus.Features.IISWebSite_BeforePostDeploy.ps1:73 char:10
Add-Type <<<< -AssemblyName System.Core -ErrorAction SilentlyContinue
CategoryInfo : NotSpecified: (:) [Add-Type], FileNotFoundException
FullyQualifiedErrorId : System.IO.FileNotFoundException,Microsoft.PowerShell.Commands.AddTypeCommand
Ok, this seems quite serious. I first thought this had to do with the setup of the new tentacle machine that I was preparing. But it actually turns out to be a problem related to version OD 3.2.3!
I have upgraded all tentacles from 3.2.0 to 3.2.3 and now all my machines are giving this error.
And unfortunately it seems that even with the rollback to 3.2.0 the issue remains on some servers. And I cannot find any difference in framework installs or Powershell version.
I’m really sorry this has affected you, we thought we’d finally put this issue to rest. The short answer is you should be able to work around this in the short-term by either:
Upgrading to PowerShell 3.0 or 4.0 both of which are compatible with PowerShell 2.0 (these will use .NET 4.0 or greater - PowerShell 2.0 will only use .NET 2.0-3.5.1)
Installing .NET 3.5.1 on the server (if you aren’t able to upgrade PowerShell)
Could you please send me the result of running $PSVersionTable on the failing server? This might help us identify exactly why this is failing in 3.2.2 or greater.
I’d also appreciate if you could send me the error message if it is different from what Steve posted: The system cannot find the file specified.
Add-Type : Could not load file or assembly ‘System.Core, Version=3.5.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089’ or one of its dependencies. The system cannot find the file specified.
At C:\Octopus\Applications\DeployedApplication\1.0.15315.3_3\Bootstrap.Octopus.Features.WindowsService_AfterPreDeploy.ps1:73 char:10
Powershell Info:
10:07:59 Verbose | Octopus Deploy: Calamari version 3.1.5+Branch.master.Sha.6f4ce9c6d5de736661f5f431313a6c5341cef00f
10:08:01 Info | Name Value
10:08:01 Info | ---- -----
10:08:01 Info | CLRVersion 2.0.50727.5485
10:08:01 Info | BuildVersion 6.1.7601.17514
10:08:01 Info | PSVersion 2.0
10:08:01 Info | WSManStackVersion 2.0
10:08:01 Info | PSCompatibleVersions {1.0, 2.0}
10:08:01 Info | SerializationVersion 1.1.0.1
10:08:01 Info | PSRemotingProtocolVersion 2.1
Tentacle Info:
10:08:01 Info | TentacleApplications D:\Octopus\Applications
10:08:01 Info | TentacleExecutablePath D:\Program Files\Octopus Deploy\Tentacle\Tent…
10:08:01 Info | TentacleHome D:\Octopus
10:08:01 Info | TentacleInstanceName Tentacle
10:08:01 Info | TentacleJournal D:\Octopus\DeploymentJournal.xml
10:08:01 Info | TentacleVersion 3.2.2
This email message and any accompanying materials may contain proprietary, privileged and confidential information of CIT Group Inc. or its subsidiaries or affiliates (collectively, “CIT”), and are intended solely for the recipient(s) named above. If you are not the intended recipient of this communication, any use, disclosure, printing, copying or distribution, or reliance on the contents, of this communication is strictly prohibited. CIT disclaims any liability for the review, retransmission, dissemination or other use of, or the taking of any action in reliance upon, this communication by persons other than the intended recipient(s). If you have received this communication in error, please reply to the sender advising of the error in transmission, and immediately delete and destroy the communication and any accompanying materials. To the extent permitted by applicable law, CIT and others may inspect, review, monitor, analyze, copy, record and retain any communications sent from or received at this email address.
I’ve been able to reproduce this behavior reliably on Windows Server 2008 R2 with PowerShell 2.0 and .NET 2.0 and have raised a GitHub Issue for it to be released in 3.2.5.
To make sure we’ve fixed this specific problem for your environment, could you run this script on the failing machine using the Script Console and confirm that it works and logs a Verbose message about falling back to RijndaelManaged?
# 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)
}
Octopus Deploy: Calamari version 3.1.8+Branch.master.Sha.e4e54f13f6acb7ae0b7ce08aa7fd2ec4d3359728
10:50:14Verbose
Could not load AesCryptoServiceProvider, falling back to RijndaelManaged (.NET 2.0).
10:50:14Info
Exit code: 0
The above script appears to work, we get the following message
…
Octopus Deploy: Calamari version 3.1.5+Branch.master.Sha.
Could not load AesCryptoServiceProvider, falling back to RijndaelManaged (.NET 2.0).
Exit code: 0
…