Problem to create/launch a new Agent Cloud Agent at Amazon AWS EC2

My issue is that I wish to create a new Cloud Agent configuration but I get errors from Teamcity.

If I use an old configuration under Cloud profile settings can be specified on the configuration page.
and press Check connection / Fetch parameter valuesI get this error

Failed to fetch data from region eu-central-1

URL: ec2.eu-central-1.amazonaws.com

AWS was not able to validate the provided access credentials (Service: AmazonEC2; Status Code: 401; Error Code: AuthFailure; Request ID: 8926036c-4e3e-49f7-823e-f25d76b80c03)

If I create a new profile I get 'Failed to connect to Amazon EC2. Check your credentials' when pressing Check connection / Fetch parameter values

Nothing changed with Amazon IAM profile but it looks like there is changes at Amazon. We use Amazon eu-west-1a and I have seen that Amazon added a new EU zone frankfurt. Logs says something interesting.

[2014-11-18 07:17:31,678]   WARN - mazonaws.http.AmazonHttpClient - Unable to parse clock skew offset from response: Tue, 18 Nov 2014 07:17:31 GMT

java.lang.IllegalStateException: Joda-time 2.2 or later version is required, but found version: null

 at com.amazonaws.util.DateUtils.handleException(DateUtils.java:141)

 at com.amazonaws.util.DateUtils.parseRFC822Date(DateUtils.java:189)

 at com.amazonaws.http.AmazonHttpClient.parseClockSkewOffset(AmazonHttpClient.java:1001)

 at com.amazonaws.http.AmazonHttpClient.executeHelper(AmazonHttpClient.java:505)

 at com.amazonaws.http.AmazonHttpClient.execute(AmazonHttpClient.java:257)

 at com.amazonaws.services.ec2.AmazonEC2Client.invoke(AmazonEC2Client.java:8837)

 at com.amazonaws.services.ec2.AmazonEC2Client.describeRegions(AmazonEC2Client.java:1201)

 at com.amazonaws.services.ec2.AmazonEC2Client.describeRegions(AmazonEC2Client.java:7396)

 at jetbrains.buildServer.clouds.amazon.sync.SyncClientBase$1.apply(SyncClientBase.java:25)

 at jetbrains.buildServer.clouds.amazon.sync.AmazonConnectionImpl.catchEC2Exception(AmazonConnectionImpl.java:71)

 at jetbrains.buildServer.clouds.amazon.sync.SyncClientBase.catchEC2Exception(SyncClientBase.java:19)

 at jetbrains.buildServer.clouds.amazon.sync.SyncClientBase.ping(SyncClientBase.java:23)

 at jetbrains.buildServer.clouds.amazon.web.AmazonProfileEditController.processProfileAction(AmazonProfileEditController.java:128)

 at jetbrains.buildServer.clouds.amazon.web.AmazonProfileEditController.doPost(AmazonProfileEditController.java:101)

 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:153)

 at org.springframework.web.servlet.mvc.SimpleControllerHandlerAdapter.handle(SimpleControllerHandlerAdapter.java:48)

 at org.springframework.web.servlet.DispatcherServlet.doDispatch(DispatcherServlet.java:790)

 at org.springframework.web.servlet.DispatcherServlet.doService(DispatcherServlet.java:719)

 at org.springframework.web.servlet.FrameworkServlet.processRequest(FrameworkServlet.java:644)

 at org.springframework.web.servlet.FrameworkServlet.doPost(FrameworkServlet.java:560)

 at javax.servlet.http.HttpServlet.service(HttpServlet.java:646)

 at javax.servlet.http.HttpServlet.service(HttpServlet.java:727)

 at jetbrains.buildServer.maintenance.TeamCityDispatcherServlet.service(TeamCityDispatcherServlet.java:28)

 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:4)

 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:4)

 at org.apache.catalina.core.ApplicationFilterChain.internalDoFilter(ApplicationFilterChain.java:241)

 at org.apache.catalina.core.ApplicationFilterChain.doFilter(ApplicationFilterChain.java:208)

 at jetbrains.buildServer.web.DiagnosticFilter.doFilter(DiagnosticFilter.java:49)

 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:16)

 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:171)

 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:408)

 at org.apache.coyote.http11.AbstractHttp11Processor.process(AbstractHttp11Processor.java:1070)

 at org.apache.coyote.AbstractProtocol$AbstractConnectionHandler.process(AbstractProtocol.java:611)

 at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.doRun(NioEndpoint.java:1736)

 at org.apache.tomcat.util.net.NioEndpoint$SocketProcessor.run(NioEndpoint.java:1695)

 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: java.lang.IllegalArgumentException: Invalid format: "Tue, 18 Nov 2014 07:17:31 GMT" is malformed at "GMT"

 at org.joda.time.format.DateTimeFormatter.parseMillis(DateTimeFormatter.java:634)

 at com.amazonaws.util.DateUtils.parseRFC822Date(DateUtils.java:187)

 ... 56 more

I use UTC on all my servers do I need to install Joda-time to fix this or should something be updated with Teamcity? Java version I'm using 1.7.71

2 comments
Comment actions Permalink

Hi, here's the issue https://youtrack.jetbrains.com/issue/TW-38614, which contains the link to updated plugin.

0
Comment actions Permalink

Hi!
Thank you for fast response this fixed the issue for me! Made the following changes to my TeamCity 8.1.5 installation

Updated java with support for joda-time (to fix UTC and GMT conversion problem)
Changed local timezone to Europe/Stockholm
Updated the plugin cloud-amazon with patch available in your response.

Case closed all is working well!

// Johan
0

Please sign in to leave a comment.