renevanosnabrugge / vsts-promotepackage-task

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

[error]Cannot bind argument to parameter 'Path' because it is null at selfhosted agent #45

Closed note-do closed 3 years ago

note-do commented 4 years ago
2020-02-16T12:58:39.2328778Z ##[section]Starting: Promote to Prerelease
2020-02-16T12:58:39.2448778Z ==============================================================================
2020-02-16T12:58:39.2448778Z Task         : Promote package to Release View
2020-02-16T12:58:39.2448778Z Description  : Promotes a package to a Release View in VSTS Package Management
2020-02-16T12:58:39.2448778Z Version      : 3.0.2
2020-02-16T12:58:39.2448778Z Author       : Rene van Osnabrugge
2020-02-16T12:58:39.2448778Z Help         : Version: 3.0.2. [More Information](https://github.com/renevanosnabrugge/vsts-promotepackage-task/wiki)
2020-02-16T12:58:39.2448778Z ==============================================================================
2020-02-16T12:58:40.5108778Z Promoting package(s) by reading metadata from package file(s) matching pattern '**/*.nupkg !**/*.symbols.nupkg' from root directory 'C:\agent\_work\28\a'
2020-02-16T12:58:40.9158778Z Matching paths found:
2020-02-16T12:58:40.9158778Z C:\agent\_work\28\a\NeosyntezApiClient.1.0.0-CI-20200216-125819.nupkg C:\agent\_work\28\a\NeosyntezApiClient.AutofacModule.1.0.0-CI-20200216-125819.nupkg C:\agent\_work\28\a\NeosyntezApiClient.Domain.1.0.0-CI-20200216-125819.nupkg
2020-02-16T12:58:41.0938778Z ##[error]Cannot bind argument to parameter 'Path' because it is null.
2020-02-16T12:58:41.1358778Z ##[section]Finishing: Promote to Prerelease

The yml task is

- task: rvo-vsts-promotepackage-task@3
  displayName: Promote to Prerelease
  inputs:
    feed: 'Martinov_NugetService'
    inputType: 'packageFiles'
    packagesDirectory: '$(Build.ArtifactStagingDirectory)'
    packagesPattern: |
      **/*.nupkg
      !**/*.symbols.nupkg
    releaseView: 'e35d64ae-f9db-4fc4-a9ad-b1b71b572826'

How can I avoid the error?

note-do commented 4 years ago

Maybe it's connected with #44 I cannot get feed id with pipeline designer - only feed name. I found a workaround - get feed id with another task (dotnet push task). But it still doesn't work. I use self hosted agent. This issue has been discussed at the end of dialog in #42

note-do commented 4 years ago

When I change agent pool to Azure Pipelines (Cloud hosted) all work fine. Are there any specific requirements for this task on windows hosted agent?

jessehouwing commented 4 years ago

Always provide logs in "Diagnostics Mode" it gives a much better idea of where exactly the build failed.

mtherien commented 4 years ago

I am having the same problem. Any updates on this?

Always provide logs in "Diagnostics Mode" it gives a much better idea of where exactly the build failed.

I do not know what "Diagnostics Mode" is...

My guess is this is occurring when the nupkg is un-zipped.

jessehouwing commented 4 years ago

When manually queueing a build, there is a 'enable diagnostics' checkbox at the bottom to generate way more detailed log files.

On Tue, Sep 1, 2020, 22:58 Mike Therien notifications@github.com wrote:

I am having the same problem. Any updates on this?

Always provide logs in "Diagnostics Mode" it gives a much better idea of where exactly the build failed.

I do not know what "Diagnostics Mode" is...

My guess is this is occurring when the nupkg is un-zipped.

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

mtherien commented 4 years ago

When manually queueing a build, there is a 'enable diagnostics' checkbox at the bottom to generate way more detailed log files.

I receive this error in a release pipeline. Can you do the same with releases?

jessehouwing commented 4 years ago

set variables for your release stage with:

agent.diagnostics=true
system.debug=true
mtherien commented 4 years ago

That was a big help @jessehouwing , Thanks!

Attached is the log. Looks like it's failing on Remove-Item, not sure why.

PromoteError.txt

mtherien commented 4 years ago

We discovered our build agent was running on Windows Server 2016, which had Powershell 4 installed. After moving to a build agent on a Windows Server 2019 server it worked.

The call to create a temporary file did not exist until Powershell 5.