Open woosuk-yang opened 1 month ago
I've been investigating this issue and have found its cause.
At this point https://github.com/loic-sharma/BaGet/blob/5a8502ca4e3b21acd369d4a98c2529dac2d81cfe/src/BaGet/ConfigureBaGetOptions.cs#L67 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
;
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:
Expected behavior
A clear and concise description of what you expected to happen.
Screenshots
nuget push error log![image](https://github.com/loic-sharma/BaGet/assets/93505561/854fb147-d56f-49db-89a7-de98f984e318)
my baget server error log![image](https://github.com/loic-sharma/BaGet/assets/93505561/52e6b4f6-cdbd-4c90-9c09-db2e6ceb7daf)
Additional context
Add any other context about the problem here.