Page 1 of 1

Another case of "Can not authenticate client:..."

Posted: Tue Nov 09, 2010 7:54 pm
by mkbutler
In short:
I'm getting the error "2000:Can not authenticate client: invalid developer key" when I try to connect to TestLink. The DevKey that is being sent is correct and the URL is correct too I'm still getting the error.

I've followed the code through to the method 'basicConnection' in the class TestLinkAdaptor. What is in the variables there is what should be there.

Where should I look next to troubleshoot this?


The long version:
I've just started getting back into playing with the TestLink API after many months, if not over a year, away. I've just about got it working in Visual Studio test 2008.

I've been using the TestLinkAdapter I believe that Stephan Meyn was so kind to have developed for us.

Stephan included examples of using the adaptor with Gallio and NUnit. in the 2008 version, Visual Studio behaves very differently than those examples at the testclass level and I've had a tough time getting past all of that. Stephen has been very kind to help me off line. Though not totally done with the Visual Studio side of things, I'm at the point where I am making a call to TestLink. I've hard coded results so it should be recording the results but it isn't. I'm getting the error described above.

Like it says above, I've followed through the code to the method 'basicConnection' and it's getting the TestLinkException.
The full message is:
Failed to connect to TestLink at http://blahblahblah.org/testlink/lib/api/xmlrpc.php. Message was '2000:Can not authenticate client: invalid developer key'

Well, the developer key that's being sent is the exact same one I got out of TestLink. I even regenrated a new one and tried that. No joy.

Can anyone offer some assistance?

One thing I'd like to see would be some way to test the web servers response without using the adaptor. Maybe a web page or something like that I could post the dev key to the xmlrpc so I could just verify that the server is working right.

Now the bad news: I'm using 1.8 RC5. We (the system administrator) had some problems installing the full release version and we had to leave the release condidate in production. We haven't had any other problems until this.

MArk B.
P.S. It's nice to be back.

Re: Another case of "Can not authenticate client:..."

Posted: Tue Nov 09, 2010 9:41 pm
by mkbutler
Got an email from Stephan just as I was posting this. He suggested I check out the SayHello method. Well, I did and it worked. (It's really good to know that it's communicating with the server.) But it's still failing on the GetProjects and says that's because of a bad DevKey.

Well, I've generated a new dev key for the first user and tried that. I've also tried a DevKey for a completly different user. That didn't work either.

Any suggestions?

MArk B.
P.S. This is the testlink exception stack trace:

Meyn.TestLink.TestLinkException was caught
Message="2000:Can not authenticate client: invalid developer key"
Source="TestLinkAPI"
StackTrace:
at Meyn.TestLink.TestLink.handleErrorMessage(Object[] errorMessage) in C:\Temp\TestLinkAdapter\TestLinkAPI\TestLink.cs:line 133
at Meyn.TestLink.TestLink.GetProjects() in C:\Temp\TestLinkAdapter\TestLinkAPI\TestLink.cs:line 335
at Meyn.TestLink.TestLinkAdaptor.basicConnection(String devKey, String url) in C:\Temp\TestLinkAdapter\TestLinkAPI\TestLinkAdaptor.cs:line 238
InnerException:

Re: Another case of "Can not authenticate client:..."

Posted: Tue Nov 09, 2010 9:45 pm
by mkbutler
I must like talking to myself.

Does anyone have a public facing instance of TestLink I can bounce a test off of? Should only take a minute.

I'll just need a url and a devkey. Post that it's OK to do that here and we'll connect via PM.

Thanks,

MArk B.

Re: Another case of "Can not authenticate client:..."

Posted: Wed Nov 10, 2010 6:49 pm
by mkbutler
1: Hi Mark, how's it going.
2: Ah, not so well. Still can't seem to get it working.
1: Making any progress?
2: Well, I got access to the logs now and I'm seeing some errors but I don't know what they mean.
1: Why don't you post those and see if anyone can help.
2: OK, if you think so.

MArk B. 2

These are the messages in the file userlog0.log. It looks to me like the adodb utility is having a problem pulling the right data out of the database. Then there is that error about flipping integers and strings too.

I'm just guessing here but I think it's trying to pull user data out of the database and isn't finding what it expects to find. Because of that it can't match up the DevKey with a user. That leads to it returning the error message.

[>>][4cdae325263fe253331006][DEFAULT][/testlink/lib/api/xmlrpc.php][10/Nov/10 18:23:33]
[10/Nov/10 18:23:33][WARNING][<nosession>][GUI]
E_NOTICE
Constant NO_USER_BY_THIS_LOGIN already defined - in C:\WebSites\testlink\lib\api\APIErrors.php - Line 198
[10/Nov/10 18:23:34][WARNING][<nosession>][GUI]
E_NOTICE
Undefined offset: 0 - in C:\WebSites\testlink\third_party\adodb\adodb.inc.php - Line 3427
[10/Nov/10 18:23:34][WARNING][<nosession>][GUI]
E_NOTICE
Undefined offset: 1 - in C:\WebSites\testlink\third_party\adodb\adodb.inc.php - Line 3427
[10/Nov/10 18:23:34][WARNING][<nosession>][GUI]
E_NOTICE
Undefined offset: 0 - in C:\WebSites\testlink\third_party\adodb\adodb.inc.php - Line 3427
[10/Nov/10 18:23:34][WARNING][<nosession>][GUI]
E_NOTICE
Undefined offset: 1 - in C:\WebSites\testlink\third_party\adodb\adodb.inc.php - Line 3427
[10/Nov/10 18:23:34][WARNING][<nosession>][GUI]
E_NOTICE
Undefined offset: 0 - in C:\WebSites\testlink\third_party\adodb\adodb.inc.php - Line 3427
[10/Nov/10 18:23:34][WARNING][<nosession>][GUI]
E_NOTICE
Undefined offset: 1 - in C:\WebSites\testlink\third_party\adodb\adodb.inc.php - Line 3427
[10/Nov/10 18:23:34][WARNING][<nosession>][GUI]
E_NOTICE
Undefined offset: 0 - in C:\WebSites\testlink\third_party\adodb\adodb.inc.php - Line 3427
[10/Nov/10 18:23:34][WARNING][<nosession>][GUI]
E_NOTICE
Undefined offset: 1 - in C:\WebSites\testlink\third_party\adodb\adodb.inc.php - Line 3427
[10/Nov/10 18:23:34][WARNING][<nosession>][GUI]
E_NOTICE
Undefined offset: 0 - in C:\WebSites\testlink\third_party\adodb\adodb.inc.php - Line 3427
[10/Nov/10 18:23:34][WARNING][<nosession>][GUI]
E_NOTICE
Undefined offset: 1 - in C:\WebSites\testlink\third_party\adodb\adodb.inc.php - Line 3427
[10/Nov/10 18:23:34][WARNING][<nosession>][GUI]
E_NOTICE
Undefined offset: 0 - in C:\WebSites\testlink\third_party\adodb\adodb.inc.php - Line 3427
[10/Nov/10 18:23:34][WARNING][<nosession>][GUI]
E_NOTICE
Undefined offset: 1 - in C:\WebSites\testlink\third_party\adodb\adodb.inc.php - Line 3427
[10/Nov/10 18:23:34][WARNING][<nosession>][GUI]
E_NOTICE
Undefined offset: 0 - in C:\WebSites\testlink\third_party\adodb\adodb.inc.php - Line 3427
[10/Nov/10 18:23:34][WARNING][<nosession>][GUI]
E_NOTICE
Undefined offset: 1 - in C:\WebSites\testlink\third_party\adodb\adodb.inc.php - Line 3427
[10/Nov/10 18:23:34][WARNING][<nosession>][GUI]
E_WARNING
array_flip() [<a href='function.array-flip'>function.array-flip</a>]: Can only flip STRING and INTEGER values! - in C:\WebSites\testlink\lib\functions\testcase.class.php - Line 115
[10/Nov/10 18:23:34][WARNING][<nosession>][GUI]
E_NOTICE
Undefined index: testcase - in C:\WebSites\testlink\lib\functions\testcase.class.php - Line 116
[10/Nov/10 18:23:34][WARNING][<nosession>][GUI]
E_NOTICE
Undefined offset: 0 - in C:\WebSites\testlink\third_party\adodb\adodb.inc.php - Line 3427
[10/Nov/10 18:23:34][WARNING][<nosession>][GUI]
E_NOTICE
Undefined offset: 1 - in C:\WebSites\testlink\third_party\adodb\adodb.inc.php - Line 3427
[10/Nov/10 18:23:34][WARNING][<nosession>][GUI]
E_NOTICE
Undefined offset: 2 - in C:\WebSites\testlink\third_party\adodb\adodb.inc.php - Line 3427
[10/Nov/10 18:23:34][WARNING][<nosession>][GUI]
E_NOTICE
Undefined offset: 0 - in C:\WebSites\testlink\third_party\adodb\adodb.inc.php - Line 3427
[10/Nov/10 18:23:34][WARNING][<nosession>][GUI]
E_NOTICE
Undefined offset: 1 - in C:\WebSites\testlink\third_party\adodb\adodb.inc.php - Line 3427
[10/Nov/10 18:23:34][WARNING][<nosession>][GUI]
E_NOTICE
Undefined offset: 2 - in C:\WebSites\testlink\third_party\adodb\adodb.inc.php - Line 3427
[10/Nov/10 18:23:34][WARNING][<nosession>][GUI]
E_NOTICE
Undefined offset: 0 - in C:\WebSites\testlink\third_party\adodb\adodb.inc.php - Line 3427
[10/Nov/10 18:23:34][WARNING][<nosession>][GUI]
E_NOTICE
Undefined offset: 1 - in C:\WebSites\testlink\third_party\adodb\adodb.inc.php - Line 3427
[10/Nov/10 18:23:34][WARNING][<nosession>][GUI]
E_NOTICE
Undefined offset: 0 - in C:\WebSites\testlink\third_party\adodb\adodb.inc.php - Line 3427
[10/Nov/10 18:23:34][WARNING][<nosession>][GUI]
E_NOTICE
Undefined offset: 1 - in C:\WebSites\testlink\third_party\adodb\adodb.inc.php - Line 3427
[10/Nov/10 18:23:34][WARNING][<nosession>][GUI]
E_NOTICE
Undefined offset: 0 - in C:\WebSites\testlink\third_party\adodb\adodb.inc.php - Line 3427
[10/Nov/10 18:23:34][WARNING][<nosession>][GUI]
E_NOTICE
Undefined offset: 1 - in C:\WebSites\testlink\third_party\adodb\adodb.inc.php - Line 3427
[10/Nov/10 18:23:34][WARNING][<nosession>][GUI]
E_NOTICE
Undefined offset: 0 - in C:\WebSites\testlink\third_party\adodb\adodb.inc.php - Line 3427
[10/Nov/10 18:23:34][WARNING][<nosession>][GUI]
E_NOTICE
Undefined offset: 1 - in C:\WebSites\testlink\third_party\adodb\adodb.inc.php - Line 3427
[10/Nov/10 18:23:34][WARNING][<nosession>][GUI]
E_NOTICE
Undefined offset: 0 - in C:\WebSites\testlink\third_party\adodb\adodb.inc.php - Line 3427
[10/Nov/10 18:23:34][WARNING][<nosession>][GUI]
E_NOTICE
Undefined offset: 1 - in C:\WebSites\testlink\third_party\adodb\adodb.inc.php - Line 3427
[10/Nov/10 18:23:34][WARNING][<nosession>][GUI]
E_WARNING
array_flip() [<a href='function.array-flip'>function.array-flip</a>]: Can only flip STRING and INTEGER values! - in C:\WebSites\testlink\lib\functions\testcase.class.php - Line 115
[10/Nov/10 18:23:34][WARNING][<nosession>][GUI]
E_NOTICE
Undefined index: testcase - in C:\WebSites\testlink\lib\functions\testcase.class.php - Line 116
[10/Nov/10 18:23:34][WARNING][<nosession>][GUI]
E_WARNING
array_flip() [<a href='function.array-flip'>function.array-flip</a>]: Can only flip STRING and INTEGER values! - in C:\WebSites\testlink\lib\functions\requirement_spec_mgr.class.php - Line 73
[10/Nov/10 18:23:34][WARNING][<nosession>][GUI]
E_NOTICE
Undefined index: requirement_spec - in C:\WebSites\testlink\lib\functions\requirement_spec_mgr.class.php - Line 74
[10/Nov/10 18:23:34][WARNING][<nosession>][GUI]
E_WARNING
array_flip() [<a href='function.array-flip'>function.array-flip</a>]: Can only flip STRING and INTEGER values! - in C:\WebSites\testlink\lib\functions\requirement_mgr.class.php - Line 50
[10/Nov/10 18:23:34][WARNING][<nosession>][GUI]
E_NOTICE
Undefined index: requirement - in C:\WebSites\testlink\lib\functions\requirement_mgr.class.php - Line 51
[10/Nov/10 18:23:34][WARNING][<nosession>][GUI]
E_NOTICE
Undefined offset: 0 - in C:\WebSites\testlink\third_party\adodb\adodb.inc.php - Line 3427
[10/Nov/10 18:23:34][WARNING][<nosession>][GUI]
E_STRICT
is_a(): Deprecated. Please use the instanceof operator - in C:\WebSites\testlink\third_party\xml-rpc\class-IXR.php - Line 296
[10/Nov/10 18:23:34][WARNING][<nosession>][GUI]
E_STRICT
is_a(): Deprecated. Please use the instanceof operator - in C:\WebSites\testlink\third_party\xml-rpc\class-IXR.php - Line 47
[10/Nov/10 18:23:34][WARNING][<nosession>][GUI]
E_STRICT
is_a(): Deprecated. Please use the instanceof operator - in C:\WebSites\testlink\third_party\xml-rpc\class-IXR.php - Line 50
[<<][4cdae325263fe253331006][DEFAULT][/testlink/lib/api/xmlrpc.php][10/Nov/10 18:23:33][10/Nov/10 18:23:34][took 0.992053 secs]

1: Thanks Mark.
2: No, thank you. I was getting a little discouraged but your trying to help is lifting my spirits a bit.

MArk B.

Re: Another case of "Can not authenticate client:..."

Posted: Wed Dec 01, 2010 6:33 pm
by gabb
Hi guys,

I'm having the same problem.

My setup:
WinXP + MSVS2008 + Testlink 1.9.0 + Apache + MSSQL => "2000:Can not authenticate client: invalid developer key"
WinXP + MSVS2008 + Testlink 1.9.0 + Apache + MySQL => API works fine.

Other than that same errors and behavior as Mark B.'s environment.

Gabriel B.

Re: Another case of "Can not authenticate client:..."

Posted: Wed Dec 01, 2010 9:29 pm
by fman
May be my problem is lack of humor, but really do not found funny last post from mkbutler.
As all people knows forums work this way: you can get or not get an asnwer. You can only wait and pray for help.
All issues with Testlink adaptors are outside of TestLink Dev Team control.
We can help only with API problems when tests are done using our PHP sample clients

Re: Another case of "Can not authenticate client:..."

Posted: Sat Dec 04, 2010 3:06 am
by gabb
Hi,

I've managed to fix this problem. At least in my case. As I said I'm using Testlink with MSSQL.

What I've done:

1.In testlink\lib\functions\database.class.php
2.Line 217
3.Add: case "mssql":

I hope this helps.....

Gabriel B.

Re: Another case of "Can not authenticate client:..."

Posted: Sat Dec 04, 2010 12:38 pm
by fman
@Gabriel
can you be more detailed ?
line number is not a very good indication
can you specify what was the problem instead of just the workaround or solution ?

BOTH things are critic

Re: Another case of "Can not authenticate client:..."

Posted: Sun Dec 05, 2010 5:25 am
by gabb
Hi,

After debugging I've found out that in my case (using MSSQL as database engine) Testlink wasn't able to fetch the user id for that particular devkey which comes from the xmlrpc client.

and the Testlink server fails in database.class.php, function "fetch_array":

Code: Select all

function fetch_array( &$p_result ) 
	{
		if ( $p_result->EOF ) {
			return false;
		}		
		
		// mysql obeys FETCH_MODE_BOTH, hence ->fields works, other drivers do not support this
		// 20090713 - pmo - add oci8po
		switch ($this->db->databaseType) 
		{
			case "mysql":
			case "oci8po":
				$t_array = $p_result->fields;
				break;
			default:
				$t_array = $p_result->GetRowAssoc(false);
		}
		
		$p_result->MoveNext();
		return $t_array;
	}
I've seen that in mssql case the switch will go to default and in the end fetch_array will return "id"=>Null instead of "id"=>xx (where xx is the corresponding user id for the given devkey). So i gave it a try and I've added mssql case together with mysql and oci8po. And it worked although I didn't expect it to work.

Due to the fact that I'm not a php or sql programmer I'm not saying that this is a legitimate fix of the issue. It just worked in my case.

Gabriel B.

Re: Another case of "Can not authenticate client:..."

Posted: Sun Dec 05, 2010 9:52 am
by fman
OK now is better
Important things to understand is why you do not have problems when working using TL GUI.

I've read code from Mantis database class ( TL is a refactoring of this Mantis code) and found that issue exists with MSSQL but ONLY when using
odbc_mssql as db type and NOT mssql.