Weird error during push with nuget 1.2 - "You must write ContentLength bytes to the request stream before calling [Begin]GetResponse."

Apr 4, 2011 at 7:50 AM
Edited Apr 4, 2011 at 8:07 AM

Hi,

we are getting the following error during nuget push for https://github.com/BjRo/Machine.Fakes from our CI Server:

  "You must write ContentLength bytes to the request stream before calling [Begin]GetResponse."

You can see this at http://teamcity.codebetter.com/viewLog.html?buildId=23771&tab=buildLog&buildTypeId=bt349&all=true (you can login as guest).

We call Nuget.exe (1.2) with the following command:

  NuGet.exe push -source http://packages.nuget.org/v1/ "Machine.Fakes.0.2.1.2.nupkg" PRIVATEKEY

We didn't change anything in the build since the update to version 1.2. It worked fine with 1.1

As a workaround we uploaded the package manually, so it can be found at nuget.org.

Best regards and thanks for any hints,

 Steffen

 

Update: 

Forgot to mention. This happened before the server upgrade.

And it happened 4 times in a row: http://teamcity.codebetter.com/viewType.html?tab=buildTypeStatusDiv&buildTypeId=bt349

Apr 4, 2011 at 8:10 AM

Questions:

  • Are you able to repro this from your dev machine if you run the same command on the exact same  package as what fails on the CI machine? If so, can you share out the package?
  • If you run fiddler during the push, do you see any requests? If so, can you include the log? I realize this is hard to do if it only happens on CI machine :)