Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

There is a 2GB limit to the size of the nugget package, so push is not possible. #797

Open
woosuk-yang opened this issue May 13, 2024 · 2 comments

Comments

@woosuk-yang
Copy link

woosuk-yang commented May 13, 2024

Describe the bug

I am trying to push to the baget server for packages over 2GB. Packages under 2GB are uploaded, but for packages over 2GB, the error "500 (Internal Server Error)" appears.

The way I'm using the baget is in a docker. So I took an error log of the docker and confirmed that it was an error, "System.IO.InvalidDataException: Multipart body length limit 2147483647 exceeded." Can't I upload more than 2GB of packages?

Please let me know if there is a way to set the related config.

To Reproduce

Steps to reproduce the behavior:

  1. Using this version of BaGet : v0.4.0-preview2
  2. the way to use Baget : Ubuntu 20.04, docker
  3. Run this code : ../nuget.exe push -Source http://0.0.0.0:5555/v3/index.json -ApiKey -Verbosity detailed *.nupkg
  4. See error

Expected behavior

A clear and concise description of what you expected to happen.

Screenshots

  • nuget push error log
    image

  • my baget server error log
    image

Additional context

Add any other context about the problem here.

@woosuk-yang woosuk-yang changed the title There is a limit to the size of the nugget package, so push is not possible. There is a 2GB limit to the size of the nugget package, so push is not possible. May 13, 2024
@mbaksh01
Copy link

I've been investigating this issue and have found its cause.

At this point

options.MultipartBodyLengthLimit = int.MaxValue;
the max body length is set to 2147483647 which is approximately 2.14 GB. When processing a form which is larger than this value a InvalidDataException is thrown as shown by the docs.

The ideal fix would be to accept this value from the appsettings.json file, but a temporary fix would be to increase this value to a number greater than int.MaxValue (if you have a fork of this repo).

In terms of better error handling, I think it would make sense to catch the InvalidDataException in the controller and then return a bad request indicating that the max size of NuGet packages in currently int.MaxValue;

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants