Mantis Bugtracker          
testlink.org

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0008773TestLinkDatabase MySQLpublic2019-09-23 14:502019-09-24 09:58
Reporterydc 
Assigned To 
PriorityhighSeveritymajorReproducibilityalways
StatusnewResolutionopen 
PlatformOSOS Version
Product Version1.9.19.01 (1.9.19 fixes) 
Fixed in Version 
Summary0008773: DB Access Error
DescriptionAfter upgrade to 1.9.19.01 and logging in, the following message is seen:

 ==============================================================================

 DB Access Error - debug_print_backtrace() OUTPUT START

 ATTENTION: Enabling more debug info will produce path disclosure weakness (CWE-200)

            Having this additional Information could be useful for reporting

            issue to development TEAM.

 ==============================================================================

#0 database->exec_query( /* Class:tlUser- Method:getAccessibleTestPlans- */ SELECT NH.id, NH.name, TPLAN.is_public, COALESCE(USER_TPLAN_ROLES.testplan_id,0) AS has_role, USER_TPLAN_ROLES.role_id AS user_testplan_role, TPLAN.active, 0 AS selected FROM nodes_hierarchy NH JOIN testplans TPLAN ON NH.id=TPLAN.id LEFT OUTER JOIN user_testplan_roles USER_TPLAN_ROLES ON TPLAN.id = USER_TPLAN_ROLES.testplan_id AND USER_TPLAN_ROLES.user_id = 1 WHERE testproject_id = 1 AND active = 1 AND NH.id = 35 AND ORDER BY name, -1, -1) called at [/var/www/html/lib/functions/database.class.php:759]
#1 database->get_recordset( /* Class:tlUser- Method:getAccessibleTestPlans- */ SELECT NH.id, NH.name, TPLAN.is_public, COALESCE(USER_TPLAN_ROLES.testplan_id,0) AS has_role, USER_TPLAN_ROLES.role_id AS user_testplan_role, TPLAN.active, 0 AS selected FROM nodes_hierarchy NH JOIN testplans TPLAN ON NH.id=TPLAN.id LEFT OUTER JOIN user_testplan_roles USER_TPLAN_ROLES ON TPLAN.id = USER_TPLAN_ROLES.testplan_id AND USER_TPLAN_ROLES.user_id = 1 WHERE testproject_id = 1 AND active = 1 AND NH.id = 35 AND ORDER BY name) called at [/var/www/html/lib/functions/tlUser.class.php:1046]
0000002 tlUser->getAccessibleTestPlans(database Object ([db] => ADODB_mysqli Object ([databaseType] => mysqli,[dataProvider] => mysql,[hasInsertID] => 1,[hasAffectedRows] => 1,[metaTablesSQL] => SELECT
            TABLE_NAME,
            CASE WHEN TABLE_TYPE = 'VIEW' THEN 'V' ELSE 'T' END
        FROM INFORMATION_SCHEMA.TABLES
        WHERE TABLE_SCHEMA=,[metaColumnsSQL] => SHOW COLUMNS FROM `%s`,[fmtTimeStamp] => 'Y-m-d H:i:s',[hasLimit] => 1,[hasMoveFirst] => 1,[hasGenID] => 1,[isoDates] => 1,[sysDate] => CURDATE(),[sysTimeStamp] => NOW(),[hasTransactions] => 1,[forceNewConnect] => 1,[poorAffectedRows] => 1,[clientFlags] => 0,[substr] => substring,[port] => 3306,[socket] => ,[_bindInputArray] => ,[nameQuote] => `,[optionFlags] => Array ([0] => Array ([0] => 5,[1] => 0)),[arrayClass] => ADORecordSet_array_mysqli,[multiQuery] => ,[_genIDSQL] => update %s set id=LAST_INSERT_ID(id+1);,[_genSeqSQL] => create table if not exists %s (id int not null),[_genSeqCountSQL] => select count(*) from %s,[_genSeq2SQL] => insert into %s values (%s),[_dropSeqSQL] => drop table if exists %s,[database] => testlink,[host] => mysql-testlink,[user] => admin,[password] => not stored,[debug] => ,[maxblobsize] => 262144,[concat_operator] => +,[length] => length,[random] => rand(),[upperCase] => upper,[fmtDate] => 'Y-m-d',[true] => 1,[false] => 0,[replaceQuote] => \',[charSet] => ,[metaDatabasesSQL] => ,[uniqueOrderBy] => ,[emptyDate] => ,[emptyTimeStamp] => ,[lastInsID] => ,[hasTop] => ,[readOnly] => ,[genID] => 0,[raiseErrorFn] => ,[cacheSecs] => 3600,[memCache] => ,[memCacheHost] => ,[memCachePort] => 11211,[memCacheCompress] => ,[sysUTimeStamp] => ,[noNullStrings] => ,[numCacheHits] => 0,[numCacheMisses] => 0,[pageExecuteCountRows] => 1,[uniqueSort] => ,[leftOuter] => ,[rightOuter] => ,[ansiOuter] => ,[autoRollback] => ,[fnExecute] => ,[fnCacheExecute] => ,[blobEncodeType] => ,[rsPrefix] => ADORecordSet_,[autoCommit] => 1,[transOff] => 0,[transCnt] => 0,[fetchMode] => 2,[null2null] => null,[bulkBind] => ,[_oldRaiseFn] => ,[_transOK] => ,[_connectionID] => mysqli Object ([affected_rows] => ,[client_info] => ,[client_version] => ,[connect_errno] => ,[connect_error] => ,[errno] => ,[error] => ,[error_list] => ,[field_count] => ,[host_info] => ,[info] => ,[insert_id] => ,[server_info] => ,[server_version] => ,[stat] => ,[sqlstate] => ,[protocol_version] => ,[thread_id] => ,[warning_count] => ),[_errorMsg] => You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ORDER BY name' at line 1,[_errorCode] => ,[_queryID] => 1,[_isPersistentConnection] => ,[_evalAll] => ,[_affected] => ,[_logsql] => ,[_transmode] => ,[*connectionParameters] => Array (),[databaseName] => testlink),[queries_array] => Array (),[is_connected] => 1,[nQuery] => 0,[overallDuration] => 0,[dbType] => mysqli,[databaselogEnabled] => 0,[databaselogQueries] => 0), 1, 35) called at [/var/www/html/lib/functions/common.php:442]
0000003 initProject(database Object ([db] => ADODB_mysqli Object ([databaseType] => mysqli,[dataProvider] => mysql,[hasInsertID] => 1,[hasAffectedRows] => 1,[metaTablesSQL] => SELECT
            TABLE_NAME,
            CASE WHEN TABLE_TYPE = 'VIEW' THEN 'V' ELSE 'T' END
        FROM INFORMATION_SCHEMA.TABLES
        WHERE TABLE_SCHEMA=,[metaColumnsSQL] => SHOW COLUMNS FROM `%s`,[fmtTimeStamp] => 'Y-m-d H:i:s',[hasLimit] => 1,[hasMoveFirst] => 1,[hasGenID] => 1,[isoDates] => 1,[sysDate] => CURDATE(),[sysTimeStamp] => NOW(),[hasTransactions] => 1,[forceNewConnect] => 1,[poorAffectedRows] => 1,[clientFlags] => 0,[substr] => substring,[port] => 3306,[socket] => ,[_bindInputArray] => ,[nameQuote] => `,[optionFlags] => Array ([0] => Array ([0] => 5,[1] => 0)),[arrayClass] => ADORecordSet_array_mysqli,[multiQuery] => ,[_genIDSQL] => update %s set id=LAST_INSERT_ID(id+1);,[_genSeqSQL] => create table if not exists %s (id int not null),[_genSeqCountSQL] => select count(*) from %s,[_genSeq2SQL] => insert into %s values (%s),[_dropSeqSQL] => drop table if exists %s,[database] => testlink,[host] => mysql-testlink,[user] => admin,[password] => not stored,[debug] => ,[maxblobsize] => 262144,[concat_operator] => +,[length] => length,[random] => rand(),[upperCase] => upper,[fmtDate] => 'Y-m-d',[true] => 1,[false] => 0,[replaceQuote] => \',[charSet] => ,[metaDatabasesSQL] => ,[uniqueOrderBy] => ,[emptyDate] => ,[emptyTimeStamp] => ,[lastInsID] => ,[hasTop] => ,[readOnly] => ,[genID] => 0,[raiseErrorFn] => ,[cacheSecs] => 3600,[memCache] => ,[memCacheHost] => ,[memCachePort] => 11211,[memCacheCompress] => ,[sysUTimeStamp] => ,[noNullStrings] => ,[numCacheHits] => 0,[numCacheMisses] => 0,[pageExecuteCountRows] => 1,[uniqueSort] => ,[leftOuter] => ,[rightOuter] => ,[ansiOuter] => ,[autoRollback] => ,[fnExecute] => ,[fnCacheExecute] => ,[blobEncodeType] => ,[rsPrefix] => ADORecordSet_,[autoCommit] => 1,[transOff] => 0,[transCnt] => 0,[fetchMode] => 2,[null2null] => null,[bulkBind] => ,[_oldRaiseFn] => ,[_transOK] => ,[_connectionID] => mysqli Object ([affected_rows] => ,[client_info] => ,[client_version] => ,[connect_errno] => ,[connect_error] => ,[errno] => ,[error] => ,[error_list] => ,[field_count] => ,[host_info] => ,[info] => ,[insert_id] => ,[server_info] => ,[server_version] => ,[stat] => ,[sqlstate] => ,[protocol_version] => ,[thread_id] => ,[warning_count] => ),[_errorMsg] => You have an error in your SQL syntax; check the manual that corresponds to your MySQL server version for the right syntax to use near 'ORDER BY name' at line 1,[_errorCode] => ,[_queryID] => 1,[_isPersistentConnection] => ,[_evalAll] => ,[_affected] => ,[_logsql] => ,[_transmode] => ,[*connectionParameters] => Array (),[databaseName] => testlink),[queries_array] => Array (),[is_connected] => 1,[nQuery] => 0,[overallDuration] => 0,[dbType] => mysqli,[databaselogEnabled] => 0,[databaselogQueries] => 0), Array ([tproject_id] => 0,[tplan_id] => 0,[updateMainPage] => 1)) called at [/var/www/html/lib/functions/common.php:508]
0000004 testlinkInitPage(database Object ([db] => ADODB_mysqli Object ([databaseType] => mysqli,[dataProvider] => mysql,[hasInsertID] => 1,[hasAffectedRows] => 1,[metaTablesSQL] => SELECT
            TABLE_NAME,
            CASE WHEN TABLE_TYPE = 'VIEW' THEN 'V' ELSE 'T' END
        FROM INFORMATION_SCHEMA.TABLES
        WHERE TABLE_SCHEMA=,[metaColumnsSQL] => SHOW COLUMNS FROM `%s`,[fmtTimeStamp] => 'Y-m-d H:i:s',[hasLimit] => 1,[hasMoveFirst] => 1,[hasGenID] => 1,[isoDates] => 1,[sysDate] => CURDATE(),[sysTimeStamp] => NOW(),[hasTransactions] => 1,[forceNewConn
TagsNo tags attached.
Database (MySQL,Postgres,etc)MySQL
BrowserFirefox
PHP Version7.2.22
TestCaseID
QA Team - Task Workflow Status
Attached Files

- Relationships

-  Notes
(0029210)
fman (administrator)
2019-09-23 16:08
edited on: 2019-09-23 16:10

Dear user
the issue can be related to the upgrade procedure

have you tried to run the offending SQL against the db using a sql client, to get more info?

SELECT NH.id, NH.name, TPLAN.is_public, COALESCE(USER_TPLAN_ROLES.testplan_id,0) AS has_role, USER_TPLAN_ROLES.role_id AS user_testplan_role, TPLAN.active, 0 AS selected FROM nodes_hierarchy NH JOIN testplans TPLAN ON NH.id=TPLAN.id LEFT OUTER JOIN user_testplan_roles USER_TPLAN_ROLES ON TPLAN.id = USER_TPLAN_ROLES.testplan_id AND USER_TPLAN_ROLES.user_id = 1 WHERE testproject_id = 1 AND active = 1 AND NH.id = 35 AND ORDER BY name

this is a wrong sql AND ORDER BY name

Think the issue has been fixed in next release => latest code from github

(0029211)
ydc (reporter)
2019-09-24 09:00
edited on: 2019-09-24 09:58

Thank you, Francisco.

I have downloaded the latest code from github, resulting in installing version 1.9.20. Ran the SQL statements to modify the DB to be compliant for version 1.9.20, copied the php-files for our environment to the root folder and started everything.

However, when going to the login page, it is completely white. Looking in the logs, the following is seen:

[Tue Sep 24 08:44:34.532897 2019] [php7:error] [pid 17] [client x.x.x.x:49413] PHP Fatal error: Uncaught --> Smarty: Unable to load template 'file:main.tpl' <-- \n thrown in /var/www/html/vendor/smarty/smarty/libs/sysplugins/smarty_internal_template.php on line 195


These are the software versions:
MySQL 5.7.27
PHP 7.2.22
Apache 2.4.38

(0029212)
fman (administrator)
2019-09-24 09:56

hi,
ok, I'm going to check if there is some file that has not been commited.

stay tunned

- Issue History
Date Modified Username Field Change
2019-09-23 14:50 ydc New Issue
2019-09-23 16:08 fman Note Added: 0029210
2019-09-23 16:10 fman Note Edited: 0029210 View Revisions
2019-09-24 09:00 ydc Note Added: 0029211
2019-09-24 09:56 fman Note Added: 0029212
2019-09-24 09:58 ydc Note Edited: 0029211 View Revisions



Copyright © 2000 - 2019 MantisBT Team
Powered by Mantis Bugtracker