Impossible to send some errors on Mantis due to http 500 err

delphi package - automated exception handling
Post Reply
aaangeli
Posts: 9
Joined: Mon Sep 22, 2014 7:35 am

Impossible to send some errors on Mantis due to http 500 err

Post by aaangeli »

Hi, I'm trying to debug madExcept sending issues to a Mantis server. Sometimes the send process is stopped and madExecpt returns me a SendFailureMsg message. Now I have a case in my main software that I can reproduce. Debugging the code I could see that ReceiveResponse of the FinishMantisCall gets a 500 http error and so the process is stopped. Sometimes I could see the new item added in the mantis without attachments, sometimes I couldn't see the items.

I'm using the latest Mantis version 1.2.19 and the program is compiled with D10 seattle with madExcept 4.0.13.

Any idea?

Davide
madshi
Site Admin
Posts: 10754
Joined: Sun Mar 21, 2004 5:25 pm

Re: Impossible to send some errors on Mantis due to http 500

Post by madshi »

That seems to be a problem on the Mantis side, doesn't it? Why would it send 500? So far no other user has reported a similar issue. I'm not really that much of a Mantis expert. Is there maybe some logging you can turn on to find out *why* the server is sometimes reporting 500?
aaangeli
Posts: 9
Joined: Mon Sep 22, 2014 7:35 am

Re: Impossible to send some errors on Mantis due to http 500

Post by aaangeli »

I think that could be a mantis problem too. I'm now creating a server on a VM to do tests to see if could be a problem of the real world server in which is not so esy to do experiments. At first time I thought that could be a problem with the xml command: I always add a custom section (calling exceptIntF.BugReportSections.Add) and sometimes in the text added there are special characters like "&" that could create some problems with xml code, but now that I'm testing it I removed the custom section but the problem persists.
madshi
Site Admin
Posts: 10754
Joined: Sun Mar 21, 2004 5:25 pm

Re: Impossible to send some errors on Mantis due to http 500

Post by madshi »

If you find anything, please let me know - thanks! :)
aaangeli
Posts: 9
Joined: Mon Sep 22, 2014 7:35 am

Re: Impossible to send some errors on Mantis due to http 500

Post by aaangeli »

Mantis forums tells that generally a 500 err is caused by wrong parameters so I investigate in that way. My first thought was right: the problem was with no standard characters (in my case with "&"). When the exception is raised I customize at runtime some madExcept settings so I add some text to "Settings.BugTrackerDescription". In this text, in my error case, there was an "&" character. This seems no safe to pass to XML mantis code. I solved it by making XML safe the string that I add to the bug description. I don't know if you want to do that in madExcept units to avoid this kind of problem for other mantis users.

Thanks
Davide
madshi
Site Admin
Posts: 10754
Joined: Sun Mar 21, 2004 5:25 pm

Re: Impossible to send some errors on Mantis due to http 500

Post by madshi »

Thanks for researching this!

Do you know which characters are considered problematic? Then I can simply replace them with something else in madExcept.
aaangeli
Posts: 9
Joined: Mon Sep 22, 2014 7:35 am

Re: Impossible to send some errors on Mantis due to http 500

Post by aaangeli »

I know almost for sure these: "&", ">", "<" but in general I think all the characters that can be used in xml syntax. I create a little function that substitute "&" with "&", ">" with ">" and "<" with "<". I also substitute the double quote character " with ' because in xml files it could be used to specify data attributes.
Post Reply