View Issue Details

IDProjectCategoryView StatusLast Update
0034849Plugin - EmailReportingGeneralpublic2024-11-14 16:20
Reporterfpaquet Assigned ToSL-Gundam  
PrioritynormalSeveritycrashReproducibilityalways
Status resolvedResolutionreopened 
Summary0034849: EMailReporting config page reports APPLICATION ERROR 0001502
Description

After Upgrade from Mantis 2.26.3 -> 2.27.0 we receive "APPLICATION ERROR 0001502" when trying
to open EMailReporting configuration page.


APPLICATION ERROR 0001502

Kategorie nicht gefunden.

Bitte benutzen Sie die „Zurück“-Taste Ihres Browsers, um auf die vorhergehende Seite zurückzukehren.
Dort können Sie den hier angezeigten Eintrag korrigieren oder eine andere Aktion ausführen.
Über das Menü können Sie auch direkt zu einer anderen Aktion wechseln.

Context
MantisBT-Version 2.27.0
Datenbankschema-Version 211
PHP-Version 8.2.20
Datenbanktreiber mysqli
Datenbankversion, Beschreibung 10.2.33, 10.2.33-MariaDB

Logfiles

  • nginx error.log - quiet, no messages
  • php-fpm error log - quiet, no messages
  • nginx access.log - page request visible

Issue reported in forum, by another user
https://mantisbt.org/forums/viewtopic.php?p=79943#p79943

TagsNo tags attached.

Activities

fpaquet

fpaquet

2024-10-13 03:59

reporter   ~0069327

Pse note that reporting bugs via E-Mail is working as expected.
Only Configuration page fails.

SL-Gundam

SL-Gundam

2024-10-13 18:11

manager   ~0069328

2.27 made a change to how categories worked.
Should be fixed now in 0.11.0-DEV
https://github.com/mantisbt-plugins/EmailReporting/commit/642cc9fe43065033052c8e84f4b5f7c43c2c7051

fpaquet

fpaquet

2024-10-16 03:08

reporter   ~0069346

Hello Gundam
Thanks for the quick fix.
I've just pulled the latest changes. (commit 7126420b)

There ist still another problem.
When saving mail account changes, we get error #200 (parameter global_category_id not found)

Steps to reproduce

  • open email config page
  • choose a mail account for editing
  • modify activation setting on top
  • save changes
Screenshot_2024-10-16_0907.png (87,090 bytes)   
Screenshot_2024-10-16_0907.png (87,090 bytes)   
fpaquet

fpaquet

2024-10-16 03:10

reporter   ~0069347

[root@madness-test:/var/www/html/support/plugins/EmailReporting] git branch

  • master

commit 642cc9fe43065033052c8e84f4b5f7c43c2c7051
Author: SL-Gundam SL-Gundam@users.noreply.github.com
Date: Mon Oct 14 00:10:17 2024 +0200

Fix MantisBT 2.27.0 category issue
SL-Gundam

SL-Gundam

2024-10-16 06:24

manager   ~0069348

I cannot reproduce this on my side.

Please do the following. Add the following code to your MantisBT config_inc.php
Try it again.

$g_show_detailed_errors = ON;

$g_display_errors = array(
    E_RECOVERABLE_ERROR => DISPLAY_ERROR_HALT,
    E_WARNING => DISPLAY_ERROR_HALT,
    E_NOTICE => DISPLAY_ERROR_HALT,
    E_USER_ERROR => DISPLAY_ERROR_HALT,
    E_USER_WARNING => DISPLAY_ERROR_HALT,
    E_USER_NOTICE => DISPLAY_ERROR_HALT,
    E_ALL => DISPLAY_ERROR_HALT,
    E_DEPRECATED => DISPLAY_ERROR_HALT
);
fpaquet

fpaquet

2024-10-16 07:45

reporter   ~0069349

Enabled debug settings.

Note: nginx and php-fpm error logs do not show any problems


/var/www/html/mantisbt-2.27.0/plugins/EmailReporting/pages/manage_mailbox_edit.php


14 $t_mailbox = array(
15 'enabled' => gpc_get_int( 'enabled', ON ),
16 'description' => gpc_get_string( 'description', '' ),
17 'mailbox_type' => gpc_get_string( 'mailbox_type' ),
18 'hostname' => gpc_get_string( 'hostname', '' ),
19 'port' => gpc_get_string( 'port', '' ),
20 'encryption' => gpc_get_string( 'encryption' ),
21 'ssl_cert_verify' => gpc_get_int( 'ssl_cert_verify', ON ),
22 'erp_username' => gpc_get_string( 'erp_username', '' ),
23 'erp_password' => base64_encode( gpc_get_string( 'erp_password', 23 '' ) ),
24 'auth_method' => gpc_get_string( 'auth_method' ),
25 'project_id' => gpc_get_int( 'project_id' ),
26 'global_category_id' => gpc_get_int( 'global_category_id' ),
27 // 'link_rules' => gpc_get_int_array( 'link_rules', array() ),
28 );

image.png (118,111 bytes)   
image.png (118,111 bytes)   
SL-Gundam

SL-Gundam

2024-10-16 08:43

manager   ~0069350

Is "Nicht zugewiesen" an existing category for your MantisBT environment?
Otherwise i don't know what is going wrong.

fpaquet

fpaquet

2024-10-16 09:14

reporter   ~0069351

Last edited: 2024-10-16 09:15

Yes there seams to be global category, at least shown on the project managment page.

The input field on the project page, it has category_id=1
<form method="post" action="manage_proj_cat_edit_page.php?category_id=1&project_id=0"

In the database table mantis_category_mantis, it exists with id=1 and project_id=0


The function gpc_get(line 68) seams to check POST and GET parameters only.

Browser inspector shows the POST Form Data as:
mailbox_action: edit
select_mailbox: 1
enabled: 1
description: Support-Prod
mailbox_type: IMAP
hostname: mail.opag.ch
port: 993
encryption: TLS
ssl_cert_verify: 1
erp_username: mantis
erp_password: c2lr8k@Fb^H
auth_method: LOGIN
imap_basefolder: INBOX.support-prod
imap_createfolderstructure: 0
project_id: 1


How comes that the category choice entries on the mail account page are all greyed out?
The first screenshot shows choice values before hitting "Edit" button.
The second screenshot shows category choice popup for project "CASYMIR"

image-2.png (14,450 bytes)   
image-2.png (14,450 bytes)   
image-3.png (28,277 bytes)   
image-3.png (28,277 bytes)   
SL-Gundam

SL-Gundam

2024-10-16 09:24

manager   ~0069352

I've found the problem.
You did not update the MantisBT schema. Please make sure you are running database Schema Version 213 and that the necessary categories are enabled.
With 2.27 a schema update is needed since categories can be enabled and disabled.
Initially all categories are disabled. The schema update enables them so that everything functions normally again.

fpaquet

fpaquet

2024-10-16 09:25

reporter   ~0069353

Could this possibly be related to the database scheme version?

I have
Datenbankschema-Version 211

First not in https://mantisbt.org/forums/viewtopic.php?p=79943#p79943
Database Schema Version 213

SL-Gundam

SL-Gundam

2024-10-16 09:25

manager   ~0069354

Disabled categories are not sent in the form which causes the error you were having.

SL-Gundam

SL-Gundam

2024-10-16 09:26

manager   ~0069355

Yes that is the issue.
Run this page on your installation: mantisBT/admin/

piotrusx

piotrusx

2024-11-12 12:58

reporter   ~0069442

I still have the same error after update to 2.27.
I installed the latest ER version 0.11.0-DEV including the fix.

piotrusx

piotrusx

2024-11-12 13:02

reporter   ~0069443

image-4.png (142,593 bytes)   
image-4.png (142,593 bytes)   
piotrusx

piotrusx

2024-11-13 05:01

reporter   ~0069444

I did a clean plugin install, but the same problem.

SL-Gundam

SL-Gundam

2024-11-13 08:36

manager   ~0069446

Did you update the MantisBT database schema?

piotrusx

piotrusx

2024-11-13 09:08

reporter   ~0069447

Yes.

image-5.png (7,937 bytes)   
image-5.png (7,937 bytes)   
fpaquet

fpaquet

2024-11-13 09:23

reporter   ~0069448

For me, it is working flawlessly after schema update to 213
note 0034849:0069355 lead to success

SL-Gundam

SL-Gundam

2024-11-13 15:28

reporter   ~0069449

Last edited: 2024-11-13 15:32

@piotrusx i cannot find the reason for the error you are encountering. Are you running any other plugins or modifications to MantisBT code?

piotrusx

piotrusx

2024-11-13 15:51

reporter   ~0069450

@SL-Gundam: no any modifications MantisBT code, standard plugins:

image-6.png (52,889 bytes)   
image-6.png (52,889 bytes)   
SL-Gundam

SL-Gundam

2024-11-13 15:59

reporter   ~0069451

I've found the problem. The default category with id 1 has been deleted from your MantisBT environment. The changes from MantisBT 2.27 and EmailReporting do not like this.
I'm going to see how to deal with this.
The quickfix for you would be to create a global category with id 1 but this would require you edit the database table with something like phpmyadmin.

piotrusx

piotrusx

2024-11-13 16:13

reporter   ~0069452

Yes, if I added category ID 1 it started working.

piotrusx

piotrusx

2024-11-13 16:14

reporter   ~0069453

image-7.png (41,837 bytes)   
image-7.png (41,837 bytes)   
SL-Gundam

SL-Gundam

2024-11-13 17:00

reporter   ~0069454

I think the code will need more work in the future but for now this should fix the issue.
https://github.com/mantisbt-plugins/EmailReporting/commit/f090959df67f494078c478185e442004e1d4a543

piotrusx

piotrusx

2024-11-14 04:37

reporter   ~0069455

Thank you for your help!

SL-Gundam

SL-Gundam

2024-11-14 16:20

reporter   ~0069456

I've made further changes to the function to improve it.
The only thing you will notice is that categories are no longer duplicated. Otherwise it will work the same as the above changes.

https://github.com/mantisbt-plugins/EmailReporting/commit/e9a78083c72c9f82bf247ebbbf28c547e59e1a7d