We are running a C# step template on a linux target.
It seems to fail with a pretty hard error about the exec format or not finding the scriptcs executable. Is this because it’s trying to compile to Windows but run on Linux? (Exec format error)
17:21:19 Error | Unable to execute /etc/octopus/.../Tools/Calamari.linux-x64/14.10.0/ScriptCS/scriptcs.exe, please ensure that /etc/octopus/.../Tools/Calamari.linux-x64/14.10.0/ScriptCS/scriptcs.exe is installed and is in the PATH.
17:21:19 Error | System.Exception: Error when attempting to execute /etc/octopus/.../Tools/Calamari.linux-x64/14.10.0/ScriptCS/scriptcs.exe: Exec format error
17:21:19 Error | ---> System.ComponentModel.Win32Exception (8): Exec format error
17:21:19 Error | at System.Diagnostics.Process.ForkAndExecProcess(String filename, String[] argv, String[] envp, String cwd, Boolean redirectStdin, Boolean redirectStdout, Boolean redirectStderr, Boolean setCredentials, UInt32 userId, UInt32 groupId, UInt32[] groups, Int32& stdinFd, Int32& stdoutFd, Int32& stderrFd, Boolean usesTerminal, Boolean throwOnNoExec)
17:21:19 Error | at System.Diagnostics.Process.StartCore(ProcessStartInfo startInfo)
17:21:19 Error | at System.Diagnostics.Process.Start()
17:21:19 Error | at Calamari.Common.Features.Processes.SilentProcessRunner.ExecuteCommand(String executable, String arguments, String workingDirectory, Dictionary`2 environmentVars, String userName, SecureString password, Action`1 output, Action`1 error) in C:\buildAgent\work\e0cefbed4ad11812\source\Calamari.Common\Features\Processes\SilentProcessRunner.cs:line 160
17:21:19 Error | --- End of inner exception stack trace ---
17:21:19 Error | at Calamari.Common.Features.Processes.SilentProcessRunner.ExecuteCommand(String executable, String arguments, String workingDirectory, Dictionary`2 environmentVars, String userName, SecureString password, Action`1 output, Action`1 error) in C:\buildAgent\work\e0cefbed4ad11812\source\Calamari.Common\Features\Processes\SilentProcessRunner.cs:line 173
17:21:19 Error | at Calamari.Common.Features.Processes.CommandLineRunner.Execute(CommandLineInvocation invocation) in C:\buildAgent\work\e0cefbed4ad11812\source\Calamari.Common\Features\Processes\CommandLineRunner.cs:line 28
17:21:19 Error | The command that caused the exception was: "/etc/octopus/.../Tools/Calamari.linux-x64/14.10.0/ScriptCS/scriptcs.exe" -script "/etc/octopus/.../Work/20200914172116-33364-2/Bootstrap.50c-4726-8c47-417af6b617ad.Script.csx" -- "we6crG3ReW2bdiYH6I7N5w=="
17:21:19 Verbose | Process /bin/bash in /etc/octopus/.../Work/20200914172116-33364-2 exited with code 255
I’ve checked my target and the scriptcs.exe
file is indeed available at the location it specifies.
Any assistance you could provide would be appreciated.
If I’m missing something in my C# that’s also a possiblity. This is the first time I’ve attempted to use a C# script step. Unfortunately what I need to do is not easy using any of the other languages (Bash or Powershell) so it would be really useful if we could get this to work.
Thanks.