View Issue Details

IDProjectCategoryView StatusLast Update
0024572mantisbtdb mssqlpublic2023-07-03 14:48
Reporterghirschy Assigned Todregad  
PrioritynormalSeveritymajorReproducibilityalways
Status closedResolutionunable to reproduce 
Product Version2.14.0 
Summary0024572: When opening the summary tab APPLICATION ERROR 0000401 is displayed
Description

We use MSSQL and the summary page could not be displayed.
We have used Mantis for 2 months now. In the past the summary was correctly displayed.

Steps To Reproduce

Open Summary tab

TagsNo tags attached.
Attached Files

Relationships

related to 0019952 closeddregad error when click on Summary Link - APPLICATION ERROR 0000401 

Activities

dregad

dregad

2018-06-28 18:52

developer   ~0060191

In the past the summary was correctly displayed.

So the question is, what has changed between "the past" and now (upgrades, etc) ?

Please provide further details, including the offending SQL query.

ghirschy

ghirschy

2018-06-29 08:20

reporter   ~0060195

This is a new installation of Mantis, we didn't upgrade.
After the installation and for some time the Summary page was displayed correctly.

Where should I found de offending SQL query.
I'm attaching an image of what I see.

Thanks

Mantis.PNG (16,171 bytes)   
Mantis.PNG (16,171 bytes)   
dregad

dregad

2018-06-29 08:46

developer   ~0060196

Please follow these steps:

  1. temporarily configure your system as follows:
    $g_display_errors = array(
    E_WARNING => 'halt',
    E_NOTICE => 'halt',
    E_USER_ERROR => 'halt',
    E_USER_WARNING => 'halt',
    E_USER_NOTICE => 'halt'
    );
    $g_show_detailed_errors = ON;

WARNING - SECURITY RISK: the 'show_detailed_errors' config can cause MantisBT to display sensitive information about your system. We recommend to restrict its activation to a Test environment, only for as long as necessary. If possible, do not turn it ON globally, instead limit it for specific user(s) using the Manage Configuration page.

  1. Reproduce the error

If the output does not help you resolving the issue and you need further assistance,

  1. save the output of the error screen, preferably as an HTML page (not a screenshot !)
  2. be careful to remove/mask any confidential information if needed
  3. upload the results here
ghirschy

ghirschy

2018-06-29 09:03

reporter   ~0060197

Thanks

Here is the page

Resumen - MantisBT.htm (12,728 bytes)   
<!DOCTYPE html>
<html><head>
	<meta http-equiv="Content-type" content="text/html; charset=UTF-8">
	<title>Resumen - MantisBT</title>
<meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
<meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0">
	<link rel="stylesheet" type="text/css" href="Resumen%20-%20MantisBT_files/default.css">
	<link rel="stylesheet" type="text/css" href="Resumen%20-%20MantisBT_files/status_config.css">
	<link rel="stylesheet" type="text/css" href="Resumen%20-%20MantisBT_files/dropzone-4.css">
	<link rel="stylesheet" type="text/css" href="Resumen%20-%20MantisBT_files/bootstrap-3.css">
	<link rel="stylesheet" type="text/css" href="Resumen%20-%20MantisBT_files/font-awesome-4.css">
	<link rel="stylesheet" type="text/css" href="Resumen%20-%20MantisBT_files/fonts.css">
	<link rel="stylesheet" type="text/css" href="Resumen%20-%20MantisBT_files/bootstrap-datetimepicker-4.css">
	<link rel="stylesheet" type="text/css" href="Resumen%20-%20MantisBT_files/ace.css">
	<link rel="stylesheet" type="text/css" href="Resumen%20-%20MantisBT_files/ace-mantis.css">
	<link rel="stylesheet" type="text/css" href="Resumen%20-%20MantisBT_files/ace-skins.css">

	<link rel="shortcut icon" href="http://192.168.1.202:88/images/favicon.ico" type="image/x-icon">
	<link rel="search" type="application/opensearchdescription+xml" title="MantisBT: Búsqueda de texto completo" href="http://192.168.1.202:88/browser_search_plugin.php?type=text">
	<link rel="search" type="application/opensearchdescription+xml" title="MantisBT: buscar por ID de incidencia" href="http://192.168.1.202:88/browser_search_plugin.php?type=id">
	<script type="text/javascript" src="Resumen%20-%20MantisBT_files/javascript_config.php"></script>
	<script type="text/javascript" src="Resumen%20-%20MantisBT_files/javascript_translations.php"></script>
	<script type="text/javascript" src="Resumen%20-%20MantisBT_files/jquery-2.js"></script>
	<script type="text/javascript" src="Resumen%20-%20MantisBT_files/dropzone-4.js"></script>
	<script type="text/javascript" src="Resumen%20-%20MantisBT_files/common.js"></script>

</head>
<body class="skin-3">
<style>
* { font-family: "Open Sans"; } 
h1, h2, h3, h4, h5 { font-family: "Open Sans"; } 
</style>
<div id="navbar" class="navbar navbar-default navbar-collapse navbar-fixed-top noprint"><div id="navbar-container" class="navbar-container"><button id="menu-toggler" type="button" class="navbar-toggle menu-toggler pull-left hidden-lg hidden-md" data-target="#sidebar"><span class="sr-only">Toggle sidebar</span><span class="icon-bar"></span><span class="icon-bar"></span><span class="icon-bar"></span></button><div class="navbar-header"><a href="http://192.168.1.202:88/my_view_page.php" class="navbar-brand"><span class="smaller-75"> MantisBT </span></a><button type="button" class="navbar-toggle navbar-toggle collapsed pull-right hidden-sm hidden-md hidden-lg" data-toggle="collapse" data-target=".navbar-buttons,.navbar-menu"><span class="sr-only">Toggle user menu</span><i class="ace-icon fa fa-user fa-2x white"></i> </button></div><div class="navbar-buttons navbar-header navbar-collapse collapse"><ul class="nav ace-nav"><li class="hidden-sm hidden-xs"><div class="btn-group btn-corner padding-right-8 padding-left-8"><a class="btn btn-primary btn-sm" href="http://192.168.1.202:88/bug_report_page.php"><i class="fa fa-edit"></i> Reportar incidencia</a><a class="btn btn-primary btn-sm" href="http://192.168.1.202:88/manage_user_create_page.php"><i class="fa fa-user-plus"></i> Invitar usuarios</a></div></li><li class="grey" id="dropdown_projects_menu">
<a data-toggle="dropdown" href="#" class="dropdown-toggle">
&nbsp;Todos los proyectos&nbsp;
 <i class="ace-icon fa fa-angle-down bigger-110"></i>
</a>
<ul class="dropdown-menu dropdown-menu-right dropdown-yellow dropdown-caret dropdown-close scrollable-menu">
<li class="active"><a href="http://192.168.1.202:88/set_project.php?project_id=0">Todos los proyectos </a></li>
<li class="divider"></li>
<li><div id="projects-list"><div class="projects-searchbox"><input class="search form-control input-md" placeholder="Buscar"></div><ul class="list dropdown-yellow no-margin"><li><a href="http://192.168.1.202:88/set_project.php?project_id=1" class="project-link"> CAMS </a></li><li><a href="http://192.168.1.202:88/set_project.php?project_id=8" class="project-link"> Guardia </a></li><li><a href="http://192.168.1.202:88/set_project.php?project_id=5" class="project-link"> HCE </a></li><li><a href="http://192.168.1.202:88/set_project.php?project_id=4" class="project-link"> Modulos </a></li></ul></div></li></ul>
</li>
<li class="grey"><a data-toggle="dropdown" href="#" class="dropdown-toggle"><i class="ace-icon fa fa-user fa-2x white"></i> <span class="user-info">Guillermo</span><i class="ace-icon fa fa-angle-down"></i></a><ul class="user-menu dropdown-menu dropdown-menu-right dropdown-yellow dropdown-caret dropdown-close"><li><a href="http://192.168.1.202:88/account_page.php"><i class="ace-icon fa fa-user"> </i> Mi cuenta</a></li><li><a href="http://192.168.1.202:88/issues_rss.php?username=Guillermo&amp;key=fWu_ug0ez27ps83NTLiLjjpIr9BYYl_ZQgAZ2MznDlFzChB6D_du-J2DiktkSbM0JdNEQnRKMkozkw8-Nv9f"><i class="ace-icon fa fa-rss-square orange"> </i> RSS</a></li><li class="divider"></li><li><a href="http://192.168.1.202:88/logout_page.php"><i class="ace-icon fa fa-sign-out"> </i> Salir</a></li></ul></li></ul></div></div></div><div class="main-container" id="main-container" style="padding-top: 45px;">
<div id="sidebar" class="sidebar sidebar-fixed responsive compact "><ul class="nav nav-list"><li>
<a href="http://192.168.1.202:88/my_view_page.php">
<i class="menu-icon fa fa-dashboard"></i> 
<span class="menu-text"> Mi Vista </span>
</a>
<b class="arrow"></b>
</li>
<li>
<a href="http://192.168.1.202:88/view_all_bug_page.php">
<i class="menu-icon fa fa-list-alt"></i> 
<span class="menu-text"> Ver incidencias </span>
</a>
<b class="arrow"></b>
</li>
<li>
<a href="http://192.168.1.202:88/bug_report_page.php">
<i class="menu-icon fa fa-edit"></i> 
<span class="menu-text"> Reportar incidencia </span>
</a>
<b class="arrow"></b>
</li>
<li>
<a href="http://192.168.1.202:88/changelog_page.php">
<i class="menu-icon fa fa-retweet"></i> 
<span class="menu-text"> Registro de cambios </span>
</a>
<b class="arrow"></b>
</li>
<li>
<a href="http://192.168.1.202:88/roadmap_page.php">
<i class="menu-icon fa fa-road"></i> 
<span class="menu-text"> Hoja de ruta </span>
</a>
<b class="arrow"></b>
</li>
<li class="active">
<a href="http://192.168.1.202:88/summary_page.php">
<i class="menu-icon fa fa-bar-chart-o"></i> 
<span class="menu-text"> Resumen </span>
</a>
<b class="arrow"></b>
</li>
<li>
<a href="http://192.168.1.202:88/wiki.php?type=project&amp;id=0">
<i class="menu-icon fa fa-book"></i> 
<span class="menu-text"> Wiki </span>
</a>
<b class="arrow"></b>
</li>
<li>
<a href="http://192.168.1.202:88/manage_overview_page.php">
<i class="menu-icon fa fa-gears"></i> 
<span class="menu-text"> Administración </span>
</a>
<b class="arrow"></b>
</li>
</ul><div class="sidebar-toggle sidebar-collapse"><i data-icon2="ace-icon fa fa-angle-double-right" data-icon1="ace-icon fa fa-angle-double-left" class="ace-icon fa fa-angle-double-left"></i></div></div><div class="main-content">
<div id="breadcrumbs" class="breadcrumbs noprint">
<ul class="breadcrumb">
  <li><i class="fa fa-user home-icon active"></i>  <a href="http://192.168.1.202:88/account_page.php">Guillermo ( Guillermo ) </a>
  <span class="label hidden-xs label-default arrowed">administrador</span></li>
</ul>
<div class="nav-recent hidden-xs">Visitadas recientemente: <a href="http://192.168.1.202:88/view.php?id=63" title="[asignada] nutricionista Marcela no puede registrar en HCE ambulatorio">0000063</a>, <a href="http://192.168.1.202:88/view.php?id=86" title="[testing] Ficha de egreso hospital día">0000086</a>, <a href="http://192.168.1.202:88/view.php?id=36" title="[asignada] el registro de Frecuencia cardiaca no queda registrado en cuadricula de enfermeria">0000036</a>, <a href="http://192.168.1.202:88/view.php?id=76" title="[resuelta] Visualización NOI completo" class="resolved">0000076</a>, <a href="http://192.168.1.202:88/view.php?id=84" title="[asignada] No ENVIO de mensajes  a los usuarios que tienen reserva .....">0000084</a></div><div id="nav-search" class="nav-search"><form class="form-search" method="post" action="/jump_to_bug.php"><span class="input-icon"><input name="bug_id" autocomplete="off" class="nav-search-input" placeholder="Incidencia #" type="text"><i class="ace-icon fa fa-search nav-search-icon"></i></span></form></div>
</div>
  <div class="page-content">
<div class="row">
<div class="col-md-12 col-xs-12"><div class="space-20"></div>
<div class="alert alert-danger">
<p class="bold">APPLICATION ERROR #401</p>
<p></p>
<div class="error-info">Utilice el botón «Atrás» de su navegador web 
para volver a la página anterior.  Allí puede corregir los problemas que
 han sido identificados en esta notificación de error o seleccionar otra
 acción.  También puede hacer click sobre una opción de la barra de menú
 para ir directamente a una nueva sección.</div>
	<div class="error-details">
		<hr>
		<h2>Detailed error information</h2>
		<ul>
			<li>Full path:
				<span class="code">
					C:\inetpub\wwwroot\Mantisbt\core\classes\DbQuery.class.php				</span>
			</li>
			<li>Line number:
				<span class="code">293</span>
			</li>
		</ul>
	</div>
	<h3>Stack trace</h3>
		<div class="table-responsive">
			<table class="table table-bordered table-striped table-condensed">
				<tbody><tr>
					<th>#</th>
					<th>Filename</th>
					<th>Line</th>
					<th>Class</th>
					<th>Type</th>
					<th>Function</th>
					<th>Args</th>
				</tr>
<tr>
<td>0</td>
<td>C:\inetpub\wwwroot\Mantisbt\core\classes\DbQuery.class.php</td>
<td>293</td>
<td>-</td>
<td>-</td>
<td>trigger_error</td>
<td>&lt;string&gt;'401', &lt;integer&gt;256</td>
</tr>
<tr>
<td>1</td>
<td>C:\inetpub\wwwroot\Mantisbt\core\classes\DbQuery.class.php</td>
<td>787</td>
<td>DbQuery</td>
<td>-&gt;</td>
<td>db_execute</td>
<td>&lt;integer&gt;-1, &lt;integer&gt;-1</td>
</tr>
<tr>
<td>2</td>
<td>C:\inetpub\wwwroot\Mantisbt\core\database_api.php</td>
<td>313</td>
<td>DbQuery</td>
<td>::</td>
<td>compat_db_query</td>
<td>&lt;string&gt;'SELECT COUNT(DISTINCT(b.id))
				FROM {bug} b
				LEFT JOIN {bug_history} h
				ON b.id = h.bug_id
				AND h.type = 0
				AND h.field_name = \'status\'
				WHERE b.status &gt;= ?
				AND h.old_value &lt; ?
				AND h.new_value &gt;= ?
				AND (? &lt;= date_modified + 86400)
				AND  project_id IN (1,8,5,4)', &lt;array&gt; { [0] =&gt; 80, [1] 
=&gt; 80, [2] =&gt; 80, [3] =&gt; 1530277015 }, &lt;integer&gt;-1, 
&lt;integer&gt;-1, &lt;boolean&gt;true</td>
</tr>
<tr>
<td>3</td>
<td>C:\inetpub\wwwroot\Mantisbt\core\summary_api.php</td>
<td>342</td>
<td>-</td>
<td>-</td>
<td>db_query</td>
<td>&lt;string&gt;'SELECT COUNT(DISTINCT(b.id))
				FROM {bug} b
				LEFT JOIN {bug_history} h
				ON b.id = h.bug_id
				AND h.type = 0
				AND h.field_name = \'status\'
				WHERE b.status &gt;= ?
				AND h.old_value &lt; ?
				AND h.new_value &gt;= ?
				AND (? &lt;= date_modified + 86400)
				AND  project_id IN (1,8,5,4)', &lt;array&gt; { [0] =&gt; 80, [1] =&gt; 80, [2] =&gt; 80, [3] =&gt; 1530277015 }</td>
</tr>
<tr>
<td>4</td>
<td>C:\inetpub\wwwroot\Mantisbt\core\summary_api.php</td>
<td>355</td>
<td>-</td>
<td>-</td>
<td>summary_resolved_bug_count_by_date</td>
<td>&lt;integer&gt;1</td>
</tr>
<tr>
<td>5</td>
<td>C:\inetpub\wwwroot\Mantisbt\summary_page.php</td>
<td>216</td>
<td>-</td>
<td>-</td>
<td>summary_print_by_date</td>
<td>&lt;array&gt; { [0] =&gt; 1, [1] =&gt; 2, [2] =&gt; 3, [3] =&gt; 7, 
[4] =&gt; 30, [5] =&gt; 60, [6] =&gt; 90, [7] =&gt; 180, [8] =&gt; 365 }</td>
</tr>
</tbody></table></div></div></div>	<script type="text/javascript" src="Resumen%20-%20MantisBT_files/bootstrap-3.js"></script>
	<script type="text/javascript" src="Resumen%20-%20MantisBT_files/moment-with-locales-2.js"></script>
	<script type="text/javascript" src="Resumen%20-%20MantisBT_files/bootstrap-datetimepicker-4.js"></script>
	<script type="text/javascript" src="Resumen%20-%20MantisBT_files/typeahead.js"></script>
	<script type="text/javascript" src="Resumen%20-%20MantisBT_files/list-1.js"></script>
	<script type="text/javascript" src="Resumen%20-%20MantisBT_files/ace.js"></script>


</div></div></div></div></body></html>
Resumen - MantisBT.htm (12,728 bytes)   
dregad

dregad

2018-06-29 10:02

developer   ~0060198

I can't reproduce this on my dev box, but I'm on MySQL. I don't know if it's caused by a data problem or something specific to MSSQL. I don't have access to an sql server environment so I'm afraid there is not much I can do to help. Did you try to manually execute the offending query ?

Also, you have not fully answered my earlier question: what has changed between "the past" and now (upgrades, etc) ? It could be a change in system configuration, database settings...

dregad

dregad

2018-06-29 10:09

developer   ~0060199

@cproensa as a side note, I'm surprised that the 401 error is not printing the offending SQL or even the actual Database query failed. Error received from database was #%1$d: %2$s for the query: %3$s. message - any idea why ?

ghirschy

ghirschy

2018-06-29 11:10

reporter   ~0060200

Also, you have not fully answered my earlier question: what has changed between "the past" and now (upgrades, etc) ? It could be a change in system configuration, database settings...
Nothing was changed, we only used more.

As I see on your previus note you expect to see the final sql query. Is this correct? I Would like to see the final query already "translated" to MSSQL

ghirschy

ghirschy

2018-06-29 11:29

reporter   ~0060201

I found a similar issue created: 0019952: error when click on Summary Link - APPLICATION ERROR 0000401

ghirschy

ghirschy

2018-07-12 08:53

reporter   ~0060254

Hi, any news about it. Can I see the offending query?

cproensa

cproensa

2019-01-07 14:16

developer   ~0061160

example of the query for summary_resolved_bug_count_by_date

SELECT COUNT(DISTINCT(b.id)) FROM mantis_bug_table b LEFT JOIN mantis_bug_history_table h ON b.id = h.bug_id AND h.type = 0 AND h.field_name = 'status' WHERE b.status >= 80 AND h.old_value &lt; 80 AND h.new_value >= 80 AND (1546888303 &lt;= date_modified + 86400) AND project_id IN (1,3,4)

summary works fine out of the box... so i suspect it may be related to some value in a field?

@cproensa as a side note, I'm surprised that the 401 error is not printing the offending SQL or even the actual Database query failed. Error received from database was #%1$d: %2$s for the query: %3$s. message - any idea why ?

i don't know, if i could reproduce it, then i could investigate.

Silvio2020

Silvio2020

2020-02-02 22:20

reporter   ~0063559

Hi,
I've juste performed an OOTB installation. Everything seems to be fine except the summary page.
No custom fields, and when I click on the Summary Page, I get:

INTERNAL APPLICATION ERROR
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.

Any ideas?
Thank you!

Silvio2020

Silvio2020

2020-02-02 23:00

reporter   ~0063560

Following up on my previous post...

MantisBT Version 2.23.0
PHP Version 7.2.27
MantisBT Database Information
Schema Version 210
ADOdb Version 5.20.15

Mantis Error.PNG (253,928 bytes)   
Mantis Error.PNG (253,928 bytes)   
dregad

dregad

2020-02-03 03:48

developer   ~0063562

@Silvio2020 your issue is different - you probably just need to enable the PHP JSON extension on your server.

dregad

dregad

2020-02-03 04:04

developer   ~0063563

Hi, any news about it. Can I see the offending query?

@ghirschy you can see the query leading to the error in the .htm file you attached:

SELECT COUNT(DISTINCT(b.id)) FROM {bug} b LEFT JOIN {bug_history} h ON b.id = h.bug_id AND h.type = 0 AND h.field_name = 'status' WHERE b.status >= ? AND h.old_value &lt; ? AND h.new_value >= ? AND (? &lt;= date_modified + 86400) AND project_id IN (1,8,5,4)

and the parameters
{ [0] => 80, [1] => 80, [2] => 80, [3] => 1530277015 }

With this, you need to try to figure out why the query is failing on your DB; it could be a data issue, or maybe a problem with date conversion but that's just a wild guess.

ghirschy

ghirschy

2020-02-03 07:41

reporter   ~0063564

Hello.
I have to execute this query in the DB
SELECT COUNT(DISTINCT(b.id)) FROM mantis_bug_table b LEFT JOIN mantis_bug_history_table h ON b.id = h.bug_id AND h.type = 0 AND h.field_name = 'status'
WHERE b.status >= 80 AND h.old_value < 80 AND h.new_value >= 80 AND (1530277015 <= date_modified + 86400) AND project_id IN (1,8,5,4)
I have results in that query.
In your query MSSQL don't like <

dregad

dregad

2020-02-03 08:51

developer   ~0063565

In your query MSSQL don't like <

What do you mean by that ?

ghirschy

ghirschy

2020-02-03 09:06

reporter   ~0063566

i mean & l t ; don't execute y have to change it for <

dregad

dregad

2020-02-03 09:54

developer   ~0063567

i mean & l t ; don't execute y have to change it for <

Ah yes sorry that's a known bug in Mantis. You can ignore that, indeed replacing with '<' is correct.

So if I understand correctly, when you manually run the query against your DB you get no error, but when Mantis does it fails ?

ghirschy

ghirschy

2020-02-03 09:58

reporter   ~0063568

yes

dregad

dregad

2020-02-03 10:23

developer   ~0063569

There could be some difference in the way Mantis connects to the DB, vs what your SQL client does.
I'm sorry, but not being able to reproduce and not having access to MSSQL instance for further testing, I'm running out of ideas here and won't be able to help you much more...

cproensa

cproensa

2020-02-03 16:57

developer   ~0063571

I have to execute this query in the DB
SELECT COUNT(DISTINCT(b.id)) FROM mantis_bug_table b LEFT JOIN mantis_bug_history_table h ON b.id = ....

That query was removed in version 2.20
Which version are you running?, can you test latest one?

ghirschy

ghirschy

2020-02-04 06:54

reporter   ~0063573

2.14.0
Later today I will update the Mantis. I let you know

dregad

dregad

2023-06-23 12:27

developer   ~0067860

ghirschy,

You did not provide any feedback; I am therefore resolving this issue as "no change required".

Feel free to reopen the issue at a later time and provide the requested information.