NuGet / Home

Repo for NuGet Client issues
Other
1.49k stars 252 forks source link

[Bug]: ServiceUnavailable for slow internet connections when pushing large nuget package #11769

Closed tapika closed 2 years ago

tapika commented 2 years ago

NuGet Product Used

NuGet.exe

Product Version

NuGet Version: 6.0.0.280

Worked before?

Works on faster internet connection

Impact

I'm unable to use this version

Repro Steps & Context

Create large nuget package - size of 222 Mb - 500 Mb.

You should be behind bit slower internet connection - I'm behind optical fibre - download 100 MB/s, upload 10 MB/s.

(Upload is used in this case).

Push nuget package from your command line:

"...\tools\NuGet.CommandLine.6.0.0\tools\NuGet.exe" push largepackage.1.0.0.1.nupkg -Timeout 3600 -src <azure url>

>NuGet.exe push largepackage.1.0.0.0.nupkg -Timeout 3600 -src <azure devops url>
Pushing largepackage.1.0.0.0.nupkg to 'https://pkgs.dev.azure.com/vcomponents/_packaging/a2b3eb0c-a5a4-439a-ab6f-f4b7cae5213f/nuget/v2/'...
  PUT https://pkgs.dev.azure.com/vcomponents/_packaging/a2b3eb0c-a5a4-439a-ab6f-f4b7cae5213f/nuget/v2/
  ServiceUnavailable https://pkgs.dev.azure.com/vcomponents/_packaging/a2b3eb0c-a5a4-439a-ab6f-f4b7cae5213f/nuget/v2/ 151581ms
  PUT https://pkgs.dev.azure.com/vcomponents/_packaging/a2b3eb0c-a5a4-439a-ab6f-f4b7cae5213f/nuget/v2/
  ServiceUnavailable https://pkgs.dev.azure.com/vcomponents/_packaging/a2b3eb0c-a5a4-439a-ab6f-f4b7cae5213f/nuget/v2/ 153199ms
  PUT https://pkgs.dev.azure.com/vcomponents/_packaging/a2b3eb0c-a5a4-439a-ab6f-f4b7cae5213f/nuget/v2/
  ServiceUnavailable https://pkgs.dev.azure.com/vcomponents/_packaging/a2b3eb0c-a5a4-439a-ab6f-f4b7cae5213f/nuget/v2/ 153575ms
Response status code does not indicate success: 503 (Service Unavailable).

Independently of configured timeout transfer fails.

Same issue can be resolved by using apparently faster internet connection - same issue is reported here:

https://developercommunity.visualstudio.com/t/service-unavailable-when-pushing-nuget-package-to/867172

and here:

https://blog.johanpersson.nu/?p=4602

>> In order to solve the issue I uploaded the file to my D365FO dev machine and tried the push from there… it worked and it took only a couple of seconds… Wohoo…

nuget is also brings down whole internet - while it's traferring the file - it's interfering internet heavily.

(used speedtest.net)

image

I think this should be fixed permanently - independently how fast internet connection is - nuget push should not interfere with current internet heavily and must succeeds independently of transfer speed.

P.S. I'm developer by myself, can help you on bugfixing the problem if necessary - but main commit must come from nuget dev team.

Verbose Logs

No response

tapika commented 2 years ago

Tried to transfer same file for example via Teams - it works slowly, but works. Issue is most probably within nuget push command.

kartheekp-ms commented 2 years ago

@tapika - Will there will be any difference in the behavior when you try to push the package using dotnet nuget push. The reason I am asking is nuget.exe runs on .NET Framework 4.7.2 where as dotnet nuget push runs on .NET Core.

tapika commented 2 years ago

For dotnet command it looks identical behavior:

>dotnet nuget push largepackage.1.0.0.1.nupkg -s https://pkgs.dev.azure.com/vcomponents/_packaging/kuka-vc-collab/nuget/v3/index.json
Pushing largepackage.1.0.0.1.nupkg to 'https://pkgs.dev.azure.com/vcomponents/_packaging/a2b3eb0c-a5a4-439a-ab6f-f4b7cae5213f/nuget/v2/'...
  PUT https://pkgs.dev.azure.com/vcomponents/_packaging/a2b3eb0c-a5a4-439a-ab6f-f4b7cae5213f/nuget/v2/
  ServiceUnavailable https://pkgs.dev.azure.com/vcomponents/_packaging/a2b3eb0c-a5a4-439a-ab6f-f4b7cae5213f/nuget/v2/ 205791ms
  PUT https://pkgs.dev.azure.com/vcomponents/_packaging/a2b3eb0c-a5a4-439a-ab6f-f4b7cae5213f/nuget/v2/
error: The operation was canceled.
error:   Error while copying content to a stream.
error:   Unable to write data to the transport connection: The I/O operation has been aborted because of either a thread exit or an application request..
error:   The I/O operation has been aborted because of either a thread exit or an application request.
error:   Pushing took too long. You can change the default timeout of 300 seconds by using the --timeout <seconds> option with the push command.

I could increase timeout, but doubt it will help.

erdembayar commented 2 years ago

For dotnet command it looks identical behavior:

>dotnet nuget push largepackage.1.0.0.1.nupkg -s https://pkgs.dev.azure.com/vcomponents/_packaging/kuka-vc-collab/nuget/v3/index.json
Pushing largepackage.1.0.0.1.nupkg to 'https://pkgs.dev.azure.com/vcomponents/_packaging/a2b3eb0c-a5a4-439a-ab6f-f4b7cae5213f/nuget/v2/'...
  PUT https://pkgs.dev.azure.com/vcomponents/_packaging/a2b3eb0c-a5a4-439a-ab6f-f4b7cae5213f/nuget/v2/
  ServiceUnavailable https://pkgs.dev.azure.com/vcomponents/_packaging/a2b3eb0c-a5a4-439a-ab6f-f4b7cae5213f/nuget/v2/ 205791ms
  PUT https://pkgs.dev.azure.com/vcomponents/_packaging/a2b3eb0c-a5a4-439a-ab6f-f4b7cae5213f/nuget/v2/
error: The operation was canceled.
error:   Error while copying content to a stream.
error:   Unable to write data to the transport connection: The I/O operation has been aborted because of either a thread exit or an application request..
error:   The I/O operation has been aborted because of either a thread exit or an application request.
error:   Pushing took too long. You can change the default timeout of 300 seconds by using the --timeout <seconds> option with the push command.

I could increase timeout, but doubt it will help.

Sorry about encountering this issue. I would try --timeout <seconds> with higher numbers 1st. Network issues are tricky to diagnose, beside slow speed it could be packet loss, wifi, virus scan or just Azure side issue too. After how many minutes do you get above exception? Do you get more details if verbosity detailed option? dotnet nuget push -v d I suspect Azure is resetting the connection which had been open too long, I believe best place would be open issue with Azure feedback, they might have workaround.

zivkan commented 2 years ago

ServiceUnavailable https://pkgs.dev.azure.com/vcomponents/_packaging/a2b3eb0c-a5a4-439a-ab6f-f4b7cae5213f/nuget/v2/ 153575ms

ServiceUnavailable is HTTP 503, which means the server (in this case Azure DevOps) is returning this error to the client (nuget.exe or dotnet.exe).

You can report problems to Azure DevOps directly here: https://developercommunity.visualstudio.com/report?space=21&entry=problem

We, the NuGet team, can contact Azure DevOps on your behalf, but if they ask questions we might not be able to answer. Plus, if you create the feedback ticket yourself, you'll get notifications if the issue is resolved, or with any other updates they add.

tapika commented 2 years ago

Apparently I have problems with https://developercommunity.visualstudio.com/ account - it shows old account, which cannot be deleted in a turn. Can you raise same ticket for Azure - I'll try to investigate with my IT how to fix this issue.

nkolev92 commented 2 years ago

@tapika

I think it's best if you report it. The team there might have additional questions and you need to be able to answer them.

Closing this issue as the error is coming from the Azure DevOps server.