Mantis Bugtracker          
testlink.org

View Issue Details Jump to Notes ] Issue History ] Print ]
IDProjectCategoryView StatusDate SubmittedLast Update
0007734TestLinkInstallerpublic2016-11-05 19:012016-11-05 19:01
Reporterqdevops 
Assigned To 
PriorityimmediateSeverityblockReproducibilityalways
StatusnewResolutionopen 
PlatformLinuxOSDebianOS VersionJessie
Product Version1.9.15 (2015 Q4) 
Fixed in Version 
Summary0007734: The installer only grant privileges to local user of mysql database, can not login if use database from another host
Descriptionif testlink and mysql are on different host, the installation can complete successfully.
However, click the testlink home link will show debug messages:
 ==============================================================================

 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:tlEvent - Method: writeToDB */ INSERT INTO events (transaction_id,log_level,description,source,fired_at,object_id,object_type,activity) VALUES (0,2,'','',1478371471,0,NULL,'')) called at [/var/www/html/lib/functions/logger.class.php:890]
#1 tlEvent->writeToDB(database Object ([db] => ADODB_mysqli Object ([databaseType] => mysqli,[dataProvider] => native,[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=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] => ,[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 %s (id int not null),[_genSeqCountSQL] => select count(*) from %s,[_genSeq2SQL] => insert into %s values (%s),[_dropSeqSQL] => drop table %s,[database] => myTest,[host] => mysql5,[user] => myTest,[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] => ,[_errorCode] => ,[_queryID] => ,[_isPersistentConnection] => ,[_evalAll] => ,[_affected] => ,[_logsql] => ,[_transmode] => ),[queries_array] => Array (),[is_connected] => ,[nQuery] => 0,[overallDuration] => 0,[dbType] => mysqli,[] => 0,[] => 0)) called at [/var/www/html/lib/functions/logger.class.php:1024]
0000002 tlDBLogger->writeEvent(tlEvent Object ([logLevel] => 2,[description] => E_WARNING
mysqli_real_connect(): (HY000/1045): Access denied for user 'myTest'@'172.17.0.10' (using password: YES) - in /var/www/html/third_party/adodb/drivers/adodb-mysqli.inc.php - Line 113,[source] => GUI,[timestamp] => 1478371471,[userID] => 0,[sessionID] => ,[transactionID] => ,[activityCode] => PHP,[objectID] => ,[objectType] => ,[transaction] => ,[] => ,[dbID] => ,[] => 4294967295,[] => ,[] => ,[] => ,[] => Array ([assignment_status] => assignment_status,[assignment_types] => assignment_types,[attachments] => attachments,[builds] => builds,[cfield_build_design_values] => cfield_build_design_values,[cfield_design_values] => cfield_design_values,[cfield_execution_values] => cfield_execution_values,[cfield_node_types] => cfield_node_types,[cfield_testplan_design_values] => cfield_testplan_design_values,[cfield_testprojects] => cfield_testprojects,[custom_fields] => custom_fields,[db_version] => db_version,[events] => events,[execution_bugs] => execution_bugs,[execution_tcsteps] => execution_tcsteps,[executions] => executions,[inventory] => inventory,[issuetrackers] => issuetrackers,[testproject_issuetracker] => testproject_issuetracker,[keywords] => keywords,[milestones] => milestones,[node_types] => node_types,[nodes_hierarchy] => nodes_hierarchy,[object_keywords] => object_keywords,[platforms] => platforms,[plugins] => plugins,[plugins_configuration] => plugins_configuration,[req_coverage] => req_coverage,[req_relations] => req_relations,[req_specs] => req_specs,[req_specs_revisions] => req_specs_revisions,[reqmgrsystems] => reqmgrsystems,[testproject_reqmgrsystem] => testproject_reqmgrsystem,[requirements] => requirements,[req_versions] => req_versions,[req_revisions] => req_revisions,[req_notify_assignments] => req_notify_assignments,[req_monitor] => req_monitor,[rights] => rights,[risk_assignments] => risk_assignments,[role_rights] => role_rights,[roles] => roles,[testcase_relations] => testcase_relations,[tcversions] => tcversions,[tcsteps] => tcsteps,[testcase_keywords] => testcase_keywords,[testplan_platforms] => testplan_platforms,[testplan_tcversions] => testplan_tcversions,[testplans] => testplans,[testprojects] => testprojects,[testsuites] => testsuites,[text_templates] => text_templates,[transactions] => transactions,[user_assignments] => user_assignments,[user_group] => user_group,[user_group_assign] => user_group_assign,[user_testplan_roles] => user_testplan_roles,[user_testproject_roles] => user_testproject_roles,[users] => users),[] => Array ([tcversions_last_active] => tcversions_last_active,[last_executions] => last_executions,[last_executions_by_platforms] => last_executions_by_platforms),[] => stdClass Object ([eventSource] => GUI,[logEnabled] => 1))) called at [/var/www/html/lib/functions/logger.class.php:553]
0000003 tlTransaction->writeEvent(tlEvent Object ([logLevel] => 2,[description] => E_WARNING
mysqli_real_connect(): (HY000/1045): Access denied for user 'myTest'@'172.17.0.10' (using password: YES) - in /var/www/html/third_party/adodb/drivers/adodb-mysqli.inc.php - Line 113,[source] => GUI,[timestamp] => 1478371471,[userID] => 0,[sessionID] => ,[transactionID] => ,[activityCode] => PHP,[objectID] => ,[objectType] => ,[transaction] => ,[] => ,[dbID] => ,[] => 4294967295,[] => ,[] => ,[] => ,[] => Array ([assignment_status] => assignment_status,[assignment_types] => assignment_types,[attachments] => attachments,[builds] => builds,[cfield_build_design_values] => cfield_build_design_values,[cfield_design_values] => cfield_design_values,[cfield_execution_values] => cfield_execution_values,[cfield_node_types] => cfield_node_types,[cfield_testplan_design_values] => cfield_testplan_design_values,[cfield_testprojects] => cfield_testprojects,[custom_fields] => custom_fields,[db_version] => db_version,[events] => events,[execution_bugs] => execution_bugs,[execution_tcsteps] => execution_tcsteps,[executions] => executions,[inventory] => inventory,[issuetrackers] => issuetrackers,[testproject_issuetracker] => testproject_issuetracker,[keywords] => keywords,[milestones] => milestones,[node_types] => node_types,[nodes_hierarchy] => nodes_hierarchy,[object_keywords] => object_keywords,[platforms] => platforms,[plugins] => plugins,[plugins_configuration] => plugins_configuration,[req_coverage] => req_coverage,[req_relations] => req_relations,[req_specs] => req_specs,[req_specs_revisions] => req_specs_revisions,[reqmgrsystems] => reqmgrsystems,[testproject_reqmgrsystem] => testproject_reqmgrsystem,[requirements] => requirements,[req_versions] => req_versions,[req_revisions] => req_revisions,[req_notify_assignments] => req_notify_assignments,[req_monitor] => req_monitor,[rights] => rights,[risk_assignments] => risk_assignments,[role_rights] => role_rights,[roles] => roles,[testcase_relations] => testcase_relations,[tcversions] => tcversions,[tcsteps] => tcsteps,[testcase_keywords] => testcase_keywords,[testplan_platforms] => testplan_platforms,[testplan_tcversions] => testplan_tcversions,[testplans] => testplans,[testprojects] => testprojects,[testsuites] => testsuites,[text_templates] => text_templates,[transactions] => transactions,[user_assignments] => user_assignments,[user_group] => user_group,[user_group_assign] => user_group_assign,[user_testplan_roles] => user_testplan_roles,[user_testproject_roles] => user_testproject_roles,[users] => users),[] => Array ([tcversions_last_active] => tcversions_last_active,[last_executions] => last_executions,[last_executions_by_platforms] => last_executions_by_platforms),[] => stdClass Object ([eventSource] => GUI,[logEnabled] => 1))) called at [/var/www/html/lib/functions/logger.class.php:473]
0000004 tlTransaction->add(2, E_WARNING
mysqli_real_connect(): (HY000/1045): Access denied for user 'myTest'@'172.17.0.10' (using password: YES) - in /var/www/html/third_party/adodb/drivers/adodb-mysqli.inc.php - Line 113, GUI, PHP, , ) called at [/var/www/html/lib/functions/logging.inc.php:106]
0000005 tLog(E_WARNING
mysqli_real_connect(): (HY000/1045): Access denied for user 'myTest'@'172.17.0.10' (using password: YES) - in /var/www/html/third_party/adodb/drivers/adodb-mysqli.inc.php - Line 113, WARNING, GUI, , , PHP) called at [/var/www/html/lib/functions/logging.inc.php:50]
0000006 logWarningEvent(E_WARNING
mysqli_real_connect(): (HY000/1045): Access denied for user 'myTest'@'172.17.0.10' (using password: YES) - in /var/www/html/third_party/adodb/drivers/adodb-mysqli.inc.php - Line 113, PHP) called at [/var/www/html/lib/functions/logger.class.php:1438]
0000007 watchPHPErrors(2, mysqli_real_connect(): (HY000/1045): Access denied for user 'myTest'@'172.17.0.10' (using password: YES), /var/www/html/third_party/adodb/drivers/adodb-mysqli.inc.php, 113, Array ([argHostname] => mysql5,[argUsername] => myTest,[argPassword] => myTest,[argDatabasename] => myTest,[persist] => ,[arr] => Array ([0] => 5,[1] => 0)))
0000008 mysqli_real_connect(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] => ), mysql5, myTest, myTest, myTest, 0, , 0) called at [/var/www/html/third_party/adodb/drivers/adodb-mysqli.inc.php:113]
0000009 ADODB_mysqli->_connect(mysql5, myTest, myTest, myTest) called at [/var/www/html/third_party/adodb/drivers/adodb-mysqli.inc.php:139]
0000010 ADODB_mysqli->_nconnect(mysql5, myTest, myTest, myTest) called at [/var/www/html/third_party/adodb/adodb.inc.php:553]
0000011 ADOConnection->Connect(mysql5, myTest, myTest, myTest, 1) called at [/var/www/html/third_party/adodb/adodb.inc.php:592]
0000012 ADOConnection->NConnect(mysql5, myTest, myTest, myTest) called at [/var/www/html/lib/functions/database.class.php:147]
#13 database->connect(, mysql5, myTest, myTest, myTest) called at [/var/www/html/lib/functions/common.php:145]
0000014 doDBConnect(database Object ([db] => ADODB_mysqli Object ([databaseType] => mysqli,[dataProvider] => native,[hasInsertID] => 1,[hasAffectedRows] => 1,[metaTablesSQL] => SELECT TABLE_NAME, CAS
Additional Information+------+-----------+
| User | Host |
+------+-----------+
| root | % |
| test | % |
| test | localhost |

Testlink create two mysql users which is OK.

+----------------------------------------------------+
| Grants for test@% |
+----------------------------------------------------+
| GRANT USAGE ON *.* TO 'test'@'%' |
| GRANT ALL PRIVILEGES ON `testlink`.* TO 'test'@'%' |
+----------------------------------------------------+

+-------------------------------------------------------------------------------------------------------------+
| Grants for test@localhost |
+-------------------------------------------------------------------------------------------------------------+
| GRANT USAGE ON *.* TO 'test'@'localhost' IDENTIFIED BY PASSWORD '*94BDCEBE19083CE2A1F959FD02F964C7AF4CFC29' |
| GRANT SELECT, INSERT, UPDATE, DELETE ON `testlink`.* TO 'test'@'localhost' |
+-------------------------------------------------------------------------------------------------------------+

we can see 'test'@'%' user don't have a password that cause testlink fail to connect to database if testlink and mysql are on different host.

To work around, run
mysql> SET PASSWORD FOR 'test'@'%' = PASSWORD('test');

After doing this, testlink can successfully show up.
 
TagsNo tags attached.
Database (MySQL,Postgres,etc)mysql
Browserfirefox
PHP Version5.6.27
TestCaseID
QA Team - Task Workflow Status
Attached Files

- Relationships

-  Notes
There are no notes attached to this issue.

- Issue History
Date Modified Username Field Change
2016-11-05 19:01 qdevops New Issue



Copyright © 2000 - 2019 MantisBT Team
Powered by Mantis Bugtracker