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

Zip Archive creation is attempted when no files are signed #157

Open
6 tasks done
AdmiringWorm opened this issue May 23, 2024 · 0 comments
Open
6 tasks done

Zip Archive creation is attempted when no files are signed #157

AdmiringWorm opened this issue May 23, 2024 · 0 comments
Labels
0 - _Triaging Issue is accepted, but a milestone has yet to be added for the issue Bug Issues where something has happened which was not expected or intended

Comments

@AdmiringWorm
Copy link
Member

Checklist

  • I confirm there are no unresolved issues reported on the Chocolatey Status page.
  • I have verified this is the correct repository for opening this issue.
  • I have verified no other issues exist related to my problem.
  • I have verified this is not an issue for a specific package.
  • I have verified this issue is not security related.
  • I confirm I am using official, and not unofficial, or modified, Chocolatey products.

What You Are Seeing?

When we are running signing of the PowerShell scripts, and there are no files that needs to be resigned, a zip archive is still being attempted to be created.

This causes an error to occur, and any build is marked as a failure.

What is Expected?

When there are no files that have been resigned/signed, we should not attempt to create a new zip archive artifact.

How Did You Get This To Happen?

  1. Run resigning on our internal build provider for a project all up to date.

System Details

  • Chocolatey Cake Recipe Version: 0.28.4

Installed Packages

N/A

Output Log

An error occurred when executing task 'Sign-PowerShellScripts'.
12:14:30   An error occurred when executing task 'Sign-PowerShellScripts'.
12:14:30   ----------------------------------------
12:14:30   Teardown
12:14:30   ----------------------------------------
12:14:30   Starting Teardown...
12:14:30   Finished running tasks.
12:14:30   Error: System.AggregateException: One or more errors occurred. ---> System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\buildAgent\work\ca903c6cab03670c\code_drop\SignedFiles\SignedFiles.zip'.
12:14:30      at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
12:14:30      at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
12:14:30      at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
12:14:30      at System.IO.FileInfo.Open(FileMode mode, FileAccess access, FileShare share)
12:14:30      at Cake.Common.IO.Zipper.Zip(DirectoryPath rootPath, FilePath outputPath, IEnumerable`1 filePaths)
12:14:30      at Submission#0.Zip(DirectoryPath rootPath, FilePath outputPath, IEnumerable`1 filePaths) in :line 2435
12:14:30      at Submission#0.<<Initialize>>b__0_107() in C:\buildAgent\work\ca903c6cab03670c\tools\Chocolatey.Cake.Recipe.0.28.4\Content\sign.cake:line 102
12:14:30      at Cake.Core.CakeTaskBuilderExtensions.<>c__DisplayClass32_0.<Does>b__0(ICakeContext x)
12:14:30      at Cake.Core.CakeTask.<Execute>d__43.MoveNext()
12:14:30   --- End of stack trace from previous location where exception was thrown ---
12:14:30      at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
12:14:30      at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
12:14:30      at Cake.Core.DefaultExecutionStrategy.<ExecuteAsync>d__4.MoveNext()
12:14:30   --- End of stack trace from previous location where exception was thrown ---
12:14:30      at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
12:14:30      at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
12:14:30      at Cake.Core.CakeEngine.<ExecuteTaskAsync>d__31.MoveNext()
12:14:30   --- End of stack trace from previous location where exception was thrown ---
12:14:30      at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
12:14:30      at Cake.Core.CakeEngine.<ExecuteTaskAsync>d__31.MoveNext()
12:14:30   --- End of stack trace from previous location where exception was thrown ---
12:14:30      at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
12:14:30      at Cake.Core.CakeEngine.<ExecuteTaskAsync>d__31.MoveNext()
12:14:30   --- End of stack trace from previous location where exception was thrown ---
12:14:30      at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
12:14:30      at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
12:14:30      at Cake.Core.CakeEngine.<RunTask>d__28.MoveNext()
12:14:30   --- End of stack trace from previous location where exception was thrown ---
12:14:30      at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
12:14:30      at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
12:14:30      at Cake.Core.CakeEngine.<RunTargetAsync>d__27.MoveNext()
12:14:30   --- End of stack trace from previous location where exception was thrown ---
12:14:30      at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
12:14:30      at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
12:14:30      at Cake.Scripting.BuildScriptHost.<RunTargetAsync>d__3.MoveNext()
12:14:30   --- End of stack trace from previous location where exception was thrown ---
12:14:30      at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
12:14:30      at Cake.Core.Scripting.ScriptHost.RunTarget(String target)
12:14:30      at Submission#0.<get_Build>b__836_0(String target) in C:\buildAgent\work\ca903c6cab03670c\tools\Chocolatey.Cake.Recipe.0.28.4\Content\build.cake:line 531
12:14:30      at Submission#0.Builder.RunDotNet() in C:\buildAgent\work\ca903c6cab03670c\tools\Chocolatey.Cake.Recipe.0.28.4\Content\build.cake:line 559
12:14:30      at Submission#0.<<Initialize>>d__0.MoveNext() in C:\buildAgent\work\ca903c6cab03670c\recipe.cake:line 394
12:14:30   --- End of stack trace from previous location where exception was thrown ---
12:14:30      at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
12:14:30      at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
12:14:30      at Microsoft.CodeAnalysis.Scripting.ScriptExecutionState.<RunSubmissionsAsync>d__9`1.MoveNext()
12:14:30   --- End of stack trace from previous location where exception was thrown ---
12:14:30      at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
12:14:30      at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
12:14:30      at Microsoft.CodeAnalysis.Scripting.Script`1.<RunSubmissionsAsync>d__21.MoveNext()
12:14:30      --- End of inner exception stack trace ---
12:14:30      at System.Threading.Tasks.Task.ThrowIfExceptional(Boolean includeTaskCanceledExceptions)
12:14:30      at System.Threading.Tasks.Task.Wait(Int32 millisecondsTimeout, CancellationToken cancellationToken)
12:14:30      at Cake.Scripting.Roslyn.RoslynScriptSession.Execute(Script script)
12:14:30      at Cake.Core.Scripting.ScriptRunner.Run(IScriptHost host, FilePath scriptPath, IDictionary`2 arguments)
12:14:30      at Cake.Commands.BuildCommand.Execute(CakeOptions options)
12:14:30      at Cake.CakeApplication.Run(CakeOptions options)
12:14:30      at Cake.Program.Main()
12:14:30   ---> (Inner Exception #0) System.IO.DirectoryNotFoundException: Could not find a part of the path 'C:\buildAgent\work\ca903c6cab03670c\code_drop\SignedFiles\SignedFiles.zip'.
12:14:30      at System.IO.__Error.WinIOError(Int32 errorCode, String maybeFullPath)
12:14:30      at System.IO.FileStream.Init(String path, FileMode mode, FileAccess access, Int32 rights, Boolean useRights, FileShare share, Int32 bufferSize, FileOptions options, SECURITY_ATTRIBUTES secAttrs, String msgPath, Boolean bFromProxy, Boolean useLongPath, Boolean checkHost)
12:14:30      at System.IO.FileStream..ctor(String path, FileMode mode, FileAccess access, FileShare share)
12:14:30      at System.IO.FileInfo.Open(FileMode mode, FileAccess access, FileShare share)
12:14:30      at Cake.Common.IO.Zipper.Zip(DirectoryPath rootPath, FilePath outputPath, IEnumerable`1 filePaths)
12:14:30      at Submission#0.Zip(DirectoryPath rootPath, FilePath outputPath, IEnumerable`1 filePaths) in :line 2435
12:14:30      at Submission#0.<<Initialize>>b__0_107() in C:\buildAgent\work\ca903c6cab03670c\tools\Chocolatey.Cake.Recipe.0.28.4\Content\sign.cake:line 102
12:14:30      at Cake.Core.CakeTaskBuilderExtensions.<>c__DisplayClass32_0.<Does>b__0(ICakeContext x)
12:14:30      at Cake.Core.CakeTask.<Execute>d__43.MoveNext()
12:14:30   --- End of stack trace from previous location where exception was thrown ---
12:14:30      at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
12:14:30      at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
12:14:30      at Cake.Core.DefaultExecutionStrategy.<ExecuteAsync>d__4.MoveNext()
12:14:30   --- End of stack trace from previous location where exception was thrown ---
12:14:30      at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
12:14:30      at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
12:14:30      at Cake.Core.CakeEngine.<ExecuteTaskAsync>d__31.MoveNext()
12:14:30   --- End of stack trace from previous location where exception was thrown ---
12:14:30      at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
12:14:30      at Cake.Core.CakeEngine.<ExecuteTaskAsync>d__31.MoveNext()
12:14:30   --- End of stack trace from previous location where exception was thrown ---
12:14:30      at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
12:14:30      at Cake.Core.CakeEngine.<ExecuteTaskAsync>d__31.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
12:14:30      at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
12:14:30      at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
12:14:30      at Cake.Core.CakeEngine.<RunTask>d__28.MoveNext()
12:14:30   --- End of stack trace from previous location where exception was thrown ---
12:14:30      at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
12:14:30      at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
12:14:30      at Cake.Core.CakeEngine.<RunTargetAsync>d__27.MoveNext()
12:14:30   --- End of stack trace from previous location where exception was thrown ---
12:14:30      at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
12:14:30      at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
12:14:30      at Cake.Scripting.BuildScriptHost.<RunTargetAsync>d__3.MoveNext()
12:14:30   --- End of stack trace from previous location where exception was thrown ---
12:14:30      at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
12:14:30      at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
12:14:30      at Cake.Core.Scripting.ScriptHost.RunTarget(String target)
12:14:30      at Submission#0.<get_Build>b__836_0(String target) in C:\buildAgent\work\ca903c6cab03670c\tools\Chocolatey.Cake.Recipe.0.28.4\Content\build.cake:line 531
12:14:30      at Submission#0.Builder.RunDotNet() in C:\buildAgent\work\ca903c6cab03670c\tools\Chocolatey.Cake.Recipe.0.28.4\Content\build.cake:line 559
12:14:30      at Submission#0.<<Initialize>>d__0.MoveNext() in C:\buildAgent\work\ca903c6cab03670c\recipe.cake:line 394
12:14:30   --- End of stack trace from previous location where exception was thrown ---
12:14:30      at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
12:14:30      at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
12:14:30      at Microsoft.CodeAnalysis.Scripting.ScriptExecutionState.<RunSubmissionsAsync>d__9`1.MoveNext()
12:14:30   --- End of stack trace from previous location where exception was thrown ---
12:14:30      at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
12:14:30      at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
12:14:30      at Microsoft.CodeAnalysis.Scripting.Script`1.<RunSubmissionsAsync>d__21.MoveNext()<---
12:14:30   
12:14:30   ==================================================
12:14:30   Process exited with code 0
12:14:30   Step Call Cake (Command Line) failed

Additional Context

Only a small section of the log file is included, as other items contain internal values.

@AdmiringWorm AdmiringWorm added Bug Issues where something has happened which was not expected or intended 0 - _Triaging Issue is accepted, but a milestone has yet to be added for the issue labels May 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
0 - _Triaging Issue is accepted, but a milestone has yet to be added for the issue Bug Issues where something has happened which was not expected or intended
Projects
None yet
Development

No branches or pull requests

1 participant