Bamboo ondemand agent stuck on pending state

Hi,

I created a custom elastic image in AWS and started the instance from Bamboo Ondemand. The instance starts up, however the elastic-agent status is always "Pending". Looking at the logs, it is clear that the there is some issue with the file "bamboo-agent.cfg.xml". However this file is empty in the AWS instance.

The log file says:

[Fatal Error] :-1:-1: Premature end of file. Exiting due to fatal exception.

Please help....

Complete log is below:

2014-07-02 09:11:44,024 INFO [Thread-2] [RemoteAgent] Starting application context...
2014-07-02 09:11:47,995 WARN [Thread-2] [PropertyPlaceholderConfigurer] Could not load properties from class path resource [bamboo-init.properties]: class path resource [bamboo-init.properties] cannot be opened because it does not exist
2014-07-02 09:11:48,041 INFO [Thread-2] [RemoteAgentHomeLocatorForBootstrap] Agent home located at '/home/bamboo/bamboo-agent-home'
2014-07-02 09:11:48,041 INFO [Thread-2] [RemoteAgentHomeDirectoryLayout] Plugin directory: /home/bamboo/bamboo-agent-home/plugins
2014-07-02 09:11:48,042 INFO [Thread-2] [RemoteAgentHomeDirectoryLayout] Plugin cache directory: /home/bamboo/bamboo-agent-home/caches/plugins
[Fatal Error] :-1:-1: Premature end of file.
Exiting due to fatal exception.
java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at com.atlassian.bamboo.agent.bootstrap.AgentRunner.run(AgentRunner.java:28)
        at java.lang.Thread.run(Thread.java:744)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'agentConfiguration' defined in class path resource [applicationContextRemoteAgent.xml]: Invocation of init method failed; nested exception is com.atlassian.bamboo.configuration.ConfigurationException: Could not load configuration file bamboo-agent.cfg.xml from /home/bamboo/bamboo-agent-home
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1170)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:427)
        at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:249)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:155)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:246)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:291)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)
        at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:122)
        at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:88)
        at com.atlassian.bamboo.v2.build.agent.remote.RemoteAgent.initApplicationContext(RemoteAgent.java:160)
        at com.atlassian.bamboo.v2.build.agent.remote.RemoteAgent.start(RemoteAgent.java:53)
        at com.atlassian.bamboo.agent.elastic.client.ElasticAgent.start(ElasticAgent.java:24)
        ... 6 more
Caused by: com.atlassian.bamboo.configuration.ConfigurationException: Could not load configuration file bamboo-agent.cfg.xml from /home/bamboo/bamboo-agent-home
        at com.atlassian.bamboo.v2.build.agent.remote.AgentConfiguration.initConfiguration(AgentConfiguration.java:100)
        at com.atlassian.bamboo.v2.build.agent.remote.AgentConfiguration.init(AgentConfiguration.java:61)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1237)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1203)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1167)
        ... 18 more
Caused by: org.apache.commons.configuration.ConfigurationException: Premature end of file.
        at org.apache.commons.configuration.XMLConfiguration.load(XMLConfiguration.java:673)
        at org.apache.commons.configuration.XMLConfiguration.load(XMLConfiguration.java:631)
        at org.apache.commons.configuration.XMLConfiguration$XMLFileConfigurationDelegate.load(XMLConfiguration.java:1092)
        at org.apache.commons.configuration.AbstractFileConfiguration.load(AbstractFileConfiguration.java:283)
        at org.apache.commons.configuration.AbstractFileConfiguration.load(AbstractFileConfiguration.java:215)
        at org.apache.commons.configuration.AbstractFileConfiguration.load(AbstractFileConfiguration.java:193)
        at org.apache.commons.configuration.AbstractHierarchicalFileConfiguration.load(AbstractHierarchicalFileConfiguration.java:163)
        at org.apache.commons.configuration.AbstractHierarchicalFileConfiguration.<init>(AbstractHierarchicalFileConfiguration.java:108)
        at org.apache.commons.configuration.XMLConfiguration.<init>(XMLConfiguration.java:188)
        at com.atlassian.bamboo.v2.build.agent.remote.AgentConfiguration.initConfiguration(AgentConfiguration.java:90)
        ... 26 more
Caused by: org.xml.sax.SAXParseException; Premature end of file.
        at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
        at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
        at org.apache.commons.configuration.XMLConfiguration.load(XMLConfiguration.java:665)
        ... 35 more
2014-07-02 09:11:48,121 FATAL [Thread-2] [AgentBootstrap] Exiting due to fatal exception.
java.lang.reflect.InvocationTargetException
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at com.atlassian.bamboo.agent.bootstrap.AgentRunner.run(AgentRunner.java:28)
        at java.lang.Thread.run(Thread.java:744)
Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'agentConfiguration' defined in class path resource [applicationContextRemoteAgent.xml]: Invocation of init method failed; nested exception is com.atlassian.bamboo.configuration.ConfigurationException: Could not load configuration file bamboo-agent.cfg.xml from /home/bamboo/bamboo-agent-home
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1170)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:427)
        at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:249)
        at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:155)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:246)
        at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)
        at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:291)
        at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)
        at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:122)
        at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:88)
        at com.atlassian.bamboo.v2.build.agent.remote.RemoteAgent.initApplicationContext(RemoteAgent.java:160)
        at com.atlassian.bamboo.v2.build.agent.remote.RemoteAgent.start(RemoteAgent.java:53)
        at com.atlassian.bamboo.agent.elastic.client.ElasticAgent.start(ElasticAgent.java:24)
        ... 6 more
Caused by: com.atlassian.bamboo.configuration.ConfigurationException: Could not load configuration file bamboo-agent.cfg.xml from /home/bamboo/bamboo-agent-home
        at com.atlassian.bamboo.v2.build.agent.remote.AgentConfiguration.initConfiguration(AgentConfiguration.java:100)
        at com.atlassian.bamboo.v2.build.agent.remote.AgentConfiguration.init(AgentConfiguration.java:61)
        at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
        at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
        at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
        at java.lang.reflect.Method.invoke(Method.java:606)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1237)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1203)
        at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1167)
        ... 18 more
Caused by: org.apache.commons.configuration.ConfigurationException: Premature end of file.
        at org.apache.commons.configuration.XMLConfiguration.load(XMLConfiguration.java:673)
        at org.apache.commons.configuration.XMLConfiguration.load(XMLConfiguration.java:631)
        at org.apache.commons.configuration.XMLConfiguration$XMLFileConfigurationDelegate.load(XMLConfiguration.java:1092)
        at org.apache.commons.configuration.AbstractFileConfiguration.load(AbstractFileConfiguration.java:283)
        at org.apache.commons.configuration.AbstractFileConfiguration.load(AbstractFileConfiguration.java:215)
        at org.apache.commons.configuration.AbstractFileConfiguration.load(AbstractFileConfiguration.java:193)
        at org.apache.commons.configuration.AbstractHierarchicalFileConfiguration.load(AbstractHierarchicalFileConfiguration.java:163)
        at org.apache.commons.configuration.AbstractHierarchicalFileConfiguration.<init>(AbstractHierarchicalFileConfiguration.java:108)
        at org.apache.commons.configuration.XMLConfiguration.<init>(XMLConfiguration.java:188)
        at com.atlassian.bamboo.v2.build.agent.remote.AgentConfiguration.initConfiguration(AgentConfiguration.java:90)
        ... 26 more
Caused by: org.xml.sax.SAXParseException; Premature end of file.
        at org.apache.xerces.parsers.DOMParser.parse(Unknown Source)
        at org.apache.xerces.jaxp.DocumentBuilderImpl.parse(Unknown Source)
        at org.apache.commons.configuration.XMLConfiguration.load(XMLConfiguration.java:665)
        ... 35 more
[root@ip-172-31-36-143 bin]#

3 answers

This widget could not be displayed.

Hi Joji,

One possibility here is that the user account running the Bamboo instance does not have permission to access the required config file. Could you please double check that Bamboo service is run with administrator permissions and that Bamboo user can access the config file and directory in which it's held.

If this is not your issue could you please visit support.atlassian.comand create a support request so we can further assist you?

Thanks!

Turner

Also it's possible that the config file has been removed. So please check that it still exists :)

This widget could not be displayed.

I am stuck on the same issue. Can't log the issue since I am using Bamboo onDemand.
Status gets stuck to pending and then the instance gets terminated.

This widget could not be displayed.

Facing same issue. So many posts for the same question. Elastic agent stuck on 'pending' status. How do I make it online? Am using bamboo onDemand? Can I log the issue?

Suggest an answer

Log in or Sign up to answer
Community showcase
Posted yesterday in Jira

What modern development practices are at the heart of how your team delivers software?

Hey Community mates! Claire here from the Software Product Marketing team. We all know software development changes rapidly, and it's often tough to keep up. But from our research, we've found the h...

53 views 0 1
Join discussion

Atlassian User Groups

Connect with like-minded Atlassian users at free events near you!

Find a group

Connect with like-minded Atlassian users at free events near you!

Find my local user group

Unfortunately there are no AUG chapters near you at the moment.

Start an AUG

You're one step closer to meeting fellow Atlassian users at your local meet up. Learn more about AUGs

Groups near you