madExcept to MantisBT not working--Help!

delphi package - automated exception handling
Post Reply
CBelanger
Posts: 18
Joined: Wed Sep 12, 2018 11:39 pm

madExcept to MantisBT not working--Help!

Post by CBelanger »

Been a real journey!

Moving MantisBT to a new host server. The current server hardware is failing daily so I needed a new site. The old server is on an old windows server and uses IIS for the server.
Set up the new site with WAMP on a Windows 2016 server and then used the latest MantisBT, 2.25.5.
Following all the recommended settings and madExcept sending the bug reports to Mantis on the old server works fine (when the old server actually works). So, my point is that madExcept is doing what it should.

The main issue is that as of last night I finally got my small test program to send a bug report and screen shot up to the new MantisBT site. Today, it is not working and I did nothing to change the settings for either madExcept in the test project nor at the new Mantisbt site.

There is an odd issue which came up with my second full install of MantisBT where the httpd-vhosts.conf file which sets up the localhost and mantisbt access would suddenly not allow web access to manitsbt. When I changed the order, i.e. made mantisbt the first or default site, then it was accessible. Otherwise, getting "Forbidden you do not have permission to access this resource." "Require all granted" is used as recommended in the host config file. The weird thing is that in the initial install the vhosts config file was the same with localhost first then the mantisbt setup and I could access the mantibt site via the web browser. BTW, I can access Mantis via localhost just fine.

In madExcept that having the mantisbt site first in the vhosts config file is the only way it "sees" the site and gives the green check. All settings have the green check and I do leave the "assign to" blank.

Anyway, on a bug report (it does create a bug report and saves that), nothing goes up to the new mantisbt site. Again, this worked fine last night, meaning Sunday. At this point I have spent many hours on trying to get everything to work and am desperate to find a solution.

In the apache access.log file I do see:
34.94.192.31 - - [18/Oct/2022:02:21:17 -0700] "-" 408 -
24.130.26.12 - - [18/Oct/2022:02:22:39 -0700] "POST /api/soap/mantisconnect.php HTTP/1.1" 200 536
24.130.26.12 - - [18/Oct/2022:02:22:40 -0700] "POST /api/soap/mantisconnect.php HTTP/1.1" 200 2141
24.130.26.12 - - [18/Oct/2022:02:22:40 -0700] "POST /api/soap/mantisconnect.php HTTP/1.1" 200 1286
24.130.26.12 - - [18/Oct/2022:02:22:40 -0700] "POST /api/soap/mantisconnect.php HTTP/1.1" 200 765
24.130.26.12 - - [18/Oct/2022:02:22:40 -0700] "POST /api/soap/mantisconnect.php HTTP/1.1" 200 599
24.130.26.12 - - [18/Oct/2022:02:22:40 -0700] "POST /api/soap/mantisconnect.php HTTP/1.1" 200 1055

Note: the site address for the new MantisBT is 34.94.192.31. I have no idea what/who the other site is (24.130.26.12). The above is what was logged when I attempted to create a bug in a test program and madExcept attempted to upload the report and screen shot. (The madExcept progress bar gets about halfway then closes the window. I did notice that when successfully uploading the report and screen shot the progress bar goes about 3/4 of the way or more then closes.)

Can anyone help? I will be glad to provide any further details. Just not sure what to provide at this state.
Thank you!
Chuck
madshi
Site Admin
Posts: 10753
Joined: Sun Mar 21, 2004 5:25 pm

Re: madExcept to MantisBT not working--Help!

Post by madshi »

Unfortunately I'm far from a Mantis expert. I just learned the necessary stuff when I implemented it many many years ago and I don't remember half of it.

One thing you could try is check these global variables exported by madExcept.pas, after uploading to Mantis failed:

Code: Select all

var
  LastHttpErrorNo            : dword         = 0;      // the last Http upload error number is stored here
  LastHttpErrorStr           : UnicodeString = '';     // the last Http upload error string is stored here
  LastHttpPostReply          : AnsiString    = '';     // last reply from the server when doing an HTTP post
Maybe that gives some useful hints?
CBelanger
Posts: 18
Joined: Wed Sep 12, 2018 11:39 pm

Re: madExcept to MantisBT not working--Help!

Post by CBelanger »

Thank you for your reply.
in my simple test program:

procedure TForm1.btn1Click(Sender: TObject);
var
frmDoesNotExist : TForm;

begin
with frmDoesNotExist do
begin
ShowModal;
if LastHttpErrorNo > 0 then
ShowMessage('madExcept: LastHttpErrorNo - ' + string(lastHTTPErrorNo) +
' LastHttpErrorStr - ' + LastHttpErrorStr + ' LastHttpPostReply - ' + LastHttpPostReply);
end;

end;

Uses madExcept

The above does not work. If I step through the program after I "continue" in the madExcept dialog the program closes without processing that line, nor firing the FormClose event. How do I access these vars?
Thank you,
Chuck
madshi
Site Admin
Posts: 10753
Joined: Sun Mar 21, 2004 5:25 pm

Re: madExcept to MantisBT not working--Help!

Post by madshi »

These variables are only set after madExcept has tried to upload a bug report to Mantis. Did it try to do that?
CBelanger
Posts: 18
Joined: Wed Sep 12, 2018 11:39 pm

Re: madExcept to MantisBT not working--Help!

Post by CBelanger »

Yes, or at least that is what I thought I was doing with the supplied code, i.e. try to show a form that does not exist then when Continued in madExcept dialog, the program skips everything after the SHOWMODAL.
I have madExcept set up to automatically send the bug report. The progress bar shows, but it does not complete.
If I explicitly click on Send Bug Report and go through the steps then I get the "sorry, could not send the bug report" message, but again with "continue program" the Showmessage line is skipped, as well if I trace the code.

Any suggestions?
Thank you,
Chuck
madshi
Site Admin
Posts: 10753
Joined: Sun Mar 21, 2004 5:25 pm

Re: madExcept to MantisBT not working--Help!

Post by madshi »

Maybe there is no LastHttpErrorNo, meaning the HTTP upload itself went through? I'd still check the LastHttpPostReply, anyway.
CBelanger
Posts: 18
Joined: Wed Sep 12, 2018 11:39 pm

Re: madExcept to MantisBT not working--Help!

Post by CBelanger »

Guess I waited too long to submit my reply. Just lost it and this is a rewrite.

Bottom line for others: Was able to see those global vars in my test program's FormDestroy event.

There I saw that I was missing "mandatory field, user_errorreports".

Turns out I had added that field in the previous mantis site, but it really is redundant. Also, I had checked the property Mandatory in bug reports by accident. That alone resolved the issue, but I deleted the field too.

I still have the issue, which is probably a Mantis or Apache problem, with setting LocalHost as default in the httpd-vhost.conf file. Then I set up the mantisbt connection. The only way I can access Mantis via the web or madExcept is to make Mantisbt the default, otherwise I get Forbidden, you do not have permission to access this resource.
Will be asking about that on those forums.

Thank you,
Chuck
p.s. FYI: I am an acupuncturist who wrote a program to help practitioners move through a complicated mind-body protocol and released that in 2008. I am semi-retired now and we still have a few practitioners who use the program. Stopped selling it years ago now.
madshi
Site Admin
Posts: 10753
Joined: Sun Mar 21, 2004 5:25 pm

Re: madExcept to MantisBT not working--Help!

Post by madshi »

That's nice of you to still support the program. Glad to hear you got things working.
Post Reply