30MB Default Maximum Nuget Package Size

kevin.deenanauth's Avatar

kevin.deenanauth

05 Feb, 2012 02:13 AM

By default, Nuget is configured with a 30MB maximum request size.

To set it to something more reasonable (say 400MB for large applications), update Nuget.Server's web.config with these values:

<system.web>
   <httpRuntime maxRequestLength="419430400" />
...


<system.webServer>
   <security>
       <requestFiltering>
           <requestLimits maxAllowedContentLength="419430400" ></requestLimits>
...
  1. 1 Posted by Paul Stovell on 23 Mar, 2012 01:03 AM

    Paul Stovell's Avatar

    Thanks Kevin,

    I'll add this to the documentation.

    Paul

  2. 2 Posted by andrea.maruccia on 14 May, 2013 10:26 AM

    andrea.maruccia's Avatar

    I had a problem that i fixed using this instructions:

    http://dejanvasic.wordpress.com/2013/02/10/local-nuget-gallery-givi...

    [Quote]

    Failed to process request. ‘Request Entity Too Large’.
    The remote server returned an error: (413) Request Entity Too Large..

    Looking very interesting because it’s an IIS Web server error and after poking around with the server argument, I noticed that removing the /api/v2/package worked just fine.

    Good: http://nuget.localurl/

    Bad: http://nuget.localurl/api/v2/package

    Having this code as open source helps so much understanding what is happening under the hood. Thank you git peeps.

    [Quote]

  3. 3 Posted by ianpaullin on 10 Apr, 2014 05:08 PM

    ianpaullin's Avatar

    These instructions helped me as well. We were encountering a strange error message when pushing packages either by command line or using the OctoPack within the MSBuild arguments:

    Unable to write data to the transport connection: An existing connection was forcibly closed by the remote host.

    But we only received these messages when packages reached an arbitrary size. We could not determine if it was our network or IIS until we hit this post.

    Note: within the MS documentation on the two fields in the config file (maxRequestLength and maxAllowedContentLength), the first is in kilobytes and the second is in bytes.

    httpRuntime
    http://msdn.microsoft.com/en-us/library/e1f13641(v=vs.85).aspx

    requestLimits
    http://msdn.microsoft.com/en-us/library/ms689462(v=vs.90).aspx

  4. 4 Posted by Dmitry Lobanov on 12 Aug, 2014 11:31 PM

    Dmitry Lobanov's Avatar

    Hello! Octopus 2.x uses different hosting type, so this solution doesn't work, is it? We have similar problem now, we can't upload 300MB package to internal nuget-feed. How this can be fixed?

    BTW we've tried adding the paramtters mentioned above to the Octopus.server.exe.config file, but it hasn't helped us.

  5. 5 Posted by ianpaullin on 12 Aug, 2014 11:49 PM

    ianpaullin's Avatar

    When we are referring to IIS in this case, we mean to our NuGet server which runs on top of IIS - not Octopus. That's why the web.config changes worked. What type of NuGet host are you using? Are you using the internal NuGet server in Octopus? An external site like myget.org or a commercial product like ProGet?

  6. 6 Posted by Dmitry Lobanov on 13 Aug, 2014 12:15 AM

    Dmitry Lobanov's Avatar

    We are using the internal NuGet server in Octopus.

  7. 7 Posted by cgelhaus on 11 Oct, 2014 05:02 AM

    cgelhaus's Avatar

    Hi Dmitry,
    Have you resolved the issue with the internal nuget feed? If so, please let me know how you did it.

    THanks!
    Chris

  8. 8 Posted by Vanessa Love on 13 Oct, 2014 02:39 AM

    Vanessa Love's Avatar

    Hi Chris,

    NuGet.exe implements a (default) 5 minute timeout for push operations.
    When you call NuGet.exe on the command line, adding -Timeout 601 will extend this to 10 minutes and one second, etc.
    You need to make sure the timeout value isn't a multiple of 60, because of this NuGet bug: https://nuget.codeplex.com/SourceControl/network/forks/styx31/nuget...

    Hope this helps!
    Vanessa

  9. 9 Posted by cgelhaus on 13 Oct, 2014 12:52 PM

    cgelhaus's Avatar

    Hi Vanessa,

    So if I understand correctly, the timeout happening on the client side and not on the server side?

  10. 10 Posted by Dmitry Lobanov on 13 Oct, 2014 04:15 PM

    Dmitry Lobanov's Avatar

    Hi Chris,

    yes, the issue has not been related to the 30MB limit. This was solely the issue with the timeout. The reason why we hit this timeout is still unclear, but it looks like that we had some bandwidth issue with transferring data between AWS servers. Perhaps we used external IPs to upload packages. Now we switched to internal IPs and the problem has gone.

  11. 11 Posted by Vanessa Love on 14 Oct, 2014 04:34 AM

    Vanessa Love's Avatar

    Hi Chris,

    Dmitry is correct (high-five) we do not impose any limit. But NuGet has a timeout when it's uploading the file which for large files can make it seem like we impose one.
    Generally if the network connection isn't having major issues, adding the timeout flag will help.

    Vanessa

  12. 12 Posted by cgelhaus on 14 Oct, 2014 12:48 PM

    cgelhaus's Avatar

    Thank you Vanessa / Dmitry! I reviewed the nugget.exe command line syntax and I see how to use the timeout parameter.

  13. 13 Posted by rammaram06 on 22 Jul, 2015 02:16 PM

    rammaram06's Avatar

    Hi,

    I added below settings to increase the package upload size to 50 MB, but I am still getting the same error. Is there any other setting I am missing ? Could you guys please help me to fix it ?

    <httpRuntime targetFramework="4.5" maxRequestLength="52428800"/>
    <system.webServer>
            <security>
                <requestFiltering>
                    <requestLimits maxAllowedContentLength="52428800"/>
                </requestFiltering>
    </security>
    </system.webServer>

    Error:
    Failed to process request. 'Not Found'.
    The remote server returned an error: (404) Not Found..

  14. Support Staff 14 Posted by Paul Stovell on 23 Jul, 2015 01:38 AM

    Paul Stovell's Avatar

    Hi Ram,

    Thanks for getting in touch! A 404 error is likely to be a problem with the URL being wrong, not with timeouts. Could you show me what the URL looks like?

    Paul

  15. 15 Posted by rammaram06 on 23 Jul, 2015 02:18 AM

    rammaram06's Avatar

    Hi Paul,

    Url is http://nuget.xxxx.org/Nuget. If the issue is with url, Is there a way to increase size and keep same url?

    Thanks,
    Ram

  16. 16 Posted by cbartlett on 30 Nov, 2015 10:53 PM

    cbartlett's Avatar

    I am experiencing the same issue that Ram is having. The only thing is, is that it is working for every package except my web project. It is 40~ MB and I have upped the max request length to 300 and still no dice.

    Again, I am getting this error:
    The remote server returned an error : (404) Not Found

  17. 17 Posted by cbartlett on 30 Nov, 2015 11:12 PM

    cbartlett's Avatar

    Please ignore this. I was adding this:
    <security>
            <requestFiltering>
                <requestLimits maxAllowedContentLength="419430400" ></requestLimits>
            </requestFiltering>
        </security>

    to the wrong section. Too little sleep! It is now working.

  18. 18 Posted by piers7 on 25 Feb, 2016 12:35 AM

    piers7's Avatar

    @ianpaulin @Rammaram note that when using Nuget.Server the URLs for list / restore and for push operations are *different*. This _is_ in the Nuget.Server documentation, but is pretty brain-dead if you ask me.

    - http://mynuget/nuget/ - required for list/restore
    - http://mynuget/ - required for push

    This is nothing to do with Octopus, but I leave it here for reference as relevant to this thread. I've raised this with the nuget team: https://github.com/NuGet/NuGetGallery/issues/2903

  19. Paul Stovell closed this discussion on 04 Jan, 2017 06:56 AM.

Comments are currently closed for this discussion. You can start a new one.

Keyboard shortcuts

Generic

? Show this help
ESC Blurs the current field

Comment Form

r Focus the comment reply box
^ + ↩ Submit the comment

You can use Command ⌘ instead of Control ^ on Mac