renevanosnabrugge / vsts-promotepackage-task

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

Promote failing for NuGet package just published in the same job #51

Closed almguru closed 4 years ago

almguru commented 4 years ago

I have NuGet push task followed by promote task. Both using same .nupkg file and promotion is failed. I validated that package is in the feed.

The error is:

[error]Package XXXX could not be found

Appreciate if you can provide any caveats for troubleshooting.

jessehouwing commented 4 years ago

I think this has been resolved with #55

almguru commented 4 years ago

Great, thanks. Looks like this should solve the problem.

jessehouwing commented 4 years ago

Can you share a reproducible YAML file?

On Sun, May 17, 2020, 18:54 Vladimir Gusarov notifications@github.com wrote:

I validated using 5.0.3 version. it still fails. It went further and now fails on actual promotion. What is suspicious that logs says it was -1 byte payload for PATCH operation:

2020-05-17T16:44:32.5585207Z https://pkgs.dev.azure.com/1id/_apis/packaging/feeds/14be0141-d6b1-4ad8-bab5-d6ca72f9cb50/NuGet/packages/passwordmanager.passwordpolicymanager/versions/5.9.4-package-promotion.1%2b2?api-version=5.0-preview.1 2020-05-17T16:44:32.6471987Z ##[debug]PATCH https://pkgs.dev.azure.com/1id/_apis/packaging/feeds/14be0141-d6b1-4ad8-bab5-d6ca72f9cb50/NuGet/packages/passwordmanager.passwordpolicymanager/versions/5.9.4-package-promotion.1+2?api-version=5.0-preview.1 with -1-byte payload 2020-05-17T16:44:32.7703839Z ##[debug]Caught exception from task script. 2020-05-17T16:44:32.7760255Z ##[debug]Error record: 2020-05-17T16:44:32.8353968Z ##[debug]Invoke-RestMethod : The remote server returned an error: (404) Not Found. 2020-05-17T16:44:32.8358125Z ##[debug]At D:\a_tasks\rvo-vsts-promotepackage-task_7ca5869f-a901-4012-a50d-d0f9d436ffec\3.0.4\vsts-promotepackage-task.ps1:162 char:17 2020-05-17T16:44:32.8359864Z ##[debug]+ ... $response = Invoke-RestMethod -Uri $releaseViewURL -Headers $requestC ... 2020-05-17T16:44:32.8364446Z ##[debug]+


2020-05-17T16:44:32.8379154Z ##[debug] + CategoryInfo : InvalidOperation:
(System.Net.HttpWebRequest:HttpWebRequest) [Invoke-RestMethod], WebExc
eption
2020-05-17T16:44:32.8394876Z ##[debug] + FullyQualifiedErrorId :
WebCmdletWebResponseException,Microsoft.PowerShell.Commands.InvokeRestMethodCommand
2020-05-17T16:44:32.8407461Z ##[debug]
2020-05-17T16:44:32.8426280Z ##[debug]Script stack trace:
2020-05-17T16:44:32.8460121Z ##[debug]at Set-PackageQuality,
D:\a_tasks\rvo-vsts-promotepackage-task_7ca5869f-a901-4012-a50d-d0f9d436ffec\3.0.4\vsts-promotepackage-task.ps1:
line 162
2020-05-17T16:44:32.8472002Z ##[debug]at Run,
D:\a_tasks\rvo-vsts-promotepackage-task_7ca5869f-a901-4012-a50d-d0f9d436ffec\3.0.4\vsts-promotepackage-task.ps1:
line 301
2020-05-17T16:44:32.8484942Z ##[debug]at ,
D:\a_tasks\rvo-vsts-promotepackage-task_7ca5869f-a901-4012-a50d-d0f9d436ffec\3.0.4\vsts-promotepackage-task.ps1:
line 307
2020-05-17T16:44:32.8496804Z ##[debug]at , : line 1
2020-05-17T16:44:32.8508406Z ##[debug]at , : line 22
2020-05-17T16:44:32.8520840Z ##[debug]at , : line 18
2020-05-17T16:44:32.8532849Z ##[debug]at , : line 1
2020-05-17T16:44:32.8553877Z ##[debug]Exception:
2020-05-17T16:44:32.8595063Z ##[debug]System.Net.WebException: The remote
server returned an error: (404) Not Found.
2020-05-17T16:44:32.8610442Z ##[debug] at
Microsoft.PowerShell.Commands.WebRequestPSCmdlet.GetResponse(WebRequest
request)
2020-05-17T16:44:32.8622631Z ##[debug] at
Microsoft.PowerShell.Commands.WebRequestPSCmdlet.ProcessRecord()
2020-05-17T16:44:32.8910035Z ##[error]The remote server returned an error:
(404) Not Found.
2020-05-17T16:44:32.8924903Z ##[debug]Processed: ##vso[task.logissue
type=error]The remote server returned an error: (404) Not Found.
2020-05-17T16:44:32.8926269Z ##[debug]Processed: ##vso[task.complete
result=Failed]
2020-05-17T16:44:32.9313664Z ##[section]Finishing: Promote NuGet packages
to Prerelease view

—
You are receiving this because you commented.
Reply to this email directly, view it on GitHub
<https://github.com/renevanosnabrugge/vsts-promotepackage-task/issues/51#issuecomment-629827955>,
or unsubscribe
<https://github.com/notifications/unsubscribe-auth/AA724S6HZKB7OHHMV74LQLLRSAJEJANCNFSM4LGPIKQQ>
.
almguru commented 4 years ago

Can you share a reproducible YAML file?

My bad, Jesse. I was using wrong versioning scheme for the branch and actually tried to promote package version that doesn't exist. So, error was pretty accurate. Changed GitVersion mode to Continuous Deployment and now everything works fine.

jessehouwing commented 4 years ago

❤️!

On Sun, May 17, 2020, 21:08 Vladimir Gusarov notifications@github.com wrote:

Can you share a reproducible YAML file? … <#m8357722989724505846>

My bad, Jesse. I was using wrong versioning scheme for the branch and actually tried to promote package version that doesn't exist. So, error was pretty accurate. Changed GitVersion mode to Continuous Deployment and now everything works fine.

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