REST API Patch Method causes HTTP 500 error

Get help from other users here.

Moderators: Developer, Contributor

Post Reply
gvajda
Posts: 5
Joined: 09 Feb 2022, 08:11

REST API Patch Method causes HTTP 500 error

Post by gvajda »

Hi Everyone,
I'M having issues changing ticket status via REST API.
MantisBT Version upgraded to current: 2.25.2 from 2.14.~ - running on Turnkey Linux, a template CT availaable for ProxMox.

REST API should be enabled by default - checked, and it is, in config_default_inc.php

What was missing is I had to enable Apache Mod ReWrite via command a2enmod rewrite
And the topic here gave good details on what else to edit to enable CURL.

Whenever at this point I attempt the patch method, I get HTTP500 Internal Server Error, and the response is: Slim Application error, A website error has occurred.
Curl command below:
curl --trace-ascii - --request PATCH "http://IPOFSERVER/api/rest/issues/ticketnr/" --header "Authorization: MYTOKEN" --header "Content-Type: application/json" --data '{"status":{"name":"new"}}'

The following excerpt is from the apache2's error log. I'M far from being an expert but does it try to use SOAP instead of REST? Am I missing a parameter maybe from the curl command?
Slim Application Error: Call to undefined method RestFault::getMessage()
File: /var/www/mantis/api/soap/mc_api.php
Line: 364

Thank you in advance,
Greg
atrol
Site Admin
Posts: 8375
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: REST API Patch Method causes HTTP 500 error

Post by atrol »

One part of the issue is fixed in currently not released 2.25.3
https://www.mantisbt.org/bugs/view.php?id=28927

You could apply the changes manually
https://github.com/mantisbt/mantisbt/co ... b689f7d66d

After that, I expect you will no longer get

Code: Select all

Slim Application Error: Call to undefined method RestFault::getMessage()
and maybe see hints in the response what is causing the error.
Please use Search before posting and read the Manual
gvajda
Posts: 5
Joined: 09 Feb 2022, 08:11

Re: REST API Patch Method causes HTTP 500 error

Post by gvajda »

Thanks a lot!
That did the trick for me.
Post Reply