Cannot connect existing Windows EC2 instance to bamboo server.
Asked by Richard Hale:

I've followed instructions from here

<http://blogs.atlassian.com/2011/12/bamboo-amazon-ec2-windows-part2/>

Used the following agent:

<https://maven.atlassian.com/content/repositories/atlassian-public/com/atlassian/bamboo/atlassian-bamboo-agent-installer/3.0.4-studio-10/atlassian-bamboo-agent-installer-3.0.4-studio-10.jar>

with the following configuration:

# Application parameters. Add parameters as needed starting from 1 wrapper.app.parameter.1=com.atlassian.bamboo.agent.bootstrap.AgentBootstrap

wrapper.app.parameter.2=https://esosolutions.atlassian.net/builds/agentServer

Bamboo Version Information

Version 3.0.4-studio-10

Build Number 2302

Build Date 3/23/12

The configuration (on server Administration --\> builds --\> System Properties):

JMS Information

Broker URI tcp://localhost:20000

Broker VM URI vm://bamboo

It shows all instances as unconnected. There are following lines in the agent log file:

INFO \| jvm 1061 \| 2012/07/08 17:27:48 \| 2012-07-08 17:27:48,436 INFO \[Thread-1\] \[BambooActiveMQConnectionFactory\] Setting broker URL to 'failover:(tcp://localhost:54663?wireFormat.maxInactivityDuration=300000)?maxReconnectAttempts=10\&initialReconnectDelay=15000'

INFO \| jvm 1061 \| 2012/07/08 17:27:50 \| 2012-07-08 17:27:49,980 INFO \[Thread-1\] \[BambooJmsProxyFactoryBean\] Disabling message expiry

INFO \| jvm 1061 \| 2012/07/08 17:27:51 \| Received a packet PING : ping

INFO \| jvm 1061 \| 2012/07/08 17:27:51 \| Send a packet PING : ok

INFO \| jvm 1061 \| 2012/07/08 17:27:56 \| Received a packet PING : ping

INFO \| jvm 1061 \| 2012/07/08 17:27:56 \| Send a packet PING : ok

INFO \| jvm 1061 \| 2012/07/08 17:28:01 \| Received a packet PING : ping

INFO \| jvm 1061 \| 2012/07/08 17:28:01 \| Send a packet PING : ok

INFO \| jvm 1061 \| 2012/07/08 17:28:05 \| Received a packet PING : ping

INFO \| jvm 1061 \| 2012/07/08 17:28:05 \| Send a packet PING : ok

INFO \| jvm 1061 \| 2012/07/08 17:28:10 \| Received a packet PING : ping

INFO \| jvm 1061 \| 2012/07/08 17:28:10 \| Send a packet PING : ok

INFO \| jvm 1061 \| 2012/07/08 17:28:13 \| 2012-07-08 17:28:13,552 ERROR \[ActiveMQ Task\] \[FailoverTransport\] Failed to connect to transport after: 10 attempt(s)

INFO \| jvm 1061 \| 2012/07/08 17:28:13 \| 2012-07-08 17:28:13,676 WARN \[Thread-1\] \[BambooJmsProxyFactoryBean\] Exception when running afterPropertiesSet

INFO \| jvm 1061 \| 2012/07/08 17:28:13 \| javax.jms.JMSException: Connection refused: connect

INFO \| jvm 1061 \| 2012/07/08 17:28:13 \|at org.apache.activemq.util.JMSExceptionSupport.create(JMSExceptionSupport.java:62)

INFO \| jvm 1061 \| 2012/07/08 17:28:13 \|at org.apache.activemq.ActiveMQConnection.syncSendPacket(ActiveMQConnection.java:1296)

INFO \| jvm 1061 \| 2012/07/08 17:28:13 \|at org.apache.activemq.ActiveMQConnection.ensureConnectionInfoSent(ActiveMQConnection.java:1380)

INFO \| jvm 1061 \| 2012/07/08 17:28:13 \|at org.apache.activemq.ActiveMQConnection.start(ActiveMQConnection.java:505)

INFO \| jvm 1061 \| 2012/07/08 17:28:13 \|at org.jencks.amqpool.ConnectionPool.start(ConnectionPool.java:75)

INFO \| jvm 1061 \| 2012/07/08 17:28:13 \|at org.jencks.amqpool.PooledConnection.start(PooledConnection.java:76)

INFO \| jvm 1061 \| 2012/07/08 17:28:13 \|at org.logicblaze.lingo.jms.JmsProducerConfig.createConnection(JmsProducerConfig.java:87)

INFO \| jvm 1061 \| 2012/07/08 17:28:13 \|at com.atlassian.bamboo.lingo.BambooMultiplexingRequestor.newInstance(BambooMultiplexingRequestor.java:34)

INFO \| jvm 1061 \| 2012/07/08 17:28:13 \|at com.atlassian.bamboo.lingo.BambooJmsProxyFactoryBean.createRequestor(BambooJmsProxyFactoryBean.java:38)

INFO \| jvm 1061 \| 2012/07/08 17:28:13 \|at org.logicblaze.lingo.jms.JmsClientInterceptor.afterPropertiesSet(JmsClientInterceptor.java:114)

INFO \| jvm 1061 \| 2012/07/08 17:28:13 \|at org.logicblaze.lingo.jms.JmsProxyFactoryBean.afterPropertiesSet(JmsProxyFactoryBean.java:44)

INFO \| jvm 1061 \| 2012/07/08 17:28:13 \|at com.atlassian.bamboo.lingo.BambooJmsProxyFactoryBean.afterPropertiesSet(BambooJmsProxyFactoryBean.java:26)

INFO \| jvm 1061 \| 2012/07/08 17:28:13 \|at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1198)

INFO \| jvm 1061 \| 2012/07/08 17:28:13 \|at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1167)

INFO \| jvm 1061 \| 2012/07/08 17:28:13 \|at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:427)

INFO \| jvm 1061 \| 2012/07/08 17:28:13 \|at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:249)

INFO \| jvm 1061 \| 2012/07/08 17:28:13 \|at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:155)

INFO \| jvm 1061 \| 2012/07/08 17:28:13 \|at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:246)

INFO \| jvm 1061 \| 2012/07/08 17:28:13 \|at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)

INFO \| jvm 1061 \| 2012/07/08 17:28:13 \|at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveReference(BeanDefinitionValueResolver.java:267)

INFO \| jvm 1061 \| 2012/07/08 17:28:13 \|at org.springframework.beans.factory.support.BeanDefinitionValueResolver.resolveValueIfNecessary(BeanDefinitionValueResolver.java:110)

INFO \| jvm 1061 \| 2012/07/08 17:28:13 \|at org.springframework.beans.factory.support.ConstructorResolver.resolveConstructorArguments(ConstructorResolver.java:389)

INFO \| jvm 1061 \| 2012/07/08 17:28:13 \|at org.springframework.beans.factory.support.ConstructorResolver.autowireConstructor(ConstructorResolver.java:120)

INFO \| jvm 1061 \| 2012/07/08 17:28:13 \|at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.autowireConstructor(AbstractAutowireCapableBeanFactory.java:795)

INFO \| jvm 1061 \| 2012/07/08 17:28:13 \|at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:713)

INFO \| jvm 1061 \| 2012/07/08 17:28:13 \|at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:386)

INFO \| jvm 1061 \| 2012/07/08 17:28:13 \|at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:249)

INFO \| jvm 1061 \| 2012/07/08 17:28:13 \|at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:155)

INFO \| jvm 1061 \| 2012/07/08 17:28:13 \|at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:246)

INFO \| jvm 1061 \| 2012/07/08 17:28:13 \|at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)

INFO \| jvm 1061 \| 2012/07/08 17:28:13 \|at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:291)

INFO \| jvm 1061 \| 2012/07/08 17:28:13 \|at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)

INFO \| jvm 1061 \| 2012/07/08 17:28:13 \|at org.springframework.context.support.ClassPathXmlApplicationContext.\<init\>(ClassPathXmlApplicationContext.java:122)

INFO \| jvm 1061 \| 2012/07/08 17:28:13 \|at org.springframework.context.support.ClassPathXmlApplicationContext.\<init\>(ClassPathXmlApplicationContext.java:88)

INFO \| jvm 1061 \| 2012/07/08 17:28:13 \|at com.atlassian.bamboo.v2.build.agent.remote.RemoteAgent.initApplicationContext(RemoteAgent.java:190)

INFO \| jvm 1061 \| 2012/07/08 17:28:13 \|at com.atlassian.bamboo.v2.build.agent.remote.RemoteAgent.start(RemoteAgent.java:53)

INFO \| jvm 1061 \| 2012/07/08 17:28:13 \|at com.atlassian.bamboo.agent.bootstrap.AgentRunner.run(AgentRunner.java:20)

INFO \| jvm 1061 \| 2012/07/08 17:28:13 \|at java.lang.Thread.run(Unknown Source)

INFO \| jvm 1061 \| 2012/07/08 17:28:13 \| Caused by: java.net.ConnectException: Connection refused: connect

INFO \| jvm 1061 \| 2012/07/08 17:28:13 \|at java.net.PlainSocketImpl.socketConnect(Native Method)

INFO \| jvm 1061 \| 2012/07/08 17:28:13 \|at java.net.PlainSocketImpl.doConnect(Unknown Source)

INFO \| jvm 1061 \| 2012/07/08 17:28:13 \|at java.net.PlainSocketImpl.connectToAddress(Unknown Source)

INFO \| jvm 1061 \| 2012/07/08 17:28:13 \|at java.net.PlainSocketImpl.connect(Unknown Source)

INFO \| jvm 1061 \| 2012/07/08 17:28:13 \|at java.net.SocksSocketImpl.connect(Unknown Source)

INFO \| jvm 1061 \| 2012/07/08 17:28:13 \|at java.net.Socket.connect(Unknown Source)

INFO \| jvm 1061 \| 2012/07/08 17:28:13 \|at org.apache.activemq.transport.tcp.TcpTransport.connect(TcpTransport.java:436)

INFO \| jvm 1061 \| 2012/07/08 17:28:13 \|at org.apache.activemq.transport.tcp.TcpTransport.doStart(TcpTransport.java:402)

INFO \| jvm 1061 \| 2012/07/08 17:28:13 \|at org.apache.activemq.util.ServiceSupport.start(ServiceSupport.java:53)

INFO \| jvm 1061 \| 2012/07/08 17:28:13 \|at org.apache.activemq.transport.TransportFilter.start(TransportFilter.java:57)

INFO \| jvm 1061 \| 2012/07/08 17:28:13 \|at org.apache.activemq.transport.TransportFilter.start(TransportFilter.java:57)

INFO \| jvm 1061 \| 2012/07/08 17:28:13 \|at org.apache.activemq.transport.WireFormatNegotiator.start(WireFormatNegotiator.java:72)

INFO \| jvm 1061 \| 2012/07/08 17:28:13 \|at org.apache.activemq.transport.failover.FailoverTransport.doReconnect(FailoverTransport.java:726)

INFO \| jvm 1061 \| 2012/07/08 17:28:13 \|at org.apache.activemq.transport.failover.FailoverTransport$2.iterate(FailoverTransport.java:116)

INFO \| jvm 1061 \| 2012/07/08 17:28:13 \|at org.apache.activemq.thread.PooledTaskRunner.runTask(PooledTaskRunner.java:122)

INFO \| jvm 1061 \| 2012/07/08 17:28:13 \|at org.apache.activemq.thread.PooledTaskRunner$1.run(PooledTaskRunner.java:43)

INFO \| jvm 1061 \| 2012/07/08 17:28:13 \|at java.util.concurrent.ThreadPoolExecutor$Worker.runTask(Unknown Source)

INFO \| jvm 1061 \| 2012/07/08 17:28:13 \|at java.util.concurrent.ThreadPoolExecutor$Worker.run(Unknown Source)

INFO \| jvm 1061 \| 2012/07/08 17:28:13 \|... 1 more

INFO \| jvm 1061 \| 2012/07/08 17:28:14 \| 2012-07-08 17:28:13,926 FATAL \[Thread-1\] \[RemoteAgent\] Unable to connect to the server. Please ensure your path is correct and that remote agents are enabled.

INFO \| jvm 1061 \| 2012/07/08 17:28:14 \| Exiting due to fatal exception.

INFO \| jvm 1061 \| 2012/07/08 17:28:14 \| org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'buildAgentController' defined in class path resource \[applicationContextRemoteAgent.xml\]: Cannot resolve reference to bean 'capabilitySetManager' while setting constructor argument; nested exception is org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'capabilitySetManager' defined in class path resource \[applicationContextRemoteAgentJMS.xml\]: Invocation of init method failed; nested exception is java.lang.RuntimeException: Exception when running afterPropertiesSet


Answers:
author: Przemek Bruski
body: The blog is about Bamboo 4 (which will be available on OnDemand very soon). I'd recommend waiting until the upgrade is done, because you'll need to update the image for Bamboo 4 anyway. Also, new Bamboo will contain a Windows image which will be a good starting point for your customisation.

If you can't wait, you should follow the instrucitons for older Bamboo versions (i.e. download the elastic assembly for your Bamboo version), Unfortunately, there are no official Windows-specific instructions for older versions of Bamboo - I think someone outside of Atlassian blogged about this though.

comments: author: Richard Hale
body: The blog above is about bamboo 3.4.  
Are there any dates when Bamboo 4 will be available ondemand?

The latest version of agent that matches the version of the ondemand installation been used, the version was [3.0.4-studio-10](https://maven.atlassian.com/content/repositories/atlassian-public/com/atlassian/bamboo/atlassian-bamboo-agent-installer/3.0.4-studio-10/atlassian-bamboo-agent-installer-3.0.4-studio-10.jar)

Can you point to the URL with different version of the Windows AMI customization for bamboo?


author: Przemek Bruski
body: > Are there any dates when Bamboo 4 will be available ondemand?

It should be available this month.
> The latest version of agent that matches the version of the ondemand installation been used, the version was [3.0.4-studio-10](https://maven.atlassian.com/content/repositories/atlassian-public/com/atlassian/bamboo/atlassian-bamboo-agent-installer/3.0.4-studio-10/atlassian-bamboo-agent-installer-3.0.4-studio-10.jar)

Yeah, but this is a remote agent, not elastic one. It won't work with OnDemand.
> Can you point to the URL with different version of the Windows AMI customization for bamboo?

You can try one of these links:

<http://stackoverflow.com/questions/7149973/creating-a-windows-ami-for-bamboo-in-jira-studio-for-builds>

<http://devopscloud.net/2011/03/25/setting-up-a-windows-ami-for-use-with-elastic-bamboo/>

<http://consultingblogs.emc.com/gracemollison/archive/2011/01/18/how-to-set-up-a-windows-ami-to-use-with-elastic-bamboo.aspx>


author: Richard Hale
body: <http://stackoverflow.com/questions/7149973/creating-a-windows-ami-for-bamboo-in-jira-studio-for-builds>

worked perfect, thank you!!!


Tags: cloud

elastic-agent

windows