This error randomly apprears and on a retry of the deployment same package works.
first part of the error message:
New-Object : Cannot find type [System.Security.Cryptography.AesCryptoServicePro
18:45:28Error
vider]: make sure the assembly containing this type is loaded.
18:45:28Error
At C:\Octopus\Applications\CCS - Integration\PaGatewayServer\4.37.15279.7918\Bo
18:45:28Error
otstrap.Octopus.Features.WindowsService_AfterPreDeploy.ps1:69 char:24
18:45:28Error
Thanks for getting in touch. I’m wondering what version of Octopus you’re using? The reason I ask is that we fixed a bug in 3.1.1 that looks similar, related to a PowerShell version mismatch with some sensitive variables work we were doing.
It sounds like you’re not blocked but please do keep me in the loop with what you find out.
Thanks for getting back to me with the version. The thing that is confusing for me is that this is happening randomly.
When we deploy a Windows Service, we run a PowerShell script that decrypts sensitive variables, and this is where the log you attached says it’s failing, with a TypeLoadException. This would only happen (to my knowledge) if there was something environmental going wrong, and should be a repetitive failure.
I want to raise a GitHub Issue for this problem, but I’d like to confirm that the deployment is failing and subsequently succeeding on the same machine if you attempt the deployment again?
Also could you confirm some details about the target Machine that is failing, like Server version, PowerShell version and .NET version?
Ran the deployment a couple of times and yeah it stops on random task that deploys service.
Its more than 10 of those steps in the deployment chain, just for reference.
TargetMachine is a Virtual Windows Server 2008 R2 Standard 64Bit with SP1.
.Net 4.5.2 (build 4.5.51209)
Powershell:
[cid:image001.png@01D101D0.2A6DCF80]
I’ve raised a GitHub Issue for the problem you’ve reported. Feel free to track the progress of the work by watching that Issue. Also please make sure you get back in touch if the frequency increases.