Debugging Mantis: What is "ERROR"?

Get help from other users here.

Moderators: Developer, Contributor

Post Reply
dserodio

Debugging Mantis: What is "ERROR"?

Post by dserodio »

I'm trying to debug LDAP authentication, and I see that there are a lot of debugging messages like:

Code: Select all

trigger_error( ERROR_LDAP_AUTH_FAILED, ERROR );
I see messages like "Cannot modify header information" in my syslog, but I can't find these (ldap auth failed) messages anywhere.
My PHP is a little rusty, so I googled a bit, and found that the trigger_error function takes a "message" and a "severity" parameter, but I haven't found this "ERROR" constant(?) anywhere.

How can I debug Mantis
thraxisp
Developer
Posts: 509
Joined: 14 Feb 2005, 03:38
Location: Ottawa, Canada
Contact:

Post by thraxisp »

The error constants are in core/constants_inc.php. These are indexes into the language strings ("MANTIS_ERROR[]") that are printed with the error handler.

There was a bug in the error handler in 0.19.2 where the handler didn't stop on some errors. Adding

$g_display_errors[E_WARNING] = 'inline';
$g_display_errors[E_USER_WARNING] = 'inline';

to your config_inc.php file will display the errors properly.
dserodio
Posts: 2
Joined: 29 Mar 2005, 21:20

Didn't work :-(

Post by dserodio »

Unfortunately, that didn't work. I added those lines to config_inc.php, and restarted Apache to be sure.

Since I'm trying to setup LDAP authentication, I tried to login (which failed) and expected error messages to show up on the logs somewhere. But they didn't. I grepped for 'mantis' in /var/log/* and only found "Cannot modify header information" warnings...

Also, I understand about the error constants, but don't understand what is the second argument to trigger_error(...), "ERROR".
thraxisp
Developer
Posts: 509
Joined: 14 Feb 2005, 03:38
Location: Ottawa, Canada
Contact:

Post by thraxisp »

The second argument to trigger_error is the error type. "trigger_error" is a standard php function.

The "headers already sent" messages imply that text has already been sent before the headers are sent. There may be some other error that is being ignored.

I'd look into the config_defaults_inc.php file and copy the $g_display_error array to your config_inc.php file. Change all of the actions to 'halt' to stop progress after any error. Setting "$g_show_detailed_errors = ON;" will also provide a traceback where the error is coming from.
dserodio
Posts: 2
Joined: 29 Mar 2005, 21:20

Still doesn't work

Post by dserodio »

I have put the following in my config_inc.php:

Code: Select all

$g_display_errors = array(
           E_WARNING => 'halt',
           E_NOTICE => 'halt',
           E_ERROR => 'halt',
           E_USER_ERROR => 'halt',
           E_WARNING => 'inline',
           E_USER_WARNING => 'inline',
           E_USER_NOTICE => 'halt'
);

$g_show_detailed_errors = ON;
But all I get when I try to login is "Your account may be disabled or blocked or the username/password you entered is incorrect.". No backtraces, and no specific LDAP errors.

I understand that the second argument to trigger_error(...) is the error type. What I don't understand is: which error type is the "ERROR" identifier refer to? Is "ERROR" a constant defined somewhere?

Thanks again.
thraxisp
Developer
Posts: 509
Joined: 14 Feb 2005, 03:38
Location: Ottawa, Canada
Contact:

Post by thraxisp »

The values for error_type are defined by PHP (see http://ca.php.net/manual/en/function.trigger-error.php).

The error messages from LDAP seem to be suppressed in core/ldap_api.php. You may want to instrument this code to debug it. Note that when you do this, you will probably see errors saying "headers already sent" based on the debug output.
Post Reply