Incorrect POST content length when reporting issues via REST API

Get help from other users here.

Moderators: Developer, Contributor

Post Reply
ntushar
Posts: 22
Joined: 07 Apr 2022, 06:49

Incorrect POST content length when reporting issues via REST API

Post by ntushar »

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.
atrol
Site Admin
Posts: 8549
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: Incorrect POST content length when reporting issues via REST API

Post by atrol »

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?
Please use Search before posting and read the Manual
Post Reply