Bug 35947 - Intermittent "Invalid chunked data" error when using NuGet 3.2 on Mono 4.2
Summary: Intermittent "Invalid chunked data" error when using NuGet 3.2 on Mono 4.2
Status: RESOLVED FIXED
Alias: None
Product: Class Libraries
Classification: Mono
Component: System ()
Version: 4.2.0 (C6)
Hardware: All All
: --- normal
Target Milestone: Untriaged
Assignee: Martin Baulig
URL:
Depends on:
Blocks:
 
Reported: 2015-11-17 14:53 UTC by Alexander Köplinger [MSFT]
Modified: 2016-01-29 15:17 UTC (History)
4 users (show)

Tags:
Is this bug a regression?: ---
Last known good build:


Attachments
repro.zip (1.08 MB, application/x-zip-compressed)
2015-11-17 14:53 UTC, Alexander Köplinger [MSFT]
Details


Notice (2018-05-24): bugzilla.xamarin.com is now in read-only mode.

Please join us on Visual Studio Developer Community and in the Xamarin and Mono organizations on GitHub to continue tracking issues. Bugzilla will remain available for reference in read-only mode. We will continue to work on open Bugzilla bugs, copy them to the new locations as needed for follow-up, and add the new items under Related Links.

Our sincere thanks to everyone who has contributed on this bug tracker over the years. Thanks also for your understanding as we make these adjustments and improvements for the future.


Please create a new report on GitHub or Developer Community with your current version information, steps to reproduce, and relevant error messages or log files if you are hitting an issue that looks similar to this resolved bug and you do not yet see a matching new report.

Related Links:
Status:
RESOLVED FIXED

Description Alexander Köplinger [MSFT] 2015-11-17 14:53:08 UTC
Created attachment 13844 [details]
repro.zip

See attached repro.zip.

Unzip and run in a loop with:

> while [ $? -eq 0 ]; do mono nuget.exe install KoreBuild -ExcludeVersion -o packages -nocache -pre; done

After a few iterations, it hangs for a while after "Attempting to gather dependencies information for package 'KoreBuild.0.2.1-rc2-15555' [...]" and then exit and prints:

> Invalid chunked data.

This seems to be a new issue in Mono 4.2. I tried on master and it doesn't seem to repro there.

Environment: Ubuntu 14.04 amd64. I don't seem to be able to repro on OSX.

It is affecting the aspnet5 guys and likely anyone else using the new nuget.exe.
Comment 1 Alexander Köplinger [MSFT] 2015-11-17 18:45:04 UTC
@Martin: Here's the inner exception (e from https://github.com/mono/mono/blob/6dd2d0d52b8bc4262d67833f44bc1537c3d17a9e/mcs/class/System/System.Net/WebConnection.cs#L986):

>System.IO.IOException: IO exception during read. ---> System.IO.IOException: Read failure ---> System.Net.Sockets.SocketException: Connection reset by peer
>  at System.Net.Sockets.Socket.Receive (System.Byte[] buffer, Int32 offset, Int32 size, SocketFlags flags) [0x00053] in /home/alexander/dev/mono/mcs/class/System/System.Net.Sockets/Socket.cs:1627 
>  at System.Net.Sockets.NetworkStream.Read (System.Byte[] buffer, Int32 offset, Int32 size) [0x00067] in /home/alexander/dev/mono/mcs/class/System/System.Net.Sockets/NetworkStream.cs:372 
>  --- End of inner exception stack trace ---
>  at System.Net.Sockets.NetworkStream.Read (System.Byte[] buffer, Int32 offset, Int32 size) [0x00078] in /home/alexander/dev/mono/mcs/class/System/System.Net.Sockets/NetworkStream.cs:374 
>  at Mono.Security.Protocol.Tls.SslStreamBase.Read (System.Byte[] buffer, Int32 offset, Int32 count) [0x00158] in /home/alexander/dev/mono/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/SslStreamBase.cs:992 
>  --- End of inner exception stack trace ---
>  at Mono.Security.Protocol.Tls.SslStreamBase.Read (System.Byte[] buffer, Int32 offset, Int32 count) [0x00326] in /home/alexander/dev/mono/mcs/class/Mono.Security/Mono.Security.Protocol.Tls/SslStreamBase.cs:1064 
>  at System.Net.WebConnection.EnsureRead (System.Byte[] buffer, Int32 offset, Int32 size) [0x0004e] in /home/alexander/dev/mono/mcs/class/System/System.Net/WebConnection.cs:1016 
>  at System.Net.WebConnection.EndRead (System.Net.HttpWebRequest request, IAsyncResult result) [0x0013c] in /home/alexander/dev/mono/mcs/class/System/System.Net/WebConnection.cs:981 
>Invalid chunked data.
Comment 3 Nate McMaster 2016-01-27 18:34:25 UTC
Still seeing this issue in Mono 4.2.2. Has there been any progress on this issue?



Mono JIT compiler version 4.2.2 (Stable 4.2.2.30/996df3c Fri Jan 22 00:02:19 UTC 2016)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
	TLS:           __thread
	SIGSEGV:       altstack
	Notifications: epoll
	Architecture:  amd64
	Disabled:      none
	Misc:          softdebug 
	LLVM:          supported, not enabled.
	GC:            sgen
Comment 4 Alexander Köplinger [MSFT] 2016-01-29 15:17:07 UTC
AFAIK there was no fix related to this in 4.2.2.

I just tried it on 4.3.2 (which is the working branch for the next release) and I can't reproduce the issue there, so looks like this was fixed.