Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

OctoPack doesn't work on Linux #2535

Closed
trondhindenes opened this issue Apr 24, 2019 · 17 comments

Comments

@trondhindenes
Copy link

commented Apr 24, 2019

What You Are Seeing?

OctoPack fails with Octo: Could not locate executable. On the same build, OctoCreateRelease succeeds. See stacktrace at bottom of this issue

What is Expected?

OctoPack should work

What version of Cake are you using?

tested with both 0.30.0 and 0.28.0

Are you running on a 32 or 64 bit system?

64

What environment are you running on? Windows? Linux? Mac?

Linux

Are you running on a CI Server? If so, which one?

Fails both locally and in ci. Using Gitlab-runner.

How Did You Get This To Happen? (Steps to Reproduce)

Just created an OctoPack step, nothing special

Output Log

The weird thing here is that one "octo command" succeeds, the other does not. This leads me to believe that there's an error in how OctoPack resolves its tool path. I've also tried using the ToolPath parameter in the settings object to manually specify the path to the octo.exe package, but it doesn't help.

There is very little (none, really) logging around how Octopus resolves tools paths, so it's pretty much a black box when it fails.

Stacktrace:

Executing task: Pack
An error occurred when executing task 'Pack'.
Error: System.AggregateException: One or more errors occurred. (Octo: Could not locate executable.) ---> Cake.Core.CakeException: Octo: Could not locate executable.
  at Cake.Core.Tooling.Tool`1[TSettings].RunProcess (TSettings settings, Cake.Core.IO.ProcessArgumentBuilder arguments, Cake.Core.IO.ProcessSettings processSettings) [0x00071] in <1a12afcf649f4de8ab5d15d82d4f6310>:0 
  at Cake.Core.Tooling.Tool`1[TSettings].Run (TSettings settings, Cake.Core.IO.ProcessArgumentBuilder arguments, Cake.Core.IO.ProcessSettings processSettings, System.Action`1[T] postAction) [0x0001c] in <1a12afcf649f4de8ab5d15d82d4f6310>:0 
  at Cake.Core.Tooling.Tool`1[TSettings].Run (TSettings settings, Cake.Core.IO.ProcessArgumentBuilder arguments) [0x00000] in <1a12afcf649f4de8ab5d15d82d4f6310>:0 
  at Cake.Common.Tools.OctopusDeploy.OctopusDeployPacker.Pack (System.String id, Cake.Common.Tools.OctopusDeploy.OctopusPackSettings settings) [0x00017] in <d84cb7ae67bd4bf69897adf81e34714b>:0 
  at Cake.Common.Tools.OctopusDeploy.OctopusDeployAliases.OctoPack (Cake.Core.ICakeContext context, System.String id, Cake.Common.Tools.OctopusDeploy.OctopusPackSettings settings) [0x00039] in <d84cb7ae67bd4bf69897adf81e34714b>:0 
  at Submission#0.OctoPack (System.String id, Cake.Common.Tools.OctopusDeploy.OctopusPackSettings settings) [0x0000c] in <dba5a7c70e1f4221b4db7847fb712bc6>:0 
  at Submission#0.<<Initialize>>b__0_2 (RiksTV.Cake.BuildContext context) [0x0006b] in <dba5a7c70e1f4221b4db7847fb712bc6>:0 
  at Cake.Core.CakeTaskBuilderExtensions+<>c__DisplayClass18_0`1[TData].<Does>b__0 (Cake.Core.ICakeContext context, TData data) [0x00000] in <1a12afcf649f4de8ab5d15d82d4f6310>:0 
  at Cake.Core.CakeTaskBuilderExtensions+<>c__DisplayClass23_0`1[TData].<Does>b__0 (Cake.Core.ICakeContext context) [0x0000c] in <1a12afcf649f4de8ab5d15d82d4f6310>:0 
  at Cake.Core.CakeTaskBuilderExtensions+<>c__DisplayClass20_0.<Does>b__0 (Cake.Core.ICakeContext x) [0x00000] in <1a12afcf649f4de8ab5d15d82d4f6310>:0 
  at Cake.Core.CakeTask.Execute (Cake.Core.ICakeContext context) [0x00066] in <1a12afcf649f4de8ab5d15d82d4f6310>:0 
  at Cake.Core.DefaultExecutionStrategy.ExecuteAsync (Cake.Core.CakeTask task, Cake.Core.ICakeContext context) [0x000ee] in <1a12afcf649f4de8ab5d15d82d4f6310>:0 
  at Cake.Core.CakeEngine.ExecuteTaskAsync (Cake.Core.ICakeContext context, Cake.Core.IExecutionStrategy strategy, System.Diagnostics.Stopwatch stopWatch, Cake.Core.CakeTask task, Cake.Core.CakeReport report) [0x00131] in <1a12afcf649f4de8ab5d15d82d4f6310>:0 
  at Cake.Core.CakeEngine.RunTask (Cake.Core.ICakeContext context, Cake.Core.IExecutionStrategy strategy, Cake.Core.CakeTask task, System.String target, System.Diagnostics.Stopwatch stopWatch, Cake.Core.CakeReport report) [0x00124] in <1a12afcf649f4de8ab5d15d82d4f6310>:0 
  at Cake.Core.CakeEngine.RunTargetAsync (Cake.Core.ICakeContext context, Cake.Core.IExecutionStrategy strategy, Cake.Core.ExecutionSettings settings) [0x00338] in <1a12afcf649f4de8ab5d15d82d4f6310>:0 
  at Cake.Scripting.BuildScriptHost.RunTargetAsync (System.String target) [0x0009f] in <52bc22bce5254240ba373b3cf23da1ab>:0 
  at Cake.Core.Scripting.ScriptHost.RunTarget (System.String target) [0x0000d] in <1a12afcf649f4de8ab5d15d82d4f6310>:0 
  at Submission#0+<<Initialize>>d__0.MoveNext () [0x00122] in <dba5a7c70e1f4221b4db7847fb712bc6>:0 
  at Microsoft.CodeAnalysis.Scripting.ScriptExecutionState.RunSubmissionsAsync[TResult] (System.Collections.Immutable.ImmutableArray`1[T] precedingExecutors, System.Func`2[T,TResult] currentExecutor, System.Runtime.CompilerServices.StrongBox`1[T] exceptionHolderOpt, System.Func`2[T,TResult] catchExceptionOpt, System.Threading.CancellationToken cancellationToken) [0x00186] in <3ee4bd870c1146d59b98317e4bbdcbe8>:0 
  at Microsoft.CodeAnalysis.Scripting.Script`1[T].RunSubmissionsAsync (Microsoft.CodeAnalysis.Scripting.ScriptExecutionState executionState, System.Collections.Immutable.ImmutableArray`1[T] precedingExecutors, System.Func`2[T,TResult] currentExecutor, System.Func`2[T,TResult] catchExceptionOpt, System.Threading.CancellationToken cancellationToken) [0x000a8] in <3ee4bd870c1146d59b98317e4bbdcbe8>:0 
   --- End of inner exception stack trace ---
  at System.Threading.Tasks.Task.ThrowIfExceptional (System.Boolean includeTaskCanceledExceptions) [0x00011] in <6649516e5b3542319fb262b421af0adb>:0 
  at System.Threading.Tasks.Task.Wait (System.Int32 millisecondsTimeout, System.Threading.CancellationToken cancellationToken) [0x00043] in <6649516e5b3542319fb262b421af0adb>:0 
  at System.Threading.Tasks.Task.Wait () [0x00000] in <6649516e5b3542319fb262b421af0adb>:0 
  at Cake.Scripting.Roslyn.RoslynScriptSession.Execute (Cake.Core.Scripting.Script script) [0x001a7] in <52bc22bce5254240ba373b3cf23da1ab>:0 
  at Cake.Core.Scripting.ScriptRunner.Run (Cake.Core.Scripting.IScriptHost host, Cake.Core.IO.FilePath scriptPath, System.Collections.Generic.IDictionary`2[TKey,TValue] arguments) [0x00358] in <1a12afcf649f4de8ab5d15d82d4f6310>:0 
  at Cake.Commands.BuildCommand.Execute (Cake.CakeOptions options) [0x0003f] in <52bc22bce5254240ba373b3cf23da1ab>:0 
  at Cake.CakeApplication.Run (Cake.CakeOptions options) [0x00015] in <52bc22bce5254240ba373b3cf23da1ab>:0 
  at Cake.Program.Main () [0x000d1] in <52bc22bce5254240ba373b3cf23da1ab>:0 
---> (Inner Exception #0) Cake.Core.CakeException: Octo: Could not locate executable.
  at Cake.Core.Tooling.Tool`1[TSettings].RunProcess (TSettings settings, Cake.Core.IO.ProcessArgumentBuilder arguments, Cake.Core.IO.ProcessSettings processSettings) [0x00071] in <1a12afcf649f4de8ab5d15d82d4f6310>:0 
  at Cake.Core.Tooling.Tool`1[TSettings].Run (TSettings settings, Cake.Core.IO.ProcessArgumentBuilder arguments, Cake.Core.IO.ProcessSettings processSettings, System.Action`1[T] postAction) [0x0001c] in <1a12afcf649f4de8ab5d15d82d4f6310>:0 
  at Cake.Core.Tooling.Tool`1[TSettings].Run (TSettings settings, Cake.Core.IO.ProcessArgumentBuilder arguments) [0x00000] in <1a12afcf649f4de8ab5d15d82d4f6310>:0 
  at Cake.Common.Tools.OctopusDeploy.OctopusDeployPacker.Pack (System.String id, Cake.Common.Tools.OctopusDeploy.OctopusPackSettings settings) [0x00017] in <d84cb7ae67bd4bf69897adf81e34714b>:0 
  at Cake.Common.Tools.OctopusDeploy.OctopusDeployAliases.OctoPack (Cake.Core.ICakeContext context, System.String id, Cake.Common.Tools.OctopusDeploy.OctopusPackSettings settings) [0x00039] in <d84cb7ae67bd4bf69897adf81e34714b>:0 
  at Submission#0.OctoPack (System.String id, Cake.Common.Tools.OctopusDeploy.OctopusPackSettings settings) [0x0000c] in <dba5a7c70e1f4221b4db7847fb712bc6>:0 
  at Submission#0.<<Initialize>>b__0_2 (RiksTV.Cake.BuildContext context) [0x0006b] in <dba5a7c70e1f4221b4db7847fb712bc6>:0 
  at Cake.Core.CakeTaskBuilderExtensions+<>c__DisplayClass18_0`1[TData].<Does>b__0 (Cake.Core.ICakeContext context, TData data) [0x00000] in <1a12afcf649f4de8ab5d15d82d4f6310>:0 
  at Cake.Core.CakeTaskBuilderExtensions+<>c__DisplayClass23_0`1[TData].<Does>b__0 (Cake.Core.ICakeContext context) [0x0000c] in <1a12afcf649f4de8ab5d15d82d4f6310>:0 
  at Cake.Core.CakeTaskBuilderExtensions+<>c__DisplayClass20_0.<Does>b__0 (Cake.Core.ICakeContext x) [0x00000] in <1a12afcf649f4de8ab5d15d82d4f6310>:0 
  at Cake.Core.CakeTask.Execute (Cake.Core.ICakeContext context) [0x00066] in <1a12afcf649f4de8ab5d15d82d4f6310>:0 
  at Cake.Core.DefaultExecutionStrategy.ExecuteAsync (Cake.Core.CakeTask task, Cake.Core.ICakeContext context) [0x000ee] in <1a12afcf649f4de8ab5d15d82d4f6310>:0 
  at Cake.Core.CakeEngine.ExecuteTaskAsync (Cake.Core.ICakeContext context, Cake.Core.IExecutionStrategy strategy, System.Diagnostics.Stopwatch stopWatch, Cake.Core.CakeTask task, Cake.Core.CakeReport report) [0x00131] in <1a12afcf649f4de8ab5d15d82d4f6310>:0 
  at Cake.Core.CakeEngine.RunTask (Cake.Core.ICakeContext context, Cake.Core.IExecutionStrategy strategy, Cake.Core.CakeTask task, System.String target, System.Diagnostics.Stopwatch stopWatch, Cake.Core.CakeReport report) [0x00124] in <1a12afcf649f4de8ab5d15d82d4f6310>:0 
  at Cake.Core.CakeEngine.RunTargetAsync (Cake.Core.ICakeContext context, Cake.Core.IExecutionStrategy strategy, Cake.Core.ExecutionSettings settings) [0x00338] in <1a12afcf649f4de8ab5d15d82d4f6310>:0 
  at Cake.Scripting.BuildScriptHost.RunTargetAsync (System.String target) [0x0009f] in <52bc22bce5254240ba373b3cf23da1ab>:0 
  at Cake.Core.Scripting.ScriptHost.RunTarget (System.String target) [0x0000d] in <1a12afcf649f4de8ab5d15d82d4f6310>:0 
  at Submission#0+<<Initialize>>d__0.MoveNext () [0x00122] in <dba5a7c70e1f4221b4db7847fb712bc6>:0 
  at Microsoft.CodeAnalysis.Scripting.ScriptExecutionState.RunSubmissionsAsync[TResult] (System.Collections.Immutable.ImmutableArray`1[T] precedingExecutors, System.Func`2[T,TResult] currentExecutor, System.Runtime.CompilerServices.StrongBox`1[T] exceptionHolderOpt, System.Func`2[T,TResult] catchExceptionOpt, System.Threading.CancellationToken cancellationToken) [0x00186] in <3ee4bd870c1146d59b98317e4bbdcbe8>:0 
  at Microsoft.CodeAnalysis.Scripting.Script`1[T].RunSubmissionsAsync (Microsoft.CodeAnalysis.Scripting.ScriptExecutionState executionState, System.Collections.Immutable.ImmutableArray`1[T] precedingExecutors, System.Func`2[T,TResult] currentExecutor, System.Func`2[T,TResult] catchExceptionOpt, System.Threading.CancellationToken cancellationToken) [0x000a8] in <3ee4bd870c1146d59b98317e4bbdcbe8>:0 <---

@gep13

This comment has been minimized.

Copy link
Member

commented Apr 24, 2019

@trondhindenes this is very strange...

Looking at the code, both aliases are using the exact same tool inheritance, so both should be resolving the same executables.

How are you getting Octo.exe on the build agent?

@trondhindenes

This comment has been minimized.

Copy link
Author

commented Apr 24, 2019

we use tools/packages.config to install octopustools

@gep13

This comment has been minimized.

Copy link
Member

commented Apr 24, 2019

Are you pinned to a specific version? Just asking, as there seems to have been some changes lately to that package on nuget.org.

@trondhindenes

This comment has been minimized.

Copy link
Author

commented Apr 24, 2019

I've tested with both 5.2.0 and 6.0.x

@trondhindenes

This comment has been minimized.

Copy link
Author

commented Apr 24, 2019

update: I must have had some weird artifact in my build. Setting the toolpath does indeed fix the problem. Multiple devs stared at this for several hours, so this can be closed.

That said, it would be good if cake did a better job at producing humane error messages when it failed. For example, printing out the attempted resolved paths to tool exe's would be a huge help. The stacktrace it produces is incredibly hard to make sense of.

It would also be good if it was documented what path the tool is expected to be in, that would have helped us track this down.

@gep13

This comment has been minimized.

Copy link
Member

commented Apr 25, 2019

@trondhindenes the way that tools are resolved is documented here:

https://cakebuild.net/docs/tools/tool-resolution

We would welcome any help that you could offer in terms of documenting this better, or providing additional output when resolution fails.

@nilsgs

This comment has been minimized.

Copy link
Contributor

commented Apr 25, 2019

I'm experiencing the same issue when running on Linux in GitLab. Using Cake v0.33.0 and OctopusTools v6.3.1. I have no problems locally on Windows.

This is when running OctoCreateRelease.

@nilsgs

This comment has been minimized.

Copy link
Contributor

commented Apr 25, 2019

Update: I tried to successively to downgrade Cake. And the problem went away when I reached v0.30.0.

@nilsgs

This comment has been minimized.

Copy link
Contributor

commented Apr 25, 2019

In 461155d you consolidated all the Octopus tools and defined the executable as octo.exe, but it's actually Octo.exe. With Linux being case sensitive, this will not work.

@gep13

This comment has been minimized.

Copy link
Member

commented Apr 25, 2019

@nilsgs hmm, that would indeed be part of the problem, but that wouldn't explain why one alias worked for @trondhindenes but another didn't.

@gep13 gep13 added the Bug label Apr 25, 2019
@nilsgs

This comment has been minimized.

Copy link
Contributor

commented Apr 25, 2019

Well, I'm not sure if @trondhindenes can be 100% on the configuration he was running at the time this occurred*. So I'm willing to write this off as a false negative.

*I'm working with Trond so I know the level of despair he was in when trying to figure this out.

@gep13

This comment has been minimized.

Copy link
Member

commented Apr 25, 2019

@nilsgs said...
*I'm working with Trond so I know the level of despair he was in when trying to figure this out.

Understood. Are either of you in a position to send a PR to correct this?

@nilsgs

This comment has been minimized.

Copy link
Contributor

commented Apr 25, 2019

I can send a PR. It would basically only be changing one char right?

@gep13

This comment has been minimized.

Copy link
Member

commented Apr 25, 2019

@nilsgs said...
I can send a PR. It would basically only be changing one char right?

A single char in multiple places, yes 😄

@trondhindenes

This comment has been minimized.

Copy link
Author

commented Apr 25, 2019

@nilsgs the nerve!!

@trondhindenes

This comment has been minimized.

Copy link
Author

commented Apr 25, 2019

@gep13

but that wouldn't explain why one alias worked

Lets write that off as a false negative. Multiple things was going on.

@devlead devlead added this to the v0.34.0 milestone Apr 30, 2019
@devlead

This comment has been minimized.

Copy link
Member

commented Apr 30, 2019

Fixed by #2538

@devlead devlead closed this Apr 30, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.