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

Missing resilience? #13540

Closed
bstordrup opened this issue Jun 12, 2024 · 6 comments
Closed

Missing resilience? #13540

bstordrup opened this issue Jun 12, 2024 · 6 comments
Labels
Functionality:Push Resolution:NeedMoreInfo This issue appears to not have enough info to take action Triage:NeedsMoreInfo Type:Bug WaitingForCustomer Applied when a NuGet triage person needs more info from the OP

Comments

@bstordrup
Copy link

NuGet Product Used

NuGet.exe

Product Version

nuget 6.11.0.64

Worked before?

No response

Impact

It's more difficult to complete my work

Repro Steps & Context

Sometimes, I get this error when running nuget push:

Error getting pkg from body: unable to open nuspec file from nupkg archive: zip: not a valid zip file

Then I can issue the exact same nuget push command again, and it succeeds without the error, and the package is pushed.

It most often happen if the commands get executed too soon after each other - for example in a PowerShell script that pushes a series of nupkg's.

I suspect that there is some kind of resilience issue involved.

Verbose Logs

Output from two subsequent runs:


PS C:\LocalStorage\Visma.Services.UserDirectory.Diagnostics> nuget push Visma.Services.UserDirectory.Diagnostics.18.0.0.4.nupkg -source https://nuget.pkg.github.com/MyGitOrganization/index.json -ApiKey ********************************
Pushing Visma.Services.UserDirectory.Diagnostics.18.0.0.4.nupkg to 'https://nuget.pkg.github.com/MyGitOrganization'...
  PUT https://nuget.pkg.github.com/MyGitOrganization/
WARNING: Error getting pkg from body: unable to open nuspec file from nupkg archive: zip: not a valid zip file
  BadRequest https://nuget.pkg.github.com/MyGitOrganization/ 384ms
Response status code does not indicate success: 400 (Bad Request).
PS C:\LocalStorage\Visma.Services.UserDirectory.Diagnostics> nuget push Visma.Services.UserDirectory.Diagnostics.18.0.0.4.nupkg -source https://nuget.pkg.github.com/MyGitOrganization/index.json -ApiKey ********************************
Pushing Visma.Services.UserDirectory.Diagnostics.18.0.0.4.nupkg to 'https://nuget.pkg.github.com/MyGitOrganization'...
  PUT https://nuget.pkg.github.com/MyGitOrganization/
  OK https://nuget.pkg.github.com/MyGitOrganization/ 726ms
Your package was pushed.
@bstordrup
Copy link
Author

Digging further in to this by debugging from the NuGet.Client solution, I see that the issue can be in two places:

  • Server side with wrong handling of the package being pushed. The package repository I'm pushing to, is a GitHub packages repository.
  • Client side with the creation of the HttpRequestMessage body creation. That it does not copy the package correctly into the body.

Funny thing is that if I open the file I'm trying to push, it works fine. I can see the nuspec file just fine. And several similar packages being other versions of the same component are pushed as expected.

@bstordrup
Copy link
Author

Additional info. Tried to push the package with -DisableBuffering parameter applied. There was no issue with the pulled package afterwards.

But I also did it from a Nuget.Commandline version been run from Visual Studio where I made a change to provide credentials when needed instead of providing it in Console window.

@nkolev92
Copy link
Member

Hey @bstordrup

The WARNING: part gives me a hint that this is a warning coming from the server.
I think this is likely a GitHub Package Registry issue. The fact that it's an issue when there's multiple successive pushes is a further indicator as well.

Have you faced this issue with any other package registry?
Have you attempted dotnet nuget push? I don't expect it to make a difference, but just covering the basis.

@nkolev92 nkolev92 added Functionality:Push Triage:NeedsMoreInfo WaitingForCustomer Applied when a NuGet triage person needs more info from the OP and removed Triage:Untriaged labels Jun 18, 2024
@bstordrup
Copy link
Author

Hi @nkolev92

I did not try the dotnet nuget push.

The fact that the issue is completely gone with the -DisableBuffering parameter applied (also on calling nuget.exe from command line) makes me believe it is an issue connected to doing buffering in connection with an authenticated repository - which is the case for GitHub Packages.

But I cannot put a finger on what and where the issue is.

@dotnet-policy-service dotnet-policy-service bot added WaitingForClientTeam Customer replied, needs attention from client team. Do not apply this label manually. and removed WaitingForCustomer Applied when a NuGet triage person needs more info from the OP labels Jun 19, 2024
@nkolev92
Copy link
Member

Thanks for the quick response.

The fact that we haven't seen a lot of this, makes me think there are more likely issues server side than client side.

@dotnet-policy-service dotnet-policy-service bot added WaitingForCustomer Applied when a NuGet triage person needs more info from the OP and removed WaitingForClientTeam Customer replied, needs attention from client team. Do not apply this label manually. labels Jun 19, 2024
@dotnet-policy-service dotnet-policy-service bot added the Status:No recent activity No recent activity. label Jul 4, 2024
Copy link
Contributor

This issue has been automatically marked as stale because we have not received a response in 14 days. It will be closed if no further activity occurs within another 14 days of this comment.

@dotnet-policy-service dotnet-policy-service bot added Resolution:NeedMoreInfo This issue appears to not have enough info to take action and removed Status:No recent activity No recent activity. labels Jul 18, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Functionality:Push Resolution:NeedMoreInfo This issue appears to not have enough info to take action Triage:NeedsMoreInfo Type:Bug WaitingForCustomer Applied when a NuGet triage person needs more info from the OP
Projects
None yet
Development

No branches or pull requests

2 participants