We have mantisBT with version 2.25.5. We use REST API to POST issues in Mantis. Mantis is configured to store attachment on disk. Also attachment size is configured to 20MB in config_Inc.php. Also PHP settings are modified to allow 20MB attachments as below
post_max_size = 30M
upload_max_filesize = 20M
User tried to report one issue via REST API with 4MB attachment. However after long time it failed for user. Below error message was logged in mantis logs.
PHP Warning: Unknown: POST Content-Length of 115738183 bytes exceeds the limit of 31457280 bytes in Unknown on line 0
PHP Fatal error: Allowed memory size of 134217728 bytes exhausted (tried to allocate 115737048 bytes) in mantis/vendor/slim/slim/Slim/Http/Request.php on line 200
I do not understand when user tried to report issue with 4MB attachment why mantis is reporting POST content length as 115MB and failing.
Incorrect POST content length when reporting issues via REST API
Moderators: Developer, Contributor
Re: Incorrect POST content length when reporting issues via REST API
As a first step, you should upgrade to latest stable version 2.25.7, especially if the the PHP version you use is >= 8.1.
There are also some REST API issues fixed in it.
Did you try different sizes and found the limit that works?
There are also some REST API issues fixed in it.
Did you try different sizes and found the limit that works?