Run Container Step Fails

I have a deploy process that runs a Windows Container on a Octopus Worker. If I log into the worker, I am able to run the container with the simple command

docker run -it <name of image> -c  '.\powershell.ps1 -<args>'

However, when I perform a deploy on Octopus I get the following log

Failed: OCTOPUS-KONT1
17:19:26 Verbose | Octopus Server version: 3.15.6+Branch.master.Sha.4c9eb9b8906a8395ca5915786ebb769352d72515
17:19:26 Verbose | Environment Information:
| OperatingSystem: Microsoft Windows NT 6.2.9200.0
| OsBitVersion: x64
| Is64BitProcess: True
| CurrentUser: NT AUTHORITY\SYSTEM
| MachineName: AWS-OCTOPUSDEPL
| ProcessorCount: 4
| CurrentDirectory: C:\Windows\system32
| TempDirectory: C:\Windows\TEMP
| HostProcessName: Octopus.Server
17:19:26 Info | Performing docker run command on ‘OCTOPUS-KONT1’
17:19:27 Verbose | Octopus Deploy: Calamari version 3.7.91
17:19:27 Verbose | Environment Information:
17:19:27 Verbose | OperatingSystem: Microsoft Windows NT 6.2.9200.0
17:19:27 Verbose | OsBitVersion: x64
17:19:27 Verbose | Is64BitProcess: True
17:19:27 Verbose | CurrentUser: NT AUTHORITY\SYSTEM
17:19:27 Verbose | MachineName: OCTOPUS-KONT1
17:19:27 Verbose | ProcessorCount: 4
17:19:27 Verbose | CurrentDirectory: C:\Octopus\Work\20180309171926-55535-31
17:19:27 Verbose | TempDirectory: C:\Windows\TEMP
17:19:27 Verbose | HostProcessName: Calamari
17:19:28 Verbose | Executing ‘C:\Octopus\Work\20180309171926-55535-31\Script.ps1’
17:19:29 Verbose | Name Value
17:19:29 Verbose | ---- -----
17:19:29 Verbose | PSVersion 5.1.14393.2097
17:19:29 Verbose | PSEdition Desktop
17:19:29 Verbose | PSCompatibleVersions {1.0, 2.0, 3.0, 4.0…}
17:19:29 Verbose | BuildVersion 10.0.14393.2097
17:19:29 Verbose | CLRVersion 4.0.30319.42000
17:19:29 Verbose | WSManStackVersion 3.0
17:19:29 Verbose | PSRemotingProtocolVersion 2.3
17:19:29 Verbose | SerializationVersion 1.1.0.1
17:19:29 Verbose | PowerShell Environment Information:
17:19:29 Verbose | OperatingSystem: Microsoft Windows NT 10.0.14393.0
17:19:29 Verbose | OsBitVersion: x64
17:19:29 Verbose | Is64BitProcess: True
17:19:29 Verbose | CurrentUser: NT AUTHORITY\SYSTEM
17:19:29 Verbose | MachineName: OCTOPUS-KONT1
17:19:29 Verbose | ProcessorCount: 4
17:19:29 Verbose | CurrentDirectory: C:\Octopus\Work\20180309171926-55535-31
17:19:29 Verbose | CurrentLocation: C:\Octopus\Work\20180309171926-55535-31
17:19:29 Verbose | TempDirectory: C:\Windows\TEMP
17:19:29 Verbose | HostProcessName: powershell
17:19:29 Verbose | TotalPhysicalMemory: 4193844 KB
17:19:29 Verbose | AvailablePhysicalMemory: 2236864 KB
17:19:29 Error | At C:\Octopus\Work\20180309171926-55535-31\Script.ps1:15 char:63
17:19:29 Error | + Set-OctopusVariable -name “Docker.Inspect” -value $Inspection
17:19:29 Error | + ~
17:19:29 Error | Missing closing ‘)’ in subexpression.
17:19:29 Error | + CategoryInfo : ParserError: (:slight_smile: [], ParentContainsErrorRecordEx
17:19:29 Error | ception
17:19:29 Error | + FullyQualifiedErrorId : MissingEndParenthesisInSubexpression
17:19:29 Verbose | Updating manifest with output variables
17:19:29 Verbose | Updating manifest with action evaluated variables
17:19:29 Fatal | The remote script failed with exit code 1
17:19:29 Verbose | at Octopus.Worker.Scripting.ScriptResult.EnsureSuccessful()
| at Octopus.Server.Orchestration.Deploy.Docker.DockerRunActionHandler.Execute(ActionCommand command, Machine machine)
| at Octopus.Server.Orchestration.Deploy.DeploymentTaskController.<>c__DisplayClass29_0.b__0()
| at Octopus.Server.Orchestration.Deploy.DeploymentTaskController.ExecuteWithTransientErrorDetection(Action action, Machine machine)
| at Octopus.Server.Orchestration.Deploy.DeploymentTaskController.ExecuteActionAndInitLoggingContext(PlannedStep step, Machine machine, PlannedAction action)
17:19:29 Fatal | Deploy Azure Infrastrucrue on OCTOPUS-KONT1

I am wondering what am I missing? The error is that there is a missing ‘)’ on a file I did not write?

I got it fixed. There error was I did not add my Data Variable Set.

Hi,

Thanks for getting in touch! I’m glad to hear you have resolved your issue. :slight_smile:

Please feel free to get in touch at any time if you have any questions.

Best regards,