Title: Tomcat's default max part count is too low in 4.0.x · Issue #49311 · spring-projects/spring-boot · GitHub
Open Graph Title: Tomcat's default max part count is too low in 4.0.x · Issue #49311 · spring-projects/spring-boot
X Title: Tomcat's default max part count is too low in 4.0.x · Issue #49311 · spring-projects/spring-boot
Description: Description When upgrading from Spring Boot 3.5.11 to 4.0.3, a multipart request containing multiple parts starts failing with a 413 Payload Too Large error. I investigated the issue and found that it can be resolved by configuring the T...
Open Graph Description: Description When upgrading from Spring Boot 3.5.11 to 4.0.3, a multipart request containing multiple parts starts failing with a 413 Payload Too Large error. I investigated the issue and found that...
X Description: Description When upgrading from Spring Boot 3.5.11 to 4.0.3, a multipart request containing multiple parts starts failing with a 413 Payload Too Large error. I investigated the issue and found that...
Opengraph URL: https://github.com/spring-projects/spring-boot/issues/49311
X: @github
Domain: redirect.github.com
{"@context":"https://schema.org","@type":"DiscussionForumPosting","headline":"Tomcat's default max part count is too low in 4.0.x","articleBody":"### Description\n\nWhen upgrading from Spring Boot 3.5.11 to 4.0.3, a multipart request containing multiple parts starts failing with a `413 Payload Too Large` error.\n\nI investigated the issue and found that it can be resolved by configuring the Tomcat limit for the number of parts (e.g., setting `server.tomcat.max-part-count`). I assume this might be due to a stricter default value introduced in the underlying Tomcat version used by Spring Boot 4.0.x.\n\nI did a text search in the Spring Boot 4.0 Migration Guide but couldn't find any mention of this breaking change or the new default limit. It is possible that it is documented somewhere and I simply missed it. However, if that is the case, it might be a bit difficult for developers to discover.\n\n**My Question & Proposal:**\n\nI would like to ask if this change in default behavior is a bug, an intentional change, or perhaps an issue with how my test is written?\n\n- **If it is a bug:** Please let me know if there is anything I can do to help fix it.\n- **If it is intentional:** I strongly suggest adding a clearer mention of it in [the Spring Boot 4.0 Migration Guide](https://github.com/spring-projects/spring-boot/wiki/Spring-Boot-4.0-Migration-Guide). Without a prominent note, developers might be surprised and confused by sudden 413 errors after upgrading.\n- **If my test implementation is incorrect/outdated for 4.0.x:** I would greatly appreciate any guidance on the proper way to construct this multipart request in the new version.\n\n### Steps to Reproduce\n\nI have created a minimal reproducible example repository here:\n\nhttps://github.com/shayFoo/spring-multi-part\n\nThis repository contains two separate folders to demonstrate the difference in behavior:\n\n- **`demo-multipart-3-5-11` folder:** The test passes successfully (returns 200).\n- **`demo-multipart-4-0-3` folder:** The exact same test fails (returns 413).\n\n**How to reproduce:**\n\n1. Clone the repository: `git clone https://github.com/shayFoo/spring-multi-part.git`\n2. Run the test in the `demo-multipart-4-0-3` project. You will observe the `413 Payload Too Large` error.\n3. Run the test in the `demo-multipart-3-5-11` project. You will see it passes without issues.\n\n### Expected Behavior\nThe test in 4.0.3 should pass with a `200 OK` status, just like it does in Spring Boot 3.5.11. \nIf the default multipart limit has intentionally changed in 4.0.x, it should be explicitly and prominently mentioned in the migration guide along with the relevant property (`server.tomcat.max-part-count`) to configure it.\n\n### Actual Behavior\nThe test fails with a `413 Payload Too Large` error in Spring Boot 4.0.3.\n\n### Workaround\nExplicitly setting `server.tomcat.max-part-count` in `application.properties` (or YAML) resolves the issue in 4.0.3.","author":{"url":"https://github.com/shayFoo","@type":"Person","name":"shayFoo"},"datePublished":"2026-02-24T12:48:24Z","url":"https://github.com/spring-projects/spring-boot/issues/49311"}
| react-profiling | 0 |
| react-import-map | react,react-dom,react-dom/client,react-dom/profiling,react-is,react-reconciler,react/compiler-runtime,react/jsx-dev-runtime,react/jsx-runtime,scheduler@d5750093facf |
| route-pattern | /_view_fragments/issues/show/:user_id/:repository/:id/issue_layout(.:format) |
| route-controller | voltron_issues_fragments |
| route-action | issue_layout |
| fetch-nonce | v2:8a1fdce1-9516-2b3d-aec0-648e5ff81729 |
| current-catalog-service-hash | 81bb79d38c15960b92d99bca9288a9108c7a47b18f2423d0f6438c5b7bcd2114 |
| request-id | E590:1258EF:1E086BC:27B17ED:6AEDA2BD |
| html-safe-nonce | 8d6978255e33a74f4be4e346e53a763bc2d22b43f282c2b269ac4b4aa55d3177 |
| visitor-payload | eyJyZWZlcnJlciI6IiIsInJlcXVlc3RfaWQiOiJFNTkwOjEyNThFRjoxRTA4NkJDOjI3QjE3RUQ6NkFFREEyQkQiLCJ2aXNpdG9yX2lkIjoiMzI4NDY5NzU2MTM1MTE2ODcwMSIsInJlZ2lvbl9lZGdlIjoiaWFkIiwicmVnaW9uX3JlbmRlciI6ImlhZCJ9 |
| visitor-hmac | 01554bd285384b2dac6098d94d177d85922b4e3a48666b3b3d4775499d8dabb6 |
| hovercard-subject-tag | issue:3983548434 |
| github-keyboard-shortcuts | repository,issues,copilot |
| google-site-verification | Apib7-x98H0j5cPqHWwSMm6dNU4GmODRoqxLiDzdx9I |
| octolytics-url | https://collector.github.com/github/collect |
| analytics-location | / |
| fb:app_id | 1401488693436528 |
| apple-itunes-app | app-id=1477376905, app-argument=https://github.com/_view_fragments/issues/show/spring-projects/spring-boot/49311/issue_layout |
| twitter:image | https://opengraph.githubassets.com/4937477df9528d51af1802f4b5ba1204f907a9144c0c82971ebdc5fa712d3f49/spring-projects/spring-boot/issues/49311 |
| twitter:card | summary_large_image |
| og:image | https://opengraph.githubassets.com/4937477df9528d51af1802f4b5ba1204f907a9144c0c82971ebdc5fa712d3f49/spring-projects/spring-boot/issues/49311 |
| og:image:alt | Description When upgrading from Spring Boot 3.5.11 to 4.0.3, a multipart request containing multiple parts starts failing with a 413 Payload Too Large error. I investigated the issue and found that... |
| og:image:width | 1200 |
| og:image:height | 600 |
| og:site_name | GitHub |
| og:type | object |
| og:author:username | shayFoo |
| hostname | github.com |
| expected-hostname | github.com |
| None | 9f51e3b6c7a190e426e641ae15acbc58dd1ac2003e96b58879bbc298e213dbf3 |
| turbo-cache-control | no-preview |
| go-import | github.com/spring-projects/spring-boot git https://github.com/spring-projects/spring-boot.git |
| octolytics-dimension-user_id | 317776 |
| octolytics-dimension-user_login | spring-projects |
| octolytics-dimension-repository_id | 6296790 |
| octolytics-dimension-repository_nwo | spring-projects/spring-boot |
| octolytics-dimension-repository_public | true |
| octolytics-dimension-repository_is_fork | false |
| octolytics-dimension-repository_network_root_id | 6296790 |
| octolytics-dimension-repository_network_root_nwo | spring-projects/spring-boot |
| turbo-body-classes | logged-out env-production page-responsive |
| disable-turbo | false |
| browser-stats-url | https://api.github.com/_private/browser/stats |
| browser-errors-url | https://api.github.com/_private/browser/errors |
| release | 7060660810b587033ea861b8aa67beb72c8e6542 |
| ui-target | full |
| theme-color | #1e2327 |
| color-scheme | light dark |
| react-app-name | issues |
Links:
Viewport: width=device-width