renevanosnabrugge / vsts-promotepackage-task

Promote a package in VSTS to a Release View
MIT License
21 stars 25 forks source link

Task suddenly started failing with an error #64

Open jmezach opened 3 years ago

jmezach commented 3 years ago

Starting today we're seeing our pipelines fail due to an error being generated from this task. The error message is Cannot bind argument to parameter 'Path' because it is null.. We believe that this might be related to #63. Here's a full stack trace of the error:

##[debug]Caught exception from task script.
##[debug]Error record:
##[debug]D:\a\_tasks\rvo-vsts-promotepackage-task_7ca5869f-a901-4012-a50d-d0f9d436ffec\3.0.8\vsts-promotepackage-task.ps1 : Cannot bind argument to parameter 'Path' because it is null.
##[debug]At line:1 char:1
##[debug]+ . 'D:\a\_tasks\rvo-vsts-promotepackage-task_7ca5869f-a901-4012-a50d-d ...
##[debug]+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
##[debug]    + CategoryInfo          : InvalidData: (:) [vsts-promotepackage-task.ps1], ParameterBindingValidationException
##[debug]    + FullyQualifiedErrorId : ParameterArgumentValidationErrorNullNotAllowed,vsts-promotepackage-task.ps1
##[debug] 
##[debug]Script stack trace:
##[debug]at Get-NuGetPackageMetadata, D:\a\_tasks\rvo-vsts-promotepackage-task_7ca5869f-a901-4012-a50d-d0f9d436ffec\3.0.8\vsts-promotepackage-task.ps1: line 253
##[debug]at Get-PackageMetadata, D:\a\_tasks\rvo-vsts-promotepackage-task_7ca5869f-a901-4012-a50d-d0f9d436ffec\3.0.8\vsts-promotepackage-task.ps1: line 281
##[debug]at Run, D:\a\_tasks\rvo-vsts-promotepackage-task_7ca5869f-a901-4012-a50d-d0f9d436ffec\3.0.8\vsts-promotepackage-task.ps1: line 322
##[debug]at <ScriptBlock>, D:\a\_tasks\rvo-vsts-promotepackage-task_7ca5869f-a901-4012-a50d-d0f9d436ffec\3.0.8\vsts-promotepackage-task.ps1: line 329
##[debug]at <ScriptBlock>, <No file>: line 1
##[debug]at <ScriptBlock>, <No file>: line 22
##[debug]at <ScriptBlock>, <No file>: line 18
##[debug]at <ScriptBlock>, <No file>: line 1
##[debug]Exception:
##[debug]System.Management.Automation.ParameterBindingValidationException: Cannot bind argument to parameter 'Path' because it is null.
##[debug]   at System.Management.Automation.ExceptionHandlingOps.CheckActionPreference(FunctionContext funcContext, Exception exception)
##[debug]   at System.Management.Automation.Interpreter.ActionCallInstruction`2.Run(InterpretedFrame frame)
##[debug]   at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
##[debug]   at System.Management.Automation.Interpreter.EnterTryCatchFinallyInstruction.Run(InterpretedFrame frame)
##[debug]   at System.Management.Automation.Interpreter.Interpreter.Run(InterpretedFrame frame)
##[debug]   at System.Management.Automation.Interpreter.LightLambda.RunVoid1[T0](T0 arg0)
##[debug]   at System.Management.Automation.PSScriptCmdlet.RunClause(Action`1 clause, Object dollarUnderbar, Object inputToProcess)
##[debug]   at System.Management.Automation.PSScriptCmdlet.DoEndProcessing()
##[debug]   at System.Management.Automation.CommandProcessorBase.Complete()
##[error]Cannot bind argument to parameter 'Path' because it is null.
##[debug]Processed: ##vso[task.logissue type=error]Cannot bind argument to parameter 'Path' because it is null.
##[debug]Processed: ##vso[task.complete result=Failed]

We also made some changes to our pipelines recently so we first thought it had to do with our changes but we didn't change anything related to this task so now we're thinking it might have regressed. Any idea what's going on here?

jessehouwing commented 3 years ago

Would be my guess... I'll check it out tonight.

dannyBies commented 3 years ago

As a workaround we explicitly use version 3.0.4 instead of the latest (3.0.8).

engfer commented 3 years ago

As a workaround we explicitly use version 3.0.4 instead of the latest (3.0.8).

How did you explicitly set that if using ADO service?

jmezach commented 3 years ago

@engfer That's now possible due to a recent update on Azure DevOps: https://docs.microsoft.com/en-us/azure/devops/release-notes/2020/sprint-175-update#control-over-automated-task-updates-from-marketplace

engfer commented 3 years ago

Ahh, but we are using it in a release pipeline, so not sure I can specify that there :(

jmezach commented 3 years ago

@engfer Hmm, yeah, I guess that only works for YAML pipelines at the moment.

jessehouwing commented 3 years ago

Try 'tfx build task delete' to delete the version that doesn't work for you.

For some reason the task returns null for the a temporary file name when running in the agent. The same code executes fine from the console...

Now time for family dinner, then more time to understand what's going on.

On Fri, Sep 18, 2020, 16:33 Jonathan Mezach notifications@github.com wrote:

@engfer https://github.com/engfer Hmm, yeah, I guess that only works for YAML pipelines at the moment.

— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/renevanosnabrugge/vsts-promotepackage-task/issues/64#issuecomment-694904754, or unsubscribe https://github.com/notifications/unsubscribe-auth/AA724S4J5NPFDESUJSJHZSTSGNVTBANCNFSM4RR4TOLQ .

japj commented 3 years ago

It looks like the task might use a (new) powershell 7 api and thus needs to be executed differently on azure devops https://stackoverflow.com/questions/63630461/not-able-to-execute-powershell-7-scripts-parallelly-on-devops, that might also explain why it “works” locally: try locally running in powershell 5.1?