Testlink 1.9.10 with JIRA 5.2 WITH MSSQL problem

Ask community to help.

Moderators: Amaradana, TurboPT, TL Developers

Testlink 1.9.10 with JIRA 5.2 WITH MSSQL problem

Postby ankkitpal » Wed May 21, 2014 8:47 am

Hello everyone,

Brief about problem: i am trying to integrate the JIRA(hosted on mssql) with the testlink 1.9.10(hosted on wamp2.2) but facing problem with it.

Steps that i have followed:
• Installed wampserver2.2e-php5.4.3-httpd2.2.22-mysql5.5.24-32b
• Installed the testlink 1.9.10
• Created a testproject
• Configure the Issue tracker mgmt.
o Copied the template for JIRA db interface and modified it with my jira details
o Removed all the commented lines.
 <issuetracker>
 <jiraversion>5.2</jiraversion>
 <dbhost>192.168.xxx.xxx</dbhost>
 <dbname>jiradbname</dbname>
 <dbtype>mssql</dbtype>
 <dbuser>jirauser</dbuser>
 <dbpassword>jirauserPwd</dbpassword>
 <uriview>http://jira.xxx.com/browse/</uriview>
 <uricreate>http://jira.xxx.com/secure/CreateIssue.jspa</uricreate>
 <resolvedstatus>
 <status><code>80</code><verbose>resolved</verbose></status>
 <status><code>90</code><verbose>closed</verbose></status>
 </resolvedstatus>
 </issuetracker>
o Saved the connection and clicked on the Spanner to test the connection
o Error: mssqlnative extension not installed

I searched many forums and got an impression that it seems that there is some problem with the mssql drivers for php. But i tried many proposed solution over the net but none of them worked for me. So i reinstalled everything and stopped on the very first problem statement for someone to guide me in the right direction.

However earlier, i was able to set up the integration jira with the testlink 1.9.3
Can someone please guide me through this tough time. its been around 1 week since i am stuck.

i am new joiner to this community please let me know if i miss any info which might help you to help me.
ankkitpal
TestLink user
 
Posts: 14
Joined: Tue May 20, 2014 7:02 pm

Re: Testlink 1.9.10 integration with JIRA 5.2 problem

Postby ankkitpal » Wed May 21, 2014 9:30 am

To add further i have followed the instruction here http://www.php.net/manual/en/sqlsrv.requirements.php and installed the sqlsrv driver to my php 5.4.
Now, the error "mssqlnative extension not installed" is gone. but still i cannot connect to jira. And now, 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.

Any idea guys??? :( :'(
ankkitpal
TestLink user
 
Posts: 14
Joined: Tue May 20, 2014 7:02 pm

Re: Testlink 1.9.10 integration with JIRA 5.2 problem

Postby fman » Wed May 21, 2014 7:43 pm

1. try using integration via SOAP or REST
2. never tried this kind of integration via DB with M$SQL
3. Used M$SQL as TESTLINK DB but using XAMPP not WAMP
fman
Member of TestLink Community
 
Posts: 3059
Joined: Tue Nov 15, 2005 7:19 am

Re: Testlink 1.9.10 integration with JIRA 5.2 problem

Postby ankkitpal » Thu May 22, 2014 4:16 am

Hi Fman, Thanks for your comments. But i really dont have the idea of REST or SOAP interface. would it be possible for you to explain those in simple terms for me plz?
especially the following tags and what exactly we need to specify in those:

REST :
<issuetracker>
<uribase>https://testlink.atlassian.net/</uribase>
<uriapi>https://testlink.atlassian.net/rest/api/latest/</uriapi>
<projectkey>JIRA PROJECT KEY</projectkey>
<issuetype>JIRA ISSUE TYPE</issuetype>
</issuetracker>

SOAP:

<issuetracker>
<uribase>http://testlink.atlassian.net/</uribase>
<uriwsdl>http://testlink.atlassian.net/rpc/soap/jirasoapservice-v2?wsdl</uriwsdl>
<projectkey>JIRA PROJECT KEY</projectkey>
<issuetype>JIRA ISSUE TYPE</issuetype>
<resolvedstatus>
<status><code>5</code><verbose>Resolved</verbose></status>
<status><code>6</code><verbose>Closed</verbose></status>
</resolvedstatus>
</issuetracker>

Your help is appreciated!
ankkitpal
TestLink user
 
Posts: 14
Joined: Tue May 20, 2014 7:02 pm

Re: Testlink 1.9.10 integration with JIRA 5.2 problem

Postby fman » Thu May 22, 2014 5:27 am

I do not think my explanations can be good enough.
IMHO what you have to do is to give a look to JIRA documentation regarding API
I will choose REST and not SOAP.
You can also try to contact people in forum that is using JIRA => browse the forum for the ISSUE TRACKING INTEGRATION (or something similar) area.
If you search JIRA you are going to hit it.
These users use everyday JIRA => they surely will be able to help you.
fman
Member of TestLink Community
 
Posts: 3059
Joined: Tue Nov 15, 2005 7:19 am

Re: Testlink 1.9.10 integration with JIRA 5.2 problem

Postby ankkitpal » Thu May 22, 2014 6:07 am

Thanks a lot Fman. :)
ankkitpal
TestLink user
 
Posts: 14
Joined: Tue May 20, 2014 7:02 pm

Re: Testlink 1.9.10 integration with JIRA 5.2 problem

Postby ankkitpal » Mon Jun 02, 2014 4:14 pm

Hi,

Regarding the integration problem through JIRA db interface, i think there is something wrong either with the configuration given as example(on the JIRA UI) or in the coding part. Because initially it seems to be an issue of the mssql drivers but now i tried with a simple php program to fetch the records from JIRA DB and it worked just fine. Also, from the error in the logs....
>>>Error Code: -33
>>>Message: Invalid value type for option Database was specified. String type was expected.
it seems that:
*) either its a mistake in the config i have set. ( especially any specific value, though i cant find which one as all are correct to my knowledge)
*) or, any particular field is incorrectly typecast in the code behind
Would someone from the testlink DEV team be able to check it? it will be great help. Or is there anyone else who have achieved the integration using the db interface?
Please suggest.
ankkitpal
TestLink user
 
Posts: 14
Joined: Tue May 20, 2014 7:02 pm

Re: Testlink 1.9.10 integration with JIRA 5.2 problem

Postby TurboPT » Tue Jun 03, 2014 3:25 am

I don't have MSSQL, or know which MSSQL version you might have, but I might be able to help...

Is there anything at Documentation for JIRA 5.2 (JIRA to SQL Server) that could be helpful?

From the information there, and based on the error about DB 'type' that you noted, section 4.2 claims the need to have:
Code: Select all
<database-type>mssql</database-type>

...which might possibly be a replacement for:
Code: Select all
<dbtype>mssql</dbtype>

Not sure if that change will help get past that particular error [or not], so it would be curious if you can try that change, at least to see if that -33 error might get resolved.

In the same 4.2 section, there is also a mention of needing a:
Code: Select all
<schema-name>dbo</schema-name>

present too, in case that might be the next error that you encounter. Modify the 'dbo' portion to match your config.

Other than that, there are two things not clear [to me, at least]:
1. What config/settings may have been used in the "simple php program", and how these might differ from TestLink?
2. Does testlink and MSSQL exist together on the same server, or are each of these on two different machines?
TurboPT
Member of TestLink Community
 
Posts: 337
Joined: Sun Dec 10, 2006 4:51 am

Re: Testlink 1.9.10 integration with JIRA 5.2 problem

Postby fman » Tue Jun 03, 2014 6:31 pm

@TurboPT. Welcomed Back!!!
Thanks for providing help
fman
Member of TestLink Community
 
Posts: 3059
Joined: Tue Nov 15, 2005 7:19 am

Re: Testlink 1.9.10 integration with JIRA 5.2 problem

Postby TurboPT » Tue Jun 03, 2014 8:21 pm

@fman
No problem!, but I've not gone anywhere...

I do check the forums about every 2 or 3 days. It has either been relatively quiet [especially since the domain change late last year], or you had already responded to the posts that I could answer.
TurboPT
Member of TestLink Community
 
Posts: 337
Joined: Sun Dec 10, 2006 4:51 am

Re: Testlink 1.9.10 integration with JIRA 5.2 problem

Postby ankkitpal » Wed Jun 04, 2014 4:12 am

Hi TurboPT, thanks a lot for your reply. i have tried with the configs suggested in the Documentation for JIRA 5.2 (JIRA to SQL Server) section4.2 But that make the things even worse and i am getting the error "Missing file: D:\wamp\www\testlink-1.9.10\third_party\adodb/drivers/adodb-.inc.php
ADONewConnection: Unable to load database driver '' though adodb.inc.php is present. Further i feel about this document is that these configs are something what JIRA expects in order to communicate to its DB, and not the testlink(or any other app which is trying to access the JIRA DB). I could be wrong but let me know what do you think?

Regarding your questions:
>>>I don't have MSSQL, or know which MSSQL version you might have
we are having MS SQL SERVER 2012 on which JIRA DB is hosted.

>>>Does testlink and MSSQL exist together on the same server, or are each of these on two different machines?
MSSQL server and testlink are hosted on different machines.

>>>What config/settings may have been used in the "simple php program", and how these might differ from TestLink?
I guess its the only dbtype which we are not providing in the simple program and calling the sqlsrv_connect directly with the required arguments.(i am very new to php so might have missed some key difference).
the simple program i mentioned is:
<?php

$servername = "192.168.xxx.xxx";
$uid = "jirauser";
$pwd = "jirapwd";
$connectionInfo = array (
"UID"=>$uid,
"PWD"=>$pwd,
"Database"=>"jira"
);
$conn = sqlsrv_connect($servername, $connectionInfo);

if ($conn === false) {
echo "ERROR: DB Connection";
die(print_r(sqlsrv_errors(), true));

}
$stmt = sqlsrv_query($conn, "select top 1 * from dbo.issuetype");

if ($stmt) {
while ($row = sqlsrv_fetch_array($stmt)) {
echo $row[0].'<br/>';
}
}

?>

The above program gives me the result of the query on the browser. I tried to look into the code of testlink and think it takes the dbtype to decide which connect method to call Though i am new to php but i am trying to understand the flow by looking at the code. Will post if i find anything useful :( i am desperate to get this done.
Thanks again for your help guys!
ankkitpal
TestLink user
 
Posts: 14
Joined: Tue May 20, 2014 7:02 pm

Re: Testlink 1.9.10 integration with JIRA 5.2 problem

Postby fman » Wed Jun 04, 2014 4:45 am

IMHO here there is lot of confusion then, I will try to do a restart.

1. forget for a while JIRA integration an configure TestLink for using MSSQL: Does this work OK?
this is first answer i need.

2. have you googled for this error: Missing file: D:\wamp\www\testlink-1.9.10\third_party\adodb/drivers/adodb-.inc.php ?
READ CAREFULLY the file nam D:\wamp\www\testlink-1.9.10\third_party\adodb/drivers/adodb-.inc.php
did not see something unusual ? the - before .inc , this normally means thta ADODB has not recognized the STRING used to identify the driver
fman
Member of TestLink Community
 
Posts: 3059
Joined: Tue Nov 15, 2005 7:19 am

Re: Testlink 1.9.10 with JIRA 5.2 WITH MSSQL problem

Postby ankkitpal » Wed Jun 04, 2014 10:20 am

[RESOLVED]
Being a noob in the PHP it took me around 7 hrs of sourcecode debugging to find the root cause of the problem (testlink cannot connect to the MSSQL DB). which seems to be a bug to me.
as from the error >>>Message: Invalid value type for option Database was specified. String type was expected.
i was feeling from the starting that there is surely something wrong with the code/configuration of the testlink for db interface. After searching for days i finally decide to look in the source code itself and finally i have a working instance integrated with JIRA.

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.
Someone from the testlink DEV team need to confirm the same and fix it in the next release. Can i post this to dev team somehow? for more details you can mail me at pal.ankit2010@gmail.com

@Fman & @TurboPT: Thanks a lot guys for your replies and help.
For Other Users who are facing the same problem i have a simple solution for you guys:
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.
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. ; )
please see this is how i get this worked. lets hope testlink dev guys will provide a solution to this soon.

Thanks guys!
ankkitpal
TestLink user
 
Posts: 14
Joined: Tue May 20, 2014 7:02 pm

Re: Testlink 1.9.10 with JIRA 5.2 WITH MSSQL problem

Postby TurboPT » Wed Jun 04, 2014 11:45 am

@ankkitpal
Thanks [a million!], to you as well, for taking the time to troubleshoot and post your findings. I'm sure the info can be helpful to others.

The only thing I would have been able to do to try and help, would have been a MSSQL Express edition install, but I noted [from other links at the 5.2 docs] that JIRA recommends AGAINST the express editions.

I believe I saw that you had a stackoverflow entry about this? If so, please post your finding there too!
TurboPT
Member of TestLink Community
 
Posts: 337
Joined: Sun Dec 10, 2006 4:51 am

Re: Testlink 1.9.10 with JIRA 5.2 WITH MSSQL problem

Postby ankkitpal » Wed Jun 04, 2014 12:18 pm

@TurboPT: You are welcomed. and yes i already have updated the stackoverflow entry too so that no one else should struggle with it. That's the motive of having things on forum. : )
i have two questions for you though:
1) is it possible to raise this as a bug in the Testlink? if yes, where ?
2) Are you a testlink user or you are from the dev team? (sorry i am very new to this forum)
ankkitpal
TestLink user
 
Posts: 14
Joined: Tue May 20, 2014 7:02 pm

Next

Return to Installation and configuration



Who is online

Users browsing this forum: No registered users and 1 guest