APPLICATION ERROR #1802

Get help from other users here.

Moderators: Developer, Contributor

mushu
Posts: 349
Joined: 04 Jan 2017, 17:41

APPLICATION ERROR #1802

Post 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?
mushu
Posts: 349
Joined: 04 Jan 2017, 17:41

Re: APPLICATION ERROR #1802

Post 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.
atrol
Site Admin
Posts: 8366
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: APPLICATION ERROR #1802

Post by atrol »

Did you configure some own additional relationship types?
Please use Search before posting and read the Manual
mushu
Posts: 349
Joined: 04 Jan 2017, 17:41

Re: APPLICATION ERROR #1802

Post by mushu »

Not that I know of, where would I see that?
atrol
Site Admin
Posts: 8366
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: APPLICATION ERROR #1802

Post by atrol »

It's recommended to do that by creating file config/custom_relationships_inc.php
Please use Search before posting and read the Manual
mushu
Posts: 349
Joined: 04 Jan 2017, 17:41

Re: APPLICATION ERROR #1802

Post 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.
mushu
Posts: 349
Joined: 04 Jan 2017, 17:41

Re: APPLICATION ERROR #1802

Post 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	-
atrol
Site Admin
Posts: 8366
Joined: 26 Mar 2008, 21:37
Location: Germany

Re: APPLICATION ERROR #1802

Post 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.
Please use Search before posting and read the Manual
cas
Posts: 1586
Joined: 11 Mar 2006, 16:08
Contact:

Re: APPLICATION ERROR #1802

Post by cas »

So do you get the same error without enabling the mail-template functionality?
mushu
Posts: 349
Joined: 04 Jan 2017, 17:41

Re: APPLICATION ERROR #1802

Post by mushu »

No I do not. Turning off the templates on config file stops that error from happening.
cas
Posts: 1586
Joined: 11 Mar 2006, 16:08
Contact:

Re: APPLICATION ERROR #1802

Post by cas »

Try this template_api.php, see if this takes away the error
Attachments
template_api.zip
(7.35 KiB) Downloaded 431 times
mushu
Posts: 349
Joined: 04 Jan 2017, 17:41

Re: APPLICATION ERROR #1802

Post by mushu »

Still gives the same error. I only noticed a single line of code changed, is that correct?
cas
Posts: 1586
Joined: 11 Mar 2006, 16:08
Contact:

Re: APPLICATION ERROR #1802

Post 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?
mushu
Posts: 349
Joined: 04 Jan 2017, 17:41

Re: APPLICATION ERROR #1802

Post by mushu »

Correct. When I remove that person it doesn't happen. Then I add him back as a monitor and it happens again.
cas
Posts: 1586
Joined: 11 Mar 2006, 16:08
Contact:

Re: APPLICATION ERROR #1802

Post 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?
Post Reply