"Arithmetic operation resulted in an overflow" when adding packages

Apr 22, 2011 at 4:00 PM

Whenever adding any packages to the project I'm getting an "Arithmetic operation resulted in an overflow."

Here are the steps I've done to reproduce.

Right click on "References" and choose "Add Library Package Reference..."

Then click install on any package. For the razor engine package it just shows this error

For the MvcMailer package it results in a slightly different error but the same result

I've tried this on a multitude of packages and they all have the same error. Is there a log file or something I could upload to help solve this? I'm probably going to reinstall nuget but I thought this might be a good issue to solve before I attempt that.

 

Thanks for the wonderful package btw.

Apr 22, 2011 at 4:27 PM

What version of nuget are you using?

The one thing I can think of is that yesterday, we turned on support for HTTP compression on nuget.org. But normally this should not affect clients that don't ask for compression, and our currently release (1.2) does not. I don't see this with 1.2.

Can you also try running fiddler to look at the http requests while this happens?

Apr 22, 2011 at 5:00 PM

GET http://packages.nuget.org/v1/Package/Download/RazorEngine/2.1 HTTP/1.1
User-Agent: Package-Installer/1.2.20325.9034 (Microsoft Windows NT 6.1.7601 Service Pack 1)
Host: packages.nuget.org

HTTP/1.1 200 OK
Proxy-Connection: Keep-Alive
Connection: Keep-Alive
Via: 1.1 ISA-SERVER
Date: Fri, 22 Apr 2011 16:31:49 GMT
Content-Type: application/zip
Server: Microsoft-IIS/7.0
Cache-Control: private
X-AspNetMvc-Version: 2.0
Content-Disposition: attachment; filename=RazorEngine-2.1.nupkg
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
Content-Length: 103860
Content-Encoding: gzip
Transfer-Encoding: chunked

There was nothing else in the Fiddler data stream other than the file itself that was downloaded.

Using the commandline installer I get the following details

Install-Package : Arithmetic operation resulted in an overflow.
At line:1 char:16
+ Install-Package <<<<  RazorEngine
    + CategoryInfo          : NotSpecified: (:) [Install-Package], OverflowException
    + FullyQualifiedErrorId : NuGetCmdletUnhandledException,NuGet.PowerShell.Commands.InstallPackageCommand

The above happens on more than just the RazorEngine package

I've downloaded the source and attempted to debug the VsExtension but for some reason it doesn't want to attach (probably because of the existing nuget installation)

Apr 22, 2011 at 5:16 PM

I've tested it on other systems in our office and they all have the same error. Testing it on another machine with a very similar setup results in no errors.

Downloading the package directly from http://packages.nuget.org/v1/Package/Download/RazorEngine/2.1 works just fine (not a corrupted download)

Apr 22, 2011 at 5:21 PM

The response is coming back with 'Content-Encoding: gzip', which normally it shouldn't be because the client didn't ask for it. My guess is that the proxy is doing something that causes it. We may need to turn off compression until we figure this out.

Apr 22, 2011 at 5:25 PM

Cool. I just uninstalled/reinstalled and still got the same errors. Thanks for taking the time to look at this.

Apr 22, 2011 at 5:27 PM

I just turned compression off. Can you try again BuildStarted?

Apr 22, 2011 at 5:28 PM

We just turned off compression. Can you verify that it makes the issue go away? Restart VS and clear your IE cache to make sure you're hitting the server.

Apr 22, 2011 at 5:29 PM

The issue went away and works like a dream again.

Apr 26, 2011 at 9:04 AM

Hello BuildStarted, I want to turn compression back on with different settings that I think should avoid this issue. Would you be available to help us test the issue?

Apr 26, 2011 at 4:34 PM

Go for it, I'll be ready to go whenever you are.

Apr 26, 2011 at 4:53 PM

Awesome. I'll make the change in 15 minutes and report back here when it is ready to test.

Apr 26, 2011 at 5:05 PM

Okay BuildStarted, can you see if you hit the same issue with installing RazorEngine as before?

Apr 26, 2011 at 5:23 PM
Edited Apr 26, 2011 at 5:23 PM

Still results in the same error - I think my firewall enforces gzip or something. I've talked with the network admin and he doesn't know of anything that would affect it though. (Sorry about the lateness - had to step out)

Apr 26, 2011 at 5:28 PM

Let me try one other thing. Give me a minute to make the change.

Apr 26, 2011 at 5:30 PM

Okay, can you give it one more try? If it still doesn't work I'll turn compression back off for now.

Apr 26, 2011 at 5:35 PM

Works good so far. I'll keep trying different ones but it's working with the 3 I've tested. Thanks!

Apr 26, 2011 at 5:37 PM

Great. That last change really should have fixed it, so hopefully we don't see any issues. I'll keep an eye out for this thread though, in case you run into issues. Thanks for helping to test!

Apr 26, 2011 at 5:40 PM

but the response is not compressed now.

Apr 26, 2011 at 5:42 PM

It is for me: http://www.port80software.com/tools/compresscheck.asp?url=http://packages.nuget.org/v1/FeedService.svc/Packages&Submit1=Check+Compression

NOTE: It will not be compressed behind a proxy. Until we understand why it gets messed up behind proxies, we're going to have to leave it that way.

Apr 26, 2011 at 5:43 PM

(Actually, I'm not sure that site is a good check, but it is showing compressed for me. Are you not seeing it compressed outside the proxy, dotnetjunky?)

Apr 26, 2011 at 5:43 PM

I see. That's a pity, because most people are behind proxies. But this is a good step forward.

Apr 26, 2011 at 5:45 PM

I'm not seeing it compressed from my office.

Apr 26, 2011 at 5:45 PM

I agree, we need to do more investigation to learn why some proxies ignore the original requests accept header. But at least we're better than we were, for now.

Apr 29, 2011 at 12:19 AM

I am having problems with the same error "Arithmetic operation resulted in an overflow." when trying over a mobile 3G network in NZ.

Apr 29, 2011 at 12:21 AM

I just saw this same error come up when a presenter was teathered over an iPhone4 and was demoing NuGet.

May 5, 2011 at 5:46 PM

@BuildStarted: We have made another attempt to turn on compression for proxies. Can you try installing a package from nuget again to make sure it works for your proxy? Thanks

May 5, 2011 at 5:48 PM

Still seems to work and I've installed a random selection from the most downloads sort.

May 5, 2011 at 5:54 PM

Thanks. Can you open Fiddler and see if the responses are compressed? Specifically, the request for package feed should be compressed, but the request to download the actually package bytes should NOT be compressed.

May 5, 2011 at 5:56 PM

The /v1/FeedService.svc/Packages()... was indeed compressed while the actual /v1/Package/Download/... wasn't compressed

May 5, 2011 at 5:58 PM

Cool. We've got a winner.

May 5, 2011 at 6:00 PM

Glad to be of help. I hope all this work wasn't just for me. Thankfully at least one other person had the problem :)

Coordinator
May 5, 2011 at 6:39 PM

It was all just for you! That’s the kind of attention to detail the NuGet team prides itself on. J

Yeah, I’m sure it affects others too. Funny thing is, our own proxy strips out the Accept-Encoding so we don’t get compressed feeds within MS.

Phil

Nov 17, 2011 at 4:11 PM

Sorry to open this up again, I seem to be running into the same error message:

Everything looks fine in Fiddler:

GET /v1/FeedService.svc/Packages()?$filter=tolower(Id)%20eq%20'newtonsoft.json'&$orderby=Id&$skip=0&$top=30 HTTP/1.1
DataServiceVersion: 1.0;NetFx
MaxDataServiceVersion: 2.0;NetFx
User-Agent: NuGet Add Package Dialog/1.5.20902.9026 (Microsoft Windows NT 6.1.7601 Service Pack 1)
Accept: application/atom+xml,application/xml
Accept-Charset: UTF-8
Host: packages.nuget.org
Accept-Encoding: gzip, deflate
Connection: Keep-Alive

My solution is fairly basic and contains:

  • Azure project
  • MVC3 Web project
  • Azure worker project

I did a little more digging and the strange thing is that if I open just the MVC3 project in an unsaved solution, I can install the package fine!

If I then save a new solution with just the MVC3 project and attempt to add another package (after closing and opening that new solution) the same problem occurs.

Dec 4, 2011 at 2:53 PM

I'm getting the same error. I've tried uninstalling and reinstalling NuGet. I'm using the latest version (1.5.2, I believe).

Successfully installed 'Rx_Experimental-Main 1.1.11111'.
Install failed. Rolling back...
Arithmetic operation resulted in an overflow.

Dec 4, 2011 at 4:02 PM

Can you post the Fiddler response header here?

Dec 4, 2011 at 4:05 PM
Edited Dec 4, 2011 at 4:08 PM

Sure. Sorry, I should have done that in the first place:

 

HTTP/1.1 200 OK
Cache-Control: no-cache
Content-Type: application/atom+xml;charset=utf-8
Content-Encoding: gzip
Vary: Accept-Encoding
Server: Microsoft-IIS/7.0
DataServiceVersion: 1.0;
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
Date: Sun, 04 Dec 2011 17:04:03 GMT
Content-Length: 2824

Edit: Original Request (just in case this is useful)

GET http://packages.nuget.org/v1/FeedService.svc/Packages()?$filter=tolower(Id)%20eq%20'rx_experimental-main'&$orderby=Id&$skip=0&$top=30 HTTP/1.1
DataServiceVersion: 1.0;NetFx
MaxDataServiceVersion: 2.0;NetFx
User-Agent: NuGet Add Package Dialog/1.5.20902.9026 (Microsoft Windows NT 6.1.7600.0)
Accept: application/atom+xml,application/xml
Accept-Charset: UTF-8
Host: packages.nuget.org
Accept-Encoding: gzip, deflate
Connection: Keep-Alive

Dec 4, 2011 at 4:43 PM
Edited Dec 4, 2011 at 4:43 PM

Is this the only request? There should be another request to download the package binary. Can you post that too? Make sure you clear browser cache and the NuGet machine cache (via the NuGet Options page)

Dec 4, 2011 at 4:55 PM
Edited Dec 4, 2011 at 4:56 PM

Sorry, I assumed you only wanted the second. I cleared the cache so we can see the download for the installation. Here's both side-by-side (request and response headers).

GET http://packages.nuget.org/v1/Package/Download/Rx_Experimental-Main/1.1.11111 HTTP/1.1
User-Agent: NuGet Add Package Dialog/1.5.20902.9026 (Microsoft Windows NT 6.1.7600.0)
Host: packages.nuget.org
Connection: Close
HTTP/1.1 200 OK
Cache-Control: private
Content-Type: application/zip
Server: Microsoft-IIS/7.0
X-AspNetMvc-Version: 2.0
Content-Disposition: attachment; filename=Rx_Experimental-Main-1.1.11111.nupkg
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
Date: Sun, 04 Dec 2011 17:49:48 GMT
Connection: close
Content-Length: 1519952



GET http://packages.nuget.org/v1/FeedService.svc/Packages()?$filter=tolower(Id)%20eq%20'rx_experimental-main'&$orderby=Id&$skip=0&$top=30 HTTP/1.1
DataServiceVersion: 1.0;NetFx
MaxDataServiceVersion: 2.0;NetFx
User-Agent: NuGet Add Package Dialog/1.5.20902.9026 (Microsoft Windows NT 6.1.7600.0)
Accept: application/atom+xml,application/xml
Accept-Charset: UTF-8
Host: packages.nuget.org
Accept-Encoding: gzip, deflate
HTTP/1.1 200 OK
Cache-Control: no-cache
Content-Type: application/atom+xml;charset=utf-8
Content-Encoding: gzip
Vary: Accept-Encoding
Server: Microsoft-IIS/7.0
DataServiceVersion: 1.0;
X-AspNet-Version: 4.0.30319
X-Powered-By: ASP.NET
Date: Sun, 04 Dec 2011 17:50:23 GMT
Content-Length: 2828

Hope this is helpful. Let me know if you need anything else!

Dec 4, 2011 at 5:18 PM

Looking at the response, I don't see any obvious problem. Do you want to try out our latest 1.6 build to see if it fixes your problem? Just uninstall NuGet 1.5 that you have and install the VSIX from here: http://ci.nuget.org:8080/guestAuth/repository/download/bt4/.lastSuccessful/VisualStudioAddIn/NuGet.Tools.vsix

Let me know the result.