Page 1 of 2

APPLICATION ERROR #1802

Posted: 08 Feb 2022, 19:54
by mushu
Mantis 2.25.2
Windows Server 2012 R2

Code: Select all

APPLICATION ERROR #1802

Relationship not found.

Please use the "Back" button in your web browser to return to the previous page. There you can correct whatever problems were identified in this error or select another action. You can also click an option from the menu bar to go directly to a new section.
This happens on a single user Reporter account, every time they are added to a ticket as a monitor, and then when that ticket is closed. It still seems to work properly, it just throws that error for that account. Any suggestions?

Re: APPLICATION ERROR #1802

Posted: 01 Mar 2022, 23:03
by mushu
This is getting frustrating. Please someone (devs?) tell me what causes this error. Every time I add a certain user to monitor a ticket it gives this error and I want to know why and how to fix it:

APPLICATION ERROR #1802

Relationship not found.

Please use the "Back" button in your web browser to return to the previous page. There you can correct whatever problems were identified in this error or select another action. You can also click an option from the menu bar to go directly to a new section.

Re: APPLICATION ERROR #1802

Posted: 02 Mar 2022, 19:34
by atrol
Did you configure some own additional relationship types?

Re: APPLICATION ERROR #1802

Posted: 02 Mar 2022, 19:38
by mushu
Not that I know of, where would I see that?

Re: APPLICATION ERROR #1802

Posted: 02 Mar 2022, 19:46
by atrol
It's recommended to do that by creating file config/custom_relationships_inc.php

Re: APPLICATION ERROR #1802

Posted: 02 Mar 2022, 19:51
by mushu
I've never had to do that in the years we've used the software. Is this a new special requirement of some kind? The users are all the same kind, nothing new added to them, nobody is more special than anyone else, except for the access level assigned to each. 99% are all Reporters, with about a dozen coded as Developers, and me as Administrator. There has never been a custom_relationships_inc.php file in our config directory.

Re: APPLICATION ERROR #1802

Posted: 02 Mar 2022, 20:47
by mushu
It is possible this may need to be moved to the email plugin project instead. I set the logging to full with all details and here is the output. Note the "email template" text...

The code around line 1718 in core\email_api.php is as follows:

Code: Select all

## CN-start
## test CN to enable template for sending email
## setting required on config_inc.php :
## $g_use_mailtemplate = ON;
## here we also check if the mail template exists
	$templating = OFF;
	if ( ON == config_get( 'use_mailtemplate' ) )  {
		$template_definition = config_get( 'bug_mailtemplate' );
		if (file_exists($template_definition)) {
			$templating = ON;
		}
	}
	if ( $templating ) {
		$t_message = email_template_bug_message( $p_visible_bug_data, $t_message ); ## line 1718 here
	} else {
## CN-end
	$t_message .= email_format_bug_message( $p_visible_bug_data );
## CN-start
	}
## CN-end
Here is the error output:

Code: Select all

APPLICATION ERROR #1802

Relationship not found.

Please use the "Back" button in your web browser to return to the previous page. There you can correct whatever problems were identified in this error or select another action. You can also click an option from the menu bar to go directly to a new section.
Detailed error information
Full path: C:\MantisBT2252\core\error_api.php
Line number: 85
Stack trace
# Filename					Line	Class	Type	Function	Args
0 C:\MantisBT2252\core\relationship_api.php	618	-	-	relationship_type_ensure_valid	<string>''
1 C:\MantisBT2252\core\relationship_api.php	642	-	-	relationship_get_description_src_side	<string>''
2 C:\MantisBT2252\core\history_api.php		925	-	-	relationship_get_description_for_history	<string>''
3 C:\MantisBT2252\core\template_api.php		70	-	-	history_localize_item	<string>'', <string>'12', <string>'18', <string>'', <boolean>false
4 C:\MantisBT2252\core\email_api.php		1718	-	-	email_template_bug_message	<array> { ['email_bug'] => 3194, ['email_bug_view_url'] => 'http://server/view.php?id=3194', ['email_handler'] => 'user1', ['email_reporter'] => 'user1', ['email_project_id'] => '38', ['email_project'] => 'business_Website_and_CMS', ['email_category'] => 'Bug Fix', ['email_date_submitted'] => '1645650900', ['email_last_modified'] => '1646252318', ['email_status'] => '50', ['email_severity'] => '50', ['email_priority'] => '30', ['email_reproducibility'] => '70', ['email_resolution'] => '10', ['email_fixed_in_version'] => '', ['email_summary'] =>
... [cut] ...
 <mailto:user3@conteso.com> Phone: (509) 406-4083', ['email_additional_information'] => '', ['email_steps_to_reproduce'] => '', ['set_category'] => '[business_Website_and_CMS] Bug Fix', ['custom_fields'] => <array> { }, ['bugnotes'] => <array> { }, ['history'] => <array> { [0] => <array> { ['bug_id'] => '3194', ['date'] => '1645650900', ['userid'] => '10', ['username'] => 'user1', ['field'] => '', ['type'] => '1', ['old_value'] => '', ['new_value'] => '' }, [1] => <array> { ['bug_id'] => '3194', ['date'] => '1645650901', ['userid'] => '10', ['username'] => 'user1', ['field'] => '', ['type'] => '9', ['old_value'] => 'image001.jpg', ['new_value'] => '' }, [2] => <array> { ['bug_id'] => '3194', ['date'] => '1645650901', ['userid'] => '10', ['username'] => 'user1', ['field'] => '', ['type'] => '9', ['old_value'] => 'image002.jpg', ['new_value'] => '' }, [3] => <array> { ['bug_id'] => '3194', ['date'] => '1645650901', ['userid'] => '10', ['username'] => 'user1', ['field'] => '', ['type'] => '9', ['old_value'] => 'image003.jpg', ['new_value'] => '' }, [4] => <array> { ['bug_id'] => '3194', ['date'] => '1645650901', ['userid'] => '10', ['username'] => 'user1', ['field'] => '', ['type'] => '9', ['old_value'] => 'image004.jpg', ['new_value'] => '' }, [5] => <array> { ['bug_id'] => '3194', ['date'] => '1645650901', ['userid'] => '10', ['username'] => 'user1', ['field'] => '', ['type'] => '9', ['old_value'] => 'image005.png', ['new_value'] => '' }, [6] => <array> { ['bug_id'] => '3194', ['date'] => '1645651010', ['userid'] => '10', ['username'] => 'user1', ['field'] => '', ['type'] => '12', ['old_value'] => '877', ['new_value'] => '' }, [7] => <array> { ['bug_id'] => '3194', ['date'] => '1645651017', ['userid'] => '10', ['username'] => 'user1', ['field'] => '', ['type'] => '12', ['old_value'] => '689', ['new_value'] => '' }, [8] => <array> { ['bug_id'] => '3194', ['date'] => '1645651020', ['userid'] => '10', ['username'] => 'user1', ['field'] => 'handler_id', ['type'] => '0', ['old_value'] => '0', ['new_value'] => '10' }, [9] => <array> { ['bug_id'] => '3194', ['date'] => '1645651020', ['userid'] => '10', ['username'] => 'user1', ['field'] => 'status', ['type'] => '0', ['old_value'] => '10', ['new_value'] => '50' }, [10] => <array> { ['bug_id'] => '3194', ['date'] => '1645651027', ['userid'] => '10', ['username'] => 'user1', ['field'] => 'project_id', ['type'] => '0', ['old_value'] => '35', ['new_value'] => '38' }, [11] => <array> { ['bug_id'] => '3194', ['date'] => '1646175698', ['userid'] => '10', ['username'] => 'user1', ['field'] => '', ['type'] => '12', ['old_value'] => '18', ['new_value'] => '' }, [12] => <array> { ['bug_id'] => '3194', ['date'] => '1646252310', ['userid'] => '10', ['username'] => 'user1', ['field'] => '', ['type'] => '13', ['old_value'] => '18', ['new_value'] => '' }, [13] => <array> { ['bug_id'] => '3194', ['date'] => '1646252318', ['userid'] => '10', ['username'] => 'user1', ['field'] => '', ['type'] => '12', ['old_value'] => '18', ['new_value'] => '' } }, ['relations'] => '' }, <string>'Issue 0003194 is now monitored by user user2. '
5 C:\MantisBT2252\core\email_api.php		686	-	-	email_bug_info_to_one_user	<array> { ['email_bug'] => 3194, ['email_bug_view_url'] => 'http://CONapoly01:8888/view.php?id=3194', ['email_handler'] => 'user1', ['email_reporter'] => 'user1', ['email_project_id'] => '38', ['email_project'] => 'business_Website_and_CMS', ['email_category'] => 'Bug Fix', ['email_date_submitted'] => '1645650900', ['email_last_modified'] => '1646252318', ['email_status'] => '50', ['email_severity'] => '50', ['email_priority'] => '30', ['email_reproducibility'] => '70', ['email_resolution'] => '10', ['email_fixed_in_version'] => '', ['email_summary'] => 
... [cut] ...
 ['email_additional_information'] => '', ['email_steps_to_reproduce'] => '', ['set_category'] => '[business_Website_and_CMS] Bug Fix', ['custom_fields'] => <array> { }, ['bugnotes'] => <array> { }, ['history'] => <array> { [0] => <array> { ['bug_id'] => '3194', ['date'] => '1645650900', ['userid'] => '10', ['username'] => 'user1', ['field'] => '', ['type'] => '1', ['old_value'] => '', ['new_value'] => '' }, [1] => <array> { ['bug_id'] => '3194', ['date'] => '1645650901', ['userid'] => '10', ['username'] => 'user1', ['field'] => '', ['type'] => '9', ['old_value'] => 'image001.jpg', ['new_value'] => '' }, [2] => <array> { ['bug_id'] => '3194', ['date'] => '1645650901', ['userid'] => '10', ['username'] => 'user1', ['field'] => '', ['type'] => '9', ['old_value'] => 'image002.jpg', ['new_value'] => '' }, [3] => <array> { ['bug_id'] => '3194', ['date'] => '1645650901', ['userid'] => '10', ['username'] => 'user1', ['field'] => '', ['type'] => '9', ['old_value'] => 'image003.jpg', ['new_value'] => '' }, [4] => <array> { ['bug_id'] => '3194', ['date'] => '1645650901', ['userid'] => '10', ['username'] => 'user1', ['field'] => '', ['type'] => '9', ['old_value'] => 'image004.jpg', ['new_value'] => '' }, [5] => <array> { ['bug_id'] => '3194', ['date'] => '1645650901', ['userid'] => '10', ['username'] => 'user1', ['field'] => '', ['type'] => '9', ['old_value'] => 'image005.png', ['new_value'] => '' }, [6] => <array> { ['bug_id'] => '3194', ['date'] => '1645651010', ['userid'] => '10', ['username'] => 'user1', ['field'] => '', ['type'] => '12', ['old_value'] => '877', ['new_value'] => '' }, [7] => <array> { ['bug_id'] => '3194', ['date'] => '1645651017', ['userid'] => '10', ['username'] => 'user1', ['field'] => '', ['type'] => '12', ['old_value'] => '689', ['new_value'] => '' }, [8] => <array> { ['bug_id'] => '3194', ['date'] => '1645651020', ['userid'] => '10', ['username'] => 'user1', ['field'] => 'handler_id', ['type'] => '0', ['old_value'] => '0', ['new_value'] => '10' }, [9] => <array> { ['bug_id'] => '3194', ['date'] => '1645651020', ['userid'] => '10', ['username'] => 'user1', ['field'] => 'status', ['type'] => '0', ['old_value'] => '10', ['new_value'] => '50' }, [10] => <array> { ['bug_id'] => '3194', ['date'] => '1645651027', ['userid'] => '10', ['username'] => 'user1', ['field'] => 'project_id', ['type'] => '0', ['old_value'] => '35', ['new_value'] => '38' }, [11] => <array> { ['bug_id'] => '3194', ['date'] => '1646175698', ['userid'] => '10', ['username'] => 'user1', ['field'] => '', ['type'] => '12', ['old_value'] => '18', ['new_value'] => '' }, [12] => <array> { ['bug_id'] => '3194', ['date'] => '1646252310', ['userid'] => '10', ['username'] => 'user1', ['field'] => '', ['type'] => '13', ['old_value'] => '18', ['new_value'] => '' }, [13] => <array> { ['bug_id'] => '3194', ['date'] => '1646252318', ['userid'] => '10', ['username'] => 'user1', ['field'] => '', ['type'] => '12', ['old_value'] => '18', ['new_value'] => '' } }, ['relations'] => '' }, <string>'email_notification_title_for_action_monitor', <integer>10, <array> { [0] => '0003194', [1] => 'user2' }
6 C:\MantisBT2252\core\email_api.php		649	-	-	email_generic_to_recipients	<integer>3194, <string>'monitor', <array> { [10] => 'user1@conteso.com' }, <string>'email_notification_title_for_action_monitor', <array> { [0] => '0003194', [1] => 'user2' }
7 C:\MantisBT2252\core\email_api.php		707	-	-	email_generic	<integer>3194, <string>'monitor', <string>'email_notification_title_for_action_monitor', <array> { [0] => '0003194', [1] => 'user2' }, <array> { [0] => 18 }
8 C:\MantisBT2252\core\bug_api.php		2116	-	-	email_monitor_added	<integer>3194, <integer>18
9 C:\MantisBT2252\core\commands\MonitorAddCommand.php	116	-	-	bug_monitor	<integer>3194, <integer>18
10 C:\MantisBT2252\core\commands\Command.php	137	MonitorAddCommand	->	process	-
11 C:\MantisBT2252\bug_monitor_add.php		65	Command	->	execute	-

Re: APPLICATION ERROR #1802

Posted: 02 Mar 2022, 20:59
by atrol
Can't help as what you are showing is not an original version of core\email_api.php
Please contact the author of these changes.

Re: APPLICATION ERROR #1802

Posted: 03 Mar 2022, 09:42
by cas
So do you get the same error without enabling the mail-template functionality?

Re: APPLICATION ERROR #1802

Posted: 03 Mar 2022, 15:22
by mushu
No I do not. Turning off the templates on config file stops that error from happening.

Re: APPLICATION ERROR #1802

Posted: 03 Mar 2022, 16:37
by cas
Try this template_api.php, see if this takes away the error

Re: APPLICATION ERROR #1802

Posted: 03 Mar 2022, 16:45
by mushu
Still gives the same error. I only noticed a single line of code changed, is that correct?

Re: APPLICATION ERROR #1802

Posted: 03 Mar 2022, 16:59
by cas
yes only one line of code. I am trying to replay the issue to find out what goes wrong. So it happens when you add someone to monitor the issue?

Re: APPLICATION ERROR #1802

Posted: 03 Mar 2022, 17:20
by mushu
Correct. When I remove that person it doesn't happen. Then I add him back as a monitor and it happens again.

Re: APPLICATION ERROR #1802

Posted: 03 Mar 2022, 19:53
by cas
I cannot reproduce this error so wonder if any of your other plugins might interfere.
Which plugins do you have installed?
Also any other changes to core scripts?