1

After upgrading to Rails 7 (from 5.2) I have been getting the following error when submitting large forms

Error during failsafe response: Maximum total multiparts in content reached

I initially though it was related to this error: Rails 4.2: Internal Server Error with Maximum file multiparts in content reached, but setting the multipart_part_limit has no effect

mahi-man
  • 4,326
  • 2
  • 25
  • 36

1 Answers1

1

The answer was to add this into config.ru:

Rack::Utils.multipart_total_part_limit = 0

From the docs here: https://github.com/rack/rack/blob/main/README.md#multipart_total_part_limit

multipart_total_part_limit The maximum total number of parts a request can contain of any type, including both file and non-file form fields.

The default is 4096, which means that a single request can't contain more than 4096 parts.

Set to 0 for no limit.

Can also be set via the RACK_MULTIPART_TOTAL_PART_LIMIT environment variable.

mahi-man
  • 4,326
  • 2
  • 25
  • 36