MantisBT - TestLink
View Issue Details
0006363TestLinkBug Tracking System - JIRA Integrationpublic2014-06-05 04:382015-04-02 04:48
ankkitpal 
fman 
highblockalways
closedfixed 
WindowsWIN 7
1.9.10 (2014 Q1 - bug fixing) 
1.9.13 (2015 #1) 
MSSQL SERVER 2012
Chrome
5.5.12
READY FOR TESTING
0006363: Testlink 1.9.10 cannot connect to JIRA 5.2 using jiradbinterface
I tried to integrate JIRA with Testlink1.9.10 using the jiradbinterface. After all the configuration settings(like php sqlsrv driver installation, SQL server 2012 native client installation) i was not able to integrate the JIRA & testlink.
when i click the spanner it shows indicator of connection problem and tooltip says "connection is KO. detailed messages on testlink event log". Further checked in the testlink logs : it shows the error:
Connect to Bug Tracker database fails: (interface: - Host:
->dbhost - DBName:
->dbname - User:
->dbuser) -33 - SQLState: IMSSP
Error Code: -33
Message: Invalid value type for option Database was specified. String type was expected.
SQLState: IMSSP
Error Code: -33
Message: Invalid value type for option Database was specified. String type was expected.

From the very start i was feeling like its a typecasting problem in the code so i searched over the net for any promising solution but no luck. After all i tried to debug the code myself and found the problem.

Root Cause: The configurations(host,user etc) are passed as the xml object while these are expected to be of type string.
when i var_dump the object of cfg in the adodb.inc.php all the configs were passed as xml object. So to resolve this i typecasted the values into string and passed them to the calling function connect in the issueTrackerInterface class. And guess what - "BINGO" that was it.
you can refer to my post over testlink forum here: http://forum.testlink.org/viewtopic.php?f=1&t=7595 [^]
- Set the configurations in Issue tracker management section.
- click on the wrench icon to test the connection.
- it shows "connection is KO. detailed messages on testlink event log"
- check the userlog it says:
Connect to Bug Tracker database fails: (interface: - Host:
->dbhost - DBName:
->dbname - User:
->dbuser) -33 - SQLState: IMSSP
Error Code: -33
Message: Invalid value type for option Database was specified. String type was expected.
SQLState: IMSSP
Error Code: -33
Message: Invalid value type for option Database was specified. String type was expected.
i was able to set a workaround for it. so i can lead you to the exact point of the problem :
The workaround i have used is:
1. Open file issueTrackerInterface.class.php (<testlinkDir>\lib\issuetrackerintegration\)
2. Goto the line 178 (in function Connect):
$result = $this->dbConnection->connect(false, $this->cfg->dbhost,$this->cfg->dbuser,
$this->cfg->dbpassword, $this->cfg->dbname);
3. comment this line(in step 2).
4. paste these lines instead:
$mydbhost = (string)($this->cfg->dbhost);
$mydbuser = (string)($this->cfg->dbuser);
$mydbpassword = (string)($this->cfg->dbpassword);
$mydbname = (string)($this->cfg->dbname);

$result = $this->dbConnection->connect(false, $mydbhost,$mydbuser,$mydbpassword, $mydbname);
5. Save your file. And its done. ; )

Being a QA and very new to PHP this may not be the best solution to the problem but it worked for me. So, hoping you guys can fix this as per your standard code base in the next release.

You can refer the attached doc for screenshots.
No tags attached.
docx JiraIssue.docx (106,260) 2014-06-05 04:38
http://mantis.testlink.org/file_download.php?file_id=3731&type=bug
log Loguserlog1.log (820) 2014-09-09 05:50
http://mantis.testlink.org/file_download.php?file_id=3830&type=bug
Issue History
2014-06-05 04:38ankkitpalNew Issue
2014-06-05 04:38ankkitpalFile Added: JiraIssue.docx
2014-06-05 16:35fmanQA Team - Task Workflow Status => READY FOR TESTING
2014-06-05 16:35fmanStatusnew => resolved
2014-06-05 16:35fmanFixed in Version => 1.9.11 (2014 Q2 - bug fixing)
2014-06-05 16:35fmanResolutionopen => fixed
2014-06-05 16:35fmanAssigned To => fman
2014-06-06 05:23ankkitpalNote Added: 0021041
2014-06-06 05:55fmanNote Added: 0021045
2014-06-06 06:09ankkitpalNote Added: 0021048
2014-06-06 09:43fmanNote Added: 0021050
2014-06-06 09:47ankkitpalNote Added: 0021051
2014-06-06 09:50ankkitpalNote Edited: 0021051bug_revision_view_page.php?bugnote_id=21051#r3554
2014-07-28 20:33fmanStatusresolved => closed
2014-09-09 05:49ankkitpalNote Added: 0021587
2014-09-09 05:49ankkitpalStatusclosed => assigned
2014-09-09 05:49ankkitpalResolutionfixed => reopened
2014-09-09 05:50ankkitpalFile Added: Loguserlog1.log
2014-09-09 05:50ankkitpalNote Edited: 0021587bug_revision_view_page.php?bugnote_id=21587#r3723
2015-04-01 21:07Mr.BricodageNote Added: 0023021
2015-04-02 04:48fmanStatusassigned => closed
2015-04-02 04:48fmanResolutionreopened => fixed
2015-04-02 04:48fmanFixed in Version1.9.11 (2014 Q2 - bug fixing) => 1.9.13 (2015 #1)

Notes
(0021041)
ankkitpal   
2014-06-06 05:23   
Did the changes working fine on your end. Coz i tried with the new Issuetrackerintegration file and it dint work at my side. Please check.

Thanks,
Ankit Pal
(0021045)
fman   
2014-06-06 05:55   
Please provide more info that ... dint work at my side ...
I will try to check why thi overwrite did not work
(0021048)
ankkitpal   
2014-06-06 06:09   
Hi fman,
I mean it still produces the same error(mentioned in the description of original issue) in the userlog1 "Invalid value type for option Database was specified. String type was expected."
And i guess the typecasting to string dint work(i am not sure why, dont really have much idea about PHP).
You can check if you are able to connect to MSSQL.
Let me know if you need any more info about that.

a question for curiosity: is it not a good practice like i have handled it(mentioned in additional info section), i mean using different variables? (just for my knowledge i am asking this)
(0021050)
fman   
2014-06-06 09:43   
>> a question for curiosity: is it not a good practice like i have handled
>> it(mentioned in additional info section), i mean using different variables? >> (just for my knowledge i am asking this)
No without a good reason and IMHO there is no in this situation.( you polute the function ecosystem)

I'm going to test next week on a MSSQL 2012 and provide feedback
(0021051)
ankkitpal   
2014-06-06 09:47   
(edited on: 2014-06-06 09:50)
:-P Thanks for answering Fman. Please Test and share your experience.

(0021587)
ankkitpal   
2014-09-09 05:49   
(edited on: 2014-09-09 05:50)
Hi Fman,

I just installed 1.9.11 build but still seeing the connectivity issue. and getting the same error as mentioned in the "Steps To Reproduce" section of this issue. attached is the logs

(0023021)
Mr.Bricodage   
2015-04-01 21:07   
fixed in version 1.9.11 ?
To be closed?