TeamCity 5.1.4: HowTo configure Issue Tracker Bugzilla with web authentication?

Hello Community,

I have a problem with the bugzilla connection configuration in TeamCity 5.1.4 Professional Edition. First of all, I have read the Issue Tracker Configuration Section in the TeamCity Documentation, but it does not answer my question. Our Bugzilla is available via https - connection. So I have to do a web authentication first, and in a second step the Bugzilla login. Bugzilla-XML-RPC is activated.

My question is: How can I connect a Bugzilla Service through https? I have tried to add the https auth information to the Server URL. But this does not work for the Test connection.
TrackerConfiguration.pngTestTrackerConfiguration.png

The Issue Id Pattern seems to be okay, because a mouse-click on the link below shows Bugzilla issue #1438 in the web browser. The issue exists, but the issue details won't be displayed.ConnectionWorksOneWay.png
It would be great if you have any suggestions for me how to configure a Bugzilla connection with web authentication correctly.

4 comments

Hello Kim,

Can you please enable debug logs, reproduce the issue, then disable the debug logs and attach the related piece of the teamcity-server.log?
The debug logging can be enable on Server Configuration > Diagnostics.

Kind regards,
Marina

0

Hello Marina,

I have replaced my password and the hostname in the logfile with dummy strings. I suppose that I add the .htaccess credentials (user: km, password: mysecretpassword) in a wrong way, or this credentials won't be used by TeamCity.

---

[2010-09-20 11:43:05,869]   INFO - eTracker.AbstractIssueProvider - Failed to fetch the issue: 1439, reason: HTTP server returned unexpected status: Authorization Required, connection: "Bugzilla"
[2010-09-20 11:43:05,902]   INFO - eTracker.AbstractIssueProvider - Failed to fetch the issue: 1395, reason: HTTP server returned unexpected status: Authorization Required, connection: "Bugzilla"
[2010-09-20 11:43:05,913]   INFO - eTracker.AbstractIssueProvider - Failed to fetch the issue: 1409, reason: HTTP server returned unexpected status: Authorization Required, connection: "Bugzilla"
[2010-09-20 11:43:05,923]   INFO - eTracker.AbstractIssueProvider - Failed to fetch the issue: 1401, reason: HTTP server returned unexpected status: Authorization Required, connection: "Bugzilla"
[2010-09-20 11:43:35,763]  DEBUG -   jetbrains.buildServer.SERVER - SELECT action_history.OBJECT_ID, action_history.ACTION, comments.ID, comments.AUTHOR_ID, action_history.ADDITIONAL_DATA FROM action_history INNER JOIN comments ON action_history.COMMENT_ID = comments.ID  WHERE (action_history.OBJECT_ID=?) ORDER BY action_history.COMMENT_ID DESC
[2010-09-20 11:43:41,104]   INFO - eTracker.AbstractIssueProvider - Failed to fetch the issue: 1439, reason: Cached issue for https://km:secretpassword@www.mybugzillahostname.de/bugs/show_bug.cgi?id=1439 is null (probably failed to fetch it previous time), connection: "Bugzilla"
[2010-09-20 11:43:41,308]  DEBUG -   jetbrains.buildServer.SERVER - SELECT action_history.OBJECT_ID, action_history.ACTION, comments.ID, comments.AUTHOR_ID, action_history.ADDITIONAL_DATA FROM action_history INNER JOIN comments ON action_history.COMMENT_ID = comments.ID  WHERE (action_history.OBJECT_ID=?) ORDER BY action_history.COMMENT_ID DESC
[2010-09-20 11:43:41,531]   INFO - eTracker.AbstractIssueProvider - Failed to fetch the issue: 1439, reason: Cached issue for https://km:secretpassword@www.mybugzillahostname.de/bugs/show_bug.cgi?id=1439 is null (probably failed to fetch it previous time), connection: "Bugzilla"
[2010-09-20 11:43:41,532]   INFO - eTracker.AbstractIssueProvider - Failed to fetch the issue: 1439, reason: Cached issue for https://km:secretpassword@www.mybugzillahostname.de/bugs/show_bug.cgi?id=1439 is null (probably failed to fetch it previous time), connection: "Bugzilla"
[2010-09-20 11:43:41,532]   INFO - eTracker.AbstractIssueProvider - Failed to fetch the issue: 1439, reason: Cached issue for https://km:secretpassword@www.mybugzillahostname.de/bugs/show_bug.cgi?id=1439 is null (probably failed to fetch it previous time), connection: "Bugzilla"
[2010-09-20 11:43:41,534]   INFO - eTracker.AbstractIssueProvider - Failed to fetch the issue: 1439, reason: Cached issue for https://km:secretpassword@www.mybugzillahostname.de/bugs/show_bug.cgi?id=1439 is null (probably failed to fetch it previous time), connection: "Bugzilla"
[2010-09-20 11:43:56,653]  DEBUG -   jetbrains.buildServer.SERVER - New build promotion created: BuildPromotion{myId=2132, myBuildTypeId='bt4', myModificationId=null, myRevisions=null, myAssociatedBuildId=-1}
[2010-09-20 11:43:56,831]   INFO - tbrains.buildServer.ACTIVITIES - Configuration added to queue; name=mybugzillahostname :: CI Trunk - mybugzillahostname.MSBuild {id=bt4}; requestor=CVS; promotion id=2132
[2010-09-20 11:43:56,950]  DEBUG -   jetbrains.buildServer.SERVER - Initializing Running build bt4 on Mr.Pink@prakVi:1922
[2010-09-20 11:43:57,021]  DEBUG -   jetbrains.buildServer.SERVER - Associating build promotion 2132 with build 1922
[2010-09-20 11:43:57,025]  DEBUG -   jetbrains.buildServer.SERVER - SELECT action_history.OBJECT_ID, action_history.ACTION, comments.ID, comments.AUTHOR_ID, action_history.ADDITIONAL_DATA FROM action_history INNER JOIN comments ON action_history.COMMENT_ID = comments.ID  WHERE (action_history.OBJECT_ID=?) ORDER BY action_history.COMMENT_ID DESC
[2010-09-20 11:43:57,105]  DEBUG -   jetbrains.buildServer.SERVER - SearchService: buildStarted Running build bt4 on Mr.Pink@prakVi:1922
[2010-09-20 11:43:57,105]  DEBUG -   jetbrains.buildServer.SERVER - SearchService:     addBuild 1922
[2010-09-20 11:43:57,086]   INFO - tbrains.buildServer.ACTIVITIES - Build started; name=mybugzillahostname :: CI Trunk - mybugzillahostname.MSBuild, personal=false, buildId=1922
[2010-09-20 11:43:57,117]   INFO - tbrains.buildServer.ACTIVITIES - Configuration removed from queue; name=mybugzillahostname :: CI Trunk - mybugzillahostname.MSBuild, requestor=CVS, comment=null, user=null, promotion id=2132
[2010-09-20 11:43:57,120]  DEBUG -   jetbrains.buildServer.SERVER - Starting a new build: QueuedBuildImpl{myBuildType=mybugzillahostname :: CI Trunk - mybugzillahostname.MSBuild {id=bt4},ItemId=2132}
[2010-09-20 11:43:57,121]   INFO -   jetbrains.buildServer.SERVER - Flush queue finished, number of builds started: 1
[2010-09-20 11:43:57,927]  DEBUG -   jetbrains.buildServer.SERVER - SearchService.createWriter
[2010-09-20 11:43:57,929]  DEBUG -   jetbrains.buildServer.SERVER - SearchService: changesLoaded Running build bt4 on Mr.Pink@prakVi:1922
[2010-09-20 11:43:57,930]  DEBUG -   jetbrains.buildServer.SERVER - SearchService:     deleteBuild 1922
[2010-09-20 11:43:57,935]  DEBUG -   jetbrains.buildServer.SERVER - SearchService:     addBuild 1922
[2010-09-20 11:43:58,156]  DEBUG -   jetbrains.buildServer.SERVER - SearchService.deleteBuild #1922
[2010-09-20 11:43:58,156]  DEBUG -   jetbrains.buildServer.SERVER - SearchService.updateSearcher
[2010-09-20 11:43:58,180]  DEBUG -   jetbrains.buildServer.SERVER - Mon Sep 20 11:43:58 CEST 2010 SearchService.indexBuilds (1 left)
[2010-09-20 11:43:58,314]   INFO -   jetbrains.buildServer.SERVER - Running build saved to DB: mybugzillahostname :: CI Trunk - mybugzillahostname.MSBuild {id=bt4} # 2.0.0.136-Snapshot {build id=1922} on agent Mr.Pink@prakVi triggered by ##vcsName='cvs'

0

Hello Kim,

Please remove credentials (login and password) from the server url, enable debug mode and try Test connection again. Please attach log after that.

Kind regards,
Marina

0

Hello Marina,
I have excactly the same problem as Kim, but with TeamCity 6.5.4.

When I try to access the url https://myuser:mypassword@seu.sdm.de/pu/edlsencore/bugzilla/show_bug.cgi?ctype=xml&id=1500 with a browser it works.
When I try it with the issue tracker dialog an authentication error occurs.

I did the steps you suggested and I got following stack trace:

[2011-11-04 11:06:39,060]  DEBUG - ueTracker.AbstractIssueFetcher - HTTP Response body:
<?xml version="1.0" encoding="ISO-8859-1"?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
  "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="http://www.w3.org/1999/xhtml" lang="en" xml:lang="en">
<head>
<title>Authentication required!</title>
<link rev="made" href="mailto:webmaster@sdm.de" />
<style type="text/css"><!--/*--><![CDATA[/*><!--*/
    body { color: #000000; background-color: #FFFFFF; }
    a:link { color: #0000CC; }
    p, address {margin-left: 3em;}
    span {font-size: smaller;}
/*]]>*/--></style>
</head>
<body>
<h1>Authentication required!</h1>
<p>

    This server could not verify that you are authorized to access
    the URL "/pu/edlsencore/bugzilla/show_bug.cgi".
    You either supplied the wrong credentials (e.g., bad password), or your
    browser doesn't understand how to supply the credentials required.
  </p>
<p>

    In case you are allowed to request the document, please
    check your user-id and password and try again.
</p>
<p>
If you think this is a server error, please contact
the <a href="mailto:webmaster@sdm.de">webmaster</a>.
</p>
<h2>Error 401</h2>
<address>
  <a href="/">seu.sdm.de</a><br />
  
  <span>Fri Nov  4 11:06:38 2011<br />
  Apache/2.2.9 (Unix)</span>
</address>
</body>
</html>

[2011-11-04 11:06:39,076]  DEBUG - eTracker.AbstractIssueProvider - Error during issue-tracker connection test
java.lang.RuntimeException: Failed to fetch issue details for "https://myuser:mypassword@seu.sdm.de/pu/edlsencore/bugzilla/show_bug.cgi?ctype=xml&id=1500", HTTP response code: 401
at jetbrains.buildServer.issueTracker.AbstractIssueFetcher.fetchHttpFile(AbstractIssueFetcher.java:65)
at jetbrains.buildServer.issueTracker.bugzilla.BugzillaIssueFetcher.access$000(BugzillaIssueFetcher.java:34)
at jetbrains.buildServer.issueTracker.bugzilla.BugzillaIssueFetcher$1.fetch(BugzillaIssueFetcher.java:84)
at jetbrains.buildServer.issueTracker.AbstractIssueFetcher.getFromCacheOrFetch(AbstractIssueFetcher.java:151)
at jetbrains.buildServer.issueTracker.bugzilla.BugzillaIssueFetcher.getIssue(BugzillaIssueFetcher.java:78)
at jetbrains.buildServer.issueTracker.AbstractIssueProvider$3.testConnection(AbstractIssueProvider.java:256)
at jetbrains.buildServer.controllers.admin.issues.TestConnectionController.doPost(TestConnectionController.java:24)
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)
at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:571)
at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:511)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:637)
at javax.servlet.http.HttpServlet.service(HttpServlet.java:717)
at jetbrains.buildServer.rootDispatcher.TeamCityDispatcherServlet.service(TeamCityDispatcherServlet.java:543)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:290)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at jetbrains.buildServer.web.DiagnosticFilter.runChainWithModifiedThreadName(DiagnosticFilter.java:13)
at jetbrains.buildServer.web.DiagnosticFilter.doFilter(DiagnosticFilter.java:9)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at jetbrains.buildServer.web.ResponseFragmentFilter.doFilter(ResponseFragmentFilter.java:10)
at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:235)
at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:206)
at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:233)
at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:191)
at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:127)
at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:102)
at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:109)
at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:298)
at org.apache.coyote.http11.Http11Processor.process(Http11Processor.java:857)
at org.apache.coyote.http11.Http11Protocol$Http11ConnectionHandler.process(Http11Protocol.java:588)
at org.apache.tomcat.util.net.JIoEndpoint$Worker.run(JIoEndpoint.java:489)
at java.lang.Thread.run(Unknown Source)

0

Please sign in to leave a comment.