Integrating Amazon AWS CodeCommit with TeamCity

Has anyone tried integrating CodeCommit git repository with TeamCity? I tried both SSH and http based integration and it doesn't work either way (I get 403 errors). Amazon support told me I should talk to JetBrans to work on this issue. Also there's no documentation on JetBrains web site or questions on StackOverflow.

Thanks,
Ali

6 comments
Comment actions Permalink

Hi Ali,

At the moment we have not tested integration woth AWS CodeCommit and we do not receive any feedback about such integration from our customers. Could you please attach teamcity-vcs.log which includes the full error message?

0
Comment actions Permalink

Hi Alina,
Thanks for your help. There are different ways to connect to CodeCommit and I used the most common way through SSH:

Authentication settings:
Authentication method: Custom Private Key
Username: teamcity
Private Key path: <Somewhere on the server>
Passphrase: <provided. If I type wrong passphrase I get passphrase error instead>

Here's the error I get in the log file when I try test connection:

[2015-08-10 14:41:01,430]   WARN [nio-8087-exec-6] -      jetbrains.buildServer.VCS - Error occurred in test connection
jetbrains.buildServer.vcs.VcsException: List remote refs failed: com.jcraft.jsch.JSchException: Auth fail
 at jetbrains.buildServer.buildTriggers.vcs.git.OperationContext.wrapException(OperationContext.java:164)
 at jetbrains.buildServer.buildTriggers.vcs.git.GitVcsSupport.getRemoteRefs(GitVcsSupport.java:360)
 at jetbrains.buildServer.buildTriggers.vcs.git.GitVcsSupport.getCurrentState(GitVcsSupport.java:139)
 at jetbrains.buildServer.buildTriggers.vcs.git.TestConnectionCommand.checkFetchConnection(TestConnectionCommand.java:95)
 at jetbrains.buildServer.buildTriggers.vcs.git.TestConnectionCommand.testConnection(TestConnectionCommand.java:68)
 at jetbrains.buildServer.buildTriggers.vcs.git.GitVcsSupport.testConnection(GitVcsSupport.java:265)
 at jetbrains.vcs.api.services.impl.TestConnectionServiceProvider$1.testConnection(TestConnectionServiceProvider.java)
 at jetbrains.buildServer.controllers.admin.projects.TestConnectionCommand.runTestConnection(TestConnectionCommand.java:15)
 at jetbrains.buildServer.controllers.admin.projects.TestConnectionCommand.doTestConnection(TestConnectionCommand.java:25)
 at jetbrains.buildServer.controllers.admin.projects.EditVcsRootsController.doPost(EditVcsRootsController.java:235)
 at jetbrains.buildServer.controllers.BaseFormXmlController$1.handleRequest(BaseFormXmlController.java:53)
 at jetbrains.buildServer.controllers.AjaxRequestProcessor.processRequest(AjaxRequestProcessor.java:45)
 at jetbrains.buildServer.controllers.BaseFormXmlController.doHandle(BaseFormXmlController.java:51)
 at jetbrains.buildServer.controllers.BaseController.handleRequestInternal(BaseController.java:75)
 at org.springframework.web.servlet.mvc.AbstractController.handleRequest(AbstractController.java:154)
 at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:50)
 at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:938)
 at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:870)
 at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:961)
 at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:863)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:646)
 at org.springframework.web.servlet.FrameworkServlet.service(FrameworkServlet.java:837)
 at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)
 at jetbrains.buildServer.maintenance.TeamCityDispatcherServlet.service(TeamCityDispatcherServlet.java:11)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:303)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
 at org.apache.tomcat.websocket.server.WsFilter.doFilter(WsFilter.java:52)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
 at jetbrains.buildServer.web.DependencyParametersCalculationContextFilter.doFilter(DependencyParametersCalculationContextFilter.java:0)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
 at jetbrains.buildServer.web.DisableSessionIdFromUrlFilter.doFilter(DisableSessionIdFromUrlFilter.java:2)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
 at jetbrains.buildServer.diagnostic.web.DiagnosticFilter.doFilter(DiagnosticFilter.java:6)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
 at jetbrains.buildServer.web.ResponseFragmentFilter.doFilter(ResponseFragmentFilter.java:6)
 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)
 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)
 at org.apache.catalina.core.StandardWrapperValve.invoke(StandardWrapperValve.java:220)
 at org.apache.catalina.core.StandardContextValve.invoke(StandardContextValve.java:122)
 at org.apache.catalina.core.StandardHostValve.invoke(StandardHostValve.java:170)
 at org.apache.catalina.valves.ErrorReportValve.invoke(ErrorReportValve.java:103)
 at org.apache.catalina.core.StandardEngineValve.invoke(StandardEngineValve.java:116)
 at org.apache.catalina.connector.CoyoteAdapter.service(CoyoteAdapter.java:421)
 at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1074)
 at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:611)
 at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1739)
 at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1698)
 at java.util.concurrent.ThreadPoolExecutor.runWorker(ThreadPoolExecutor.java:1145)
 at java.util.concurrent.ThreadPoolExecutor$Worker.run(ThreadPoolExecutor.java:615)
 at org.apache.tomcat.util.threads.TaskThread$WrappingRunnable.run(TaskThread.java:61)
 at java.lang.Thread.run(Thread.java:745)
Caused by: org.eclipse.jgit.errors.TransportException: ssh://teamcity@git-codecommit.us-east-1.amazonaws.com/v1/repos/tablika-server: Auth fail
 at org.eclipse.jgit.transport.JschConfigSessionFactory.getSession(JschConfigSessionFactory.java:159)
 at org.eclipse.jgit.transport.SshTransport.getSession(SshTransport.java:136)
 at org.eclipse.jgit.transport.TransportGitSsh$SshFetchConnection.<init>(TransportGitSsh.java:262)
 at org.eclipse.jgit.transport.TransportGitSsh.openFetch(TransportGitSsh.java:161)
 at jetbrains.buildServer.buildTriggers.vcs.git.GitVcsSupport.getRemoteRefs(GitVcsSupport.java:377)
 at jetbrains.buildServer.buildTriggers.vcs.git.GitVcsSupport.getRemoteRefs(GitVcsSupport.java:355)
 ... 53 more
Caused by: com.jcraft.jsch.JSchException: Auth fail
 at com.jcraft.jsch.Session.connect(Session.java:512)
 at org.eclipse.jgit.transport.JschConfigSessionFactory.getSession(JschConfigSessionFactory.java:116)
 ... 58 more

0
Comment actions Permalink

Thank you for provided details. There was the issue with fetch from AWS CodeCommit over ssh. We've fixed it in 9.1.2 which is going to be released in few weeks.
Sorry for the inconvenience.

0
Comment actions Permalink

As for now, you can download patched plugin here. See how to install TeamCity plugin: https://confluence.jetbrains.com/display/TCD9/Installing+Additional+Plugins.

0
Comment actions Permalink

Hi Alina,
I applied that patch but I'm still getting the same error. What method did you use to test connecting to CodeCommit? HTTP? ssh? what options did you choose. I want to make sure I try the same way it worked for you.

Thanks,
Ali

0
Comment actions Permalink

Please make sure the plugin was updated. You can check the plugin version at Administration > Plugin List.

0

Please sign in to leave a comment.