Authorization with Bugzilla

H there,

When I'm entereting a username/password in TeamCity to connect to our Bugzilla, I get the error below. Can anyone shed any light on it please?
Note: When I enter the username/password wrongly, I get a invalid username/password reponse. When I enter it correctly, I get the error below.

[2011-03-15 16:15:06,254]  DEBUG - .bugzilla.BugzillaIssueFetcher - Trying to get issue #100 via XML-RPC. Using host = http://ourBugzillaserver/bugzilla/xmlrpc.cgi, login = bothap@email.com
[2011-03-15 16:15:07,552]  DEBUG - eTracker.AbstractIssueProvider - Error during issue-tracker connection test
org.apache.xmlrpc.XmlRpcException: You must log in before using this part of Bugzilla.
        at org.apache.xmlrpc.client.XmlRpcStreamTransport.readResponse(XmlRpcStreamTransport.java:197)
        at org.apache.xmlrpc.client.XmlRpcStreamTransport.sendRequest(XmlRpcStreamTransport.java:156)
        at org.apache.xmlrpc.client.XmlRpcHttpTransport.sendRequest(XmlRpcHttpTransport.java:115)
        at org.apache.xmlrpc.client.XmlRpcClientWorker.execute(XmlRpcClientWorker.java:56)
        at org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:167)
        at org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:158)
        at org.apache.xmlrpc.client.XmlRpcClient.execute(XmlRpcClient.java:147)
        at jetbrains.buildServer.issueTracker.bugzilla.BugzillaIssueFetcher.xmlRpcCall(BugzillaIssueFetcher.java:231)
        at jetbrains.buildServer.issueTracker.bugzilla.BugzillaIssueFetcher.getIssueViaXmlRpc(BugzillaIssueFetcher.java:184)
        at jetbrains.buildServer.issueTracker.bugzilla.BugzillaIssueFetcher.access$100(BugzillaIssueFetcher.java:34)
        at jetbrains.buildServer.issueTracker.bugzilla.BugzillaIssueFetcher$2.fetch(BugzillaIssueFetcher.java:102)
        at jetbrains.buildServer.issueTracker.AbstractIssueFetcher.getFromCacheOrFetch(AbstractIssueFetcher.java:151)
        at jetbrains.buildServer.issueTracker.bugzilla.BugzillaIssueFetcher.getIssue(BugzillaIssueFetcher.java:98)
        at jetbrains.buildServer.issueTracker.AbstractIssueProvider$3.testConnection(AbstractIssueProvider.java:260)
        at jetbrains.buildServer.controllers.admin.issues.TestConnectionController.doPost(TestConnectionController.java:0)
        at jetbrains.buildServer.controllers.BaseFormXmlController$1.handleRequest(BaseFormXmlController.java:54)
        at jetbrains.buildServer.controllers.AjaxRequestProcessor.processRequest(AjaxRequestProcessor.java:45)
        at jetbrains.buildServer.controllers.BaseFormXmlController.doHandle(BaseFormXmlController.java:52)
        at jetbrains.buildServer.controllers.BaseController.handleRequestInternal(BaseController.java:73)
        at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:153)
        at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)
        at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:875)
        at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:807)




Thanks in advance,
  Pieter
13 comments
Comment actions Permalink

Hi Pieter

Please check that XML-RPC is enabled on Bugzilla side.

Michael

0
Comment actions Permalink

Hi Michael,

Thanks for replying. I have tested xml-rpc login with Bugzilla using the command-line utility and was able to login sucessfully.From Teamcity however, it does not work.

root@server:/usr/local/bugzilla3.6# contrib/bz_webservice_demo.pl --uri http://server/bugzilla/xmlrpc.cgi --login bothap --password 123
Connecting to a Bugzilla of version 3.6.4.
Bugzilla's timezone is +0000.
Login successful.

0
Comment actions Permalink

Hi Pieter,

The exception is thrown after XML-RPC "User.login" method, which works for Bugzilla 3.0-3.4.
Is it the same method you use in the script, or the API's changed?

---
Maxim

0
Comment actions Permalink

Hi Maxim,

I'm running Bugzilla 3.6.4 so that might be a problem where some API in Bugzilla changed and now they don't match Teamcity anymore. I'm using the standard Bugzilla XMLRPC testing utility supplied in the contrib folder from Bugzilla to test my details before testing them in .

Pieter

0
Comment actions Permalink

Thanks, Pieter.

I've created the issue: http://youtrack.jetbrains.net/issue/TW-16006
Please watch/vote for it.


---
Maxim

0
Comment actions Permalink

Hi Pieter

I've just tested TeamCity with Bugzilla 3.6 and cannot reproduce the issue yet.
Could you start test bz_webservice_demo.pl with --bug_id option to test how actual data is accessed by XML-RPC.

Thanks

0
Comment actions Permalink

Hi,

The output of the .pl tool below:

root@server:/usr/local/bugzilla3.6# contrib/bz_webservice_demo.pl --uri http://server/bugzilla/xmlrpc.cgi --login "bothapn" -password 123--bug_id 120
Connecting to a Bugzilla of version 3.6.4.
Bugzilla's timezone is +0000.
Login successful.
priority: Normal
status: CLOSED
last_change_time: 20100422T10:03:25
component: work_request
summary: Key loading
priority: Normal
status: HASH(0x322d618)
bug_id: 120
bug_file_loc:
cclist_accessible: 1
rep_platform: Series
product_id: 3
creation_ts: 2009.12.23 09:31
assigned_to: 5
everconfirmed: 1
short_desc: Key loading
status_whiteboard:
bug_severity: normal
bug_status: CLOSED  
delta_ts: 2010-04-22 12:03:25
version: unspecified
estimated_time: 0.00
reporter_id: 1
remaining_time: 0.00
component_id: 19
component: work_request
reporter_accessible: 1
resolution: ACTIONED
target_milestone: December 2009-1
product: BAH
alias: WRQ125216
op_sys: LIN
resolution: ACTIONED
is_open: 0
assigned_to: bothapn@123.com
id: 120
creation_time: 20091223T07:31:00
product: BAH
severity: normal
alias: WRQ125216

0
Comment actions Permalink

Thanks, Pieter

So, the demo script work even for read calls.
Then we'll need to look at traffic dump between your TeamCity and Bugzilla instances, as Maxim suggested in issue comments.

Michael

0
Comment actions Permalink

Hi,

I've attached 2 log files I know of. If there is any other type of log I should attach as well, please let me know.

Pieter



Attachment(s):
errorlog.txt.zip
teamcity-server.log.txt.zip
0
Comment actions Permalink

Hi Pieter,

Thanks for the logs.
Unfortunately they don't give us any new information to clarify the issue. I suppose the traffic dump between TeamCity and Bugzilla should shed some light. You can obtain it using any sniffer tool.


---
Maxim

0
Comment actions Permalink

Hi,

I have not sanitised the tcp dump so it does contain sensitive information. Please remove the file once your are done.
Thanks again for the help.

Pieter

Message was edited by: Michael Kuzmin

0
Comment actions Permalink

Thanks, Pieter, we'll take a look.
Next time, if you need to send us a private data -  mail it to teamcify-feedback@jetbrains.com with a link to the forum thread.

Michael

0
Comment actions Permalink

Hi Pieter,

We analyzed the dump that you've sent and tried to reproduce the situation exactly as it is in the dump, but without luck. The authorization is working.

I'll try to explain some details here. The interaction between TeamCity and the issue tracker consists of several XML-RPC calls. The very first call is a "User.login" call, which performs authorization and starts the session, other calls are performed in this session.
The problem is that due to some reason the cookies aren't saved, so the second XML-RPC call is performed in a new session. Hence the error.

It seems like the bug in XML-RPC library, which is responsible for processing HTTP cookies and session.
Could you please check that you have xmlrpc-client-3.1.2.jar in lib/ directory?
Could it be possible that there are other XML-RPC/HTTP libraries in classpath?
Thanks.


---
Maxim

0

Please sign in to leave a comment.