Random error on deployment

Hi.

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

  • $provider = new-Object <<<<  System.Security.Cryptography.AesCryptoServic
    

18:45:28Error
eProvider
18:45:28Error
+ CategoryInfo : InvalidType: (:slight_smile: [New-Object], PSArgumentExcepti
18:45:28Error
on
18:45:28Error
+ FullyQualifiedErrorId : TypeNotFound,Microsoft.PowerShell.Commands.NewOb
18:45:28Error
jectCommand

See attached file for full error.

Our part in the deploymentpackage does not use AesCrypto… so just wanted to let you guys know. =)

OD_DeployError.txt (409 KB)

Hi!

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.

Hope that helps!
Mike

Hi Michael.

We just upgraded from 2.6.5.1010 to 3.1.3.

No we are not blocked. But still took me a while to understand that it was not our fault ^^

Hi!

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?

Thanks for your help,
Mike

Hi.

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 Hope all this info helps! =)

Hi,

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.

Hope that helps!
Mike