Missing assemblies?

Hi,

We’re trying to get Octopus Deploy going on one of our production servers, but unfortunately we’re running into the following errors:

16:32:54   Error    |       Add-Type : Could not load file or assembly 'System.Core, Version=3.5.0.0, Cultu
16:32:54   Error    |       re=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. The sy
16:32:54   Error    |       stem cannot find the file specified.
16:32:54   Error    |       At D:\Octopus\Work\20151117153241-1\Bootstrap.Script.ps1:3 char:9
16:32:54   Error    |       + Add-Type <<<<  -AssemblyName System.Core
16:32:54   Error    |       + CategoryInfo          : NotSpecified: (:) [Add-Type], FileNotFoundExcept
16:32:54   Error    |       ion
16:32:54   Error    |       + FullyQualifiedErrorId : System.IO.FileNotFoundException,Microsoft.PowerS
16:32:54   Error    |       hell.Commands.AddTypeCommand
16:32:54   Error    |       New-Object : Cannot find type [System.Security.Cryptography.AesCryptoServicePro
16:32:54   Error    |       vider]: make sure the assembly containing this type is loaded.
16:32:54   Error    |       At D:\Octopus\Work\20151117153241-1\Bootstrap.Script.ps1:71 char:24
16:32:54   Error    |       +     $provider = new-Object <<<<  System.Security.Cryptography.AesCryptoServic
16:32:54   Error    |       eProvider
16:32:54   Error    |       + CategoryInfo          : InvalidType: (:) [New-Object], PSArgumentExcepti
16:32:54   Error    |       on
16:32:54   Error    |       + FullyQualifiedErrorId : TypeNotFound,Microsoft.PowerShell.Commands.NewOb
16:32:54   Error    |       jectCommand
16:32:54   Error    |       The remote script failed with exit code 1

It seems we have all the latest frameworks installed (see attached screenshot). What are we missing?

Thanks,

Pascal.

Hi,

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.

Regards,

Dalmiro

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

Upgrading to powershell 4.0 resolved this for me

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.

I hope you can fix this quickly!

Thanks, Pascal

Same here:
Running Tentacle version 3.2.3
Running latest version of Calamari: 3.1.8

Hi,

Could everyone having this issue let us know which version of Powershell are running the Tentacles where you see this issue?

I’m gonna reach out to the dev that worked on this issue, and all info we can gather about it will come in handy for sure.

Dalmiro

Powershell 2.0

Powershell 2.0 too.

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. :frowning:

Hi All,

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.

Thanks for your help!
Mike

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

  • Add-Type <<<< -AssemblyName System.Core -ErrorAction SilentlyContinue
  • CategoryInfo : NotSpecified: (:slight_smile: [Add-Type], FileNotFoundException
  • FullyQualifiedErrorId : System.IO.FileNotFoundException,Microsoft.PowerShell.Commands.AddTypeCommand

Our $PSVersionTable looks like this:

CLRVersion                     2.0.50727.5485
BuildVersion                   6.1.7601.17514
PSVersion                      2.0
WSManStackVersion              2.0
PSCompatibleVersions           {1.0, 2.0}
SerializationVersion           1.1.0.1
PSRemotingProtocolVersion      2.1

This is exactly the same as on one of our servers on which everything does work. So I doubt it is a generic Powershell 2.0 problem.

The error message is the same as Luuk’s:

20:29:34   Error    |       Add-Type : Could not load file or assembly 'System.Core, Version=3.5.0.0, Cultu
20:29:34   Error    |       re=neutral, PublicKeyToken=b77a5c561934e089' or one of its dependencies. The sy
20:29:34   Error    |       stem cannot find the file specified.
20:29:34   Error    |       At D:\Octopus\Work\20151119192811-2\Bootstrap.Script.ps1:3 char:9
20:29:34   Error    |       + Add-Type <<<<  -AssemblyName System.Core
20:29:34   Error    |       + CategoryInfo          : NotSpecified: (:) [Add-Type], FileNotFoundExcept
20:29:34   Error    |       ion
20:29:34   Error    |       + FullyQualifiedErrorId : System.IO.FileNotFoundException,Microsoft.PowerS
20:29:34   Error    |       hell.Commands.AddTypeCommand
20:29:35   Error    |       New-Object : Cannot find type [System.Security.Cryptography.AesCryptoServicePro
20:29:35   Error    |       vider]: make sure the assembly containing this type is loaded.
20:29:35   Error    |       At D:\Octopus\Work\20151119192811-2\Bootstrap.Script.ps1:71 char:24
20:29:35   Error    |       +     $provider = new-Object <<<<  System.Security.Cryptography.AesCryptoServic
20:29:35   Error    |       eProvider
20:29:35   Error    |       + CategoryInfo          : InvalidType: (:) [New-Object], PSArgumentExcepti
20:29:35   Error    |       on
20:29:35   Error    |       + FullyQualifiedErrorId : TypeNotFound,Microsoft.PowerShell.Commands.NewOb
20:29:35   Error    |       jectCommand
20:29:35   Error    |       The remote script failed with exit code 1

Here are our environment settings:

20:29:34   Verbose  |       [env:COMPUTERNAME] = 'NLHLM1STAGUI01'
20:29:34   Verbose  |       [env:TentacleJournal] = 'D:\Octopus\DeploymentJournal.xml'
20:29:34   Verbose  |       [env:PUBLIC] = 'C:\Users\Public'
20:29:34   Verbose  |       [env:LOCALAPPDATA] = 'C:\Windows\system32\config\systemprofile\AppData\Local'
20:29:34   Verbose  |       [env:PSModulePath] = 'WindowsPowerShell\Modules;C:\Windows\system32\WindowsPowerShell\v1.0\Modules\'
20:29:34   Verbose  |       [env:PROCESSOR_ARCHITECTURE] = 'AMD64'
20:29:34   Verbose  |       [env:Path] = 'C:\Windows\system32;C:\Windows;C:\Windows\System32\Wbem;C:\Windows\System32\WindowsPowerShell\v1.0\;'
20:29:34   Verbose  |       [env:CommonProgramFiles(x86)] = 'C:\Program Files (x86)\Common Files'
20:29:34   Verbose  |       [env:ProgramFiles(x86)] = 'C:\Program Files (x86)'
20:29:34   Verbose  |       [env:PROCESSOR_LEVEL] = '6'
20:29:34   Verbose  |       [env:windows_tracing_flags] = '3'
20:29:34   Verbose  |       [env:ProgramFiles] = 'C:\Program Files'
20:29:34   Verbose  |       [env:PATHEXT] = '.COM;.EXE;.BAT;.CMD;.VBS;.VBE;.JS;.JSE;.WSF;.WSH;.MSC'
20:29:34   Verbose  |       [env:PSExecutionPolicyPreference] = 'Unrestricted'
20:29:34   Verbose  |       [env:SystemRoot] = 'C:\Windows'
20:29:34   Verbose  |       [env:TentacleApplications] = 'D:\Octopus\Applications'
20:29:34   Verbose  |       [env:ALLUSERSPROFILE] = 'C:\ProgramData'
20:29:34   Verbose  |       [env:TentacleHome] = 'D:\Octopus'
20:29:34   Verbose  |       [env:FP_NO_HOST_CHECK] = 'NO'
20:29:34   Verbose  |       [env:ProgramData] = 'C:\ProgramData'
20:29:34   Verbose  |       [env:PROCESSOR_REVISION] = '2d07'
20:29:34   Verbose  |       [env:TentacleInstanceName] = 'Tentacle'
20:29:34   Verbose  |       [env:CommonProgramW6432] = 'C:\Program Files\Common Files'
20:29:34   Verbose  |       [env:CommonProgramFiles] = 'C:\Program Files\Common Files'
20:29:34   Verbose  |       [env:OS] = 'Windows_NT'
20:29:34   Verbose  |       [env:PROCESSOR_IDENTIFIER] = 'Intel64 Family 6 Model 45 Stepping 7, GenuineIntel'
20:29:34   Verbose  |       [env:ComSpec] = 'C:\Windows\system32\cmd.exe'
20:29:34   Verbose  |       [env:TentacleVersion] = '3.2.0'
20:29:34   Verbose  |       [env:SystemDrive] = 'C:'
20:29:34   Verbose  |       [env:TEMP] = 'C:\Windows\TEMP'
20:29:34   Verbose  |       [env:USERPROFILE] = 'C:\Windows\system32\config\systemprofile'
20:29:34   Verbose  |       [env:NUMBER_OF_PROCESSORS] = '1'
20:29:34   Verbose  |       [env:APPDATA] = 'C:\Windows\system32\config\systemprofile\AppData\Roaming'
20:29:34   Verbose  |       [env:windows_tracing_logfile] = 'C:\BVTBin\Tests\installpackage\csilogfile.log'
20:29:34   Verbose  |       [env:TMP] = 'C:\Windows\TEMP'
20:29:34   Verbose  |       [env:USERNAME] = 'NLHLM1STAGUI01$'
20:29:34   Verbose  |       [env:ProgramW6432] = 'C:\Program Files'
20:29:34   Verbose  |       [env:windir] = 'C:\Windows'
20:29:34   Verbose  |       [env:USERDOMAIN] = 'WORKGROUP'
20:29:34   Verbose  |       [env:TentacleExecutablePath] = 'D:\Octopus Deploy\Tentacle\Tentacle.exe'
20:29:34   Verbose  |       [Octopus.Tentacle.Agent.InstanceName] = 'Tentacle'

Note: as mentioned above: even after a downgrade to version 3.2.0, this problem still keeps happening on the problematic servers.

We are having this problem as well.

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

Any news on this?

Hi All,

We’ll be working on this as a priority today. In the meantime you can work around the problem by either:

  • Upgrading to PowerShell 3.0 (or greater) which are backwards compatible down to PowerShell 2.0
  • Installing .NET Framework 3.5.1 using Add/Remove Features on your server - this enables PowerShell 2.0 to use the System.Core assembly.

Assuming you cannot use either of these work arounds, we will be shipping another release with a proposed fix.

Hope that helps,
Mike

I will be out of office with limited access to email and no voice mail until November 30, 2015.

[CIT.com]http://www.cit.com
Calvin Ward
Enterprise Architecture: Agile Transformation and Effective Delivery
Information Technology +1 904 380 9218 (tel)

mailto:{{smtp:sender}}Calvin.Ward@cit.commailto:Calvin.Ward@cit.com 10201 Centurion Parkway North
Jacksonville, FL 32256
www.cit.comhttp://www.cit.com


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.


Hi All,

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)
}

Hope that helps,
Mike

Hi Mike,

Nope… that does not work either. I’m still getting the same error message as reported above:

Task ID:        ServerTasks-4895
Task status:    Success
Task queued:    Monday, November 23, 2015 10:04 AM
Task started:   Monday, November 23, 2015 10:04 AM
Task duration:  4 seconds
Server version: 3.2.0+Branch.master.Sha.391e7e2a161abf18405930022a65470fbfeb195d

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

Pascal

Works fine here:

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

Hi Mike,

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