Bamboo (agent or server) fails to start with "not enough permissions" error

Still need help?

The Atlassian Community is here for you.

Ask the community

Symptoms

When starting a Bamboo agent or server, it just keeps looping and JVM keeps retryingFollowing error appears in the agent logs:

INFO   | jvm 1    | 2013/04/08 11:14:48 | 2013-04-08 11:14:48,525 FATAL [Thread-2] [AgentBootstrap] Exiting due to fatal exception.
INFO   | jvm 1    | 2013/04/08 11:14:48 | java.lang.reflect.InvocationTargetException
INFO   | jvm 1    | 2013/04/08 11:14:48 | 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
INFO   | jvm 1    | 2013/04/08 11:14:48 | 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
INFO   | jvm 1    | 2013/04/08 11:14:48 | 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
INFO   | jvm 1    | 2013/04/08 11:14:48 | 	at java.lang.reflect.Method.invoke(Method.java:597)
INFO   | jvm 1    | 2013/04/08 11:14:48 | 	at com.atlassian.bamboo.agent.bootstrap.AgentRunner.run(AgentRunner.java:28)
INFO   | jvm 1    | 2013/04/08 11:14:48 | 	at java.lang.Thread.run(Thread.java:680)
INFO   | jvm 1    | 2013/04/08 11:14:48 | Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'agentRegistrationBean' defined in class path resource [applicationContextRemoteAgentStartup.xml]: Invocation of init method failed; nested exception is com.atlassian.util.concurrent.LazyReference$InitializationException: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.atlassian.bamboo.plugin.dotnet.nant.NantCapabilityDefaultsHelper': Instantiation of bean failed; nested exception is java.lang.InternalError: Can't connect to window server - not enough permissions.
INFO   | jvm 1    | 2013/04/08 11:14:48 | 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1170)
INFO   | jvm 1    | 2013/04/08 11:14:48 | 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:427)
INFO   | jvm 1    | 2013/04/08 11:14:48 | 	at org.springframework.beans.factory.support.AbstractBeanFactory$1.getObject(AbstractBeanFactory.java:249)
INFO   | jvm 1    | 2013/04/08 11:14:48 | 	at org.springframework.beans.factory.support.DefaultSingletonBeanRegistry.getSingleton(DefaultSingletonBeanRegistry.java:155)
INFO   | jvm 1    | 2013/04/08 11:14:48 | 	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:246)
INFO   | jvm 1    | 2013/04/08 11:14:48 | 	at org.springframework.beans.factory.support.AbstractBeanFactory.getBean(AbstractBeanFactory.java:160)
INFO   | jvm 1    | 2013/04/08 11:14:48 | 	at org.springframework.beans.factory.support.DefaultListableBeanFactory.preInstantiateSingletons(DefaultListableBeanFactory.java:291)
INFO   | jvm 1    | 2013/04/08 11:14:48 | 	at org.springframework.context.support.AbstractApplicationContext.refresh(AbstractApplicationContext.java:352)
INFO   | jvm 1    | 2013/04/08 11:14:48 | 	at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:122)
INFO   | jvm 1    | 2013/04/08 11:14:48 | 	at org.springframework.context.support.ClassPathXmlApplicationContext.<init>(ClassPathXmlApplicationContext.java:88)
INFO   | jvm 1    | 2013/04/08 11:14:48 | 	at com.atlassian.bamboo.v2.build.agent.remote.RemoteAgent.initApplicationContext(RemoteAgent.java:176)
INFO   | jvm 1    | 2013/04/08 11:14:48 | 	at com.atlassian.bamboo.v2.build.agent.remote.RemoteAgent.start(RemoteAgent.java:53)
INFO   | jvm 1    | 2013/04/08 11:14:48 | 	... 6 more
INFO   | jvm 1    | 2013/04/08 11:14:48 | Caused by: com.atlassian.util.concurrent.LazyReference$InitializationException: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.atlassian.bamboo.plugin.dotnet.nant.NantCapabilityDefaultsHelper': Instantiation of bean failed; nested exception is java.lang.InternalError: Can't connect to window server - not enough permissions.
INFO   | jvm 1    | 2013/04/08 11:14:48 | 	at com.atlassian.util.concurrent.LazyReference.getInterruptibly(LazyReference.java:152)
INFO   | jvm 1    | 2013/04/08 11:14:48 | 	at com.atlassian.util.concurrent.LazyReference.get(LazyReference.java:115)
INFO   | jvm 1    | 2013/04/08 11:14:48 | 	at com.atlassian.util.concurrent.ResettableLazyReference.get(ResettableLazyReference.java:89)
INFO   | jvm 1    | 2013/04/08 11:14:48 | 	at com.atlassian.bamboo.plugin.descriptor.TaskModuleDescriptorImpl.getCapabilityDefaultsHelper(TaskModuleDescriptorImpl.java:162)
INFO   | jvm 1    | 2013/04/08 11:14:48 | 	at com.atlassian.bamboo.v2.build.agent.capability.CapabilityDefaultsHelperImpl.getCapabilityDefaultsHelpers(CapabilityDefaultsHelperImpl.java:78)
INFO   | jvm 1    | 2013/04/08 11:14:48 | 	at com.atlassian.bamboo.v2.build.agent.capability.CapabilityDefaultsHelperImpl.addDefaultCapabilities(CapabilityDefaultsHelperImpl.java:39)
INFO   | jvm 1    | 2013/04/08 11:14:48 | 	at com.atlassian.bamboo.v2.build.agent.remote.AgentRegistrationBean.registerAgent(AgentRegistrationBean.java:36)
INFO   | jvm 1    | 2013/04/08 11:14:48 | 	at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
INFO   | jvm 1    | 2013/04/08 11:14:48 | 	at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:39)
INFO   | jvm 1    | 2013/04/08 11:14:48 | 	at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:25)
INFO   | jvm 1    | 2013/04/08 11:14:48 | 	at java.lang.reflect.Method.invoke(Method.java:597)
INFO   | jvm 1    | 2013/04/08 11:14:48 | 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeCustomInitMethod(AbstractAutowireCapableBeanFactory.java:1237)
INFO   | jvm 1    | 2013/04/08 11:14:48 | 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.invokeInitMethods(AbstractAutowireCapableBeanFactory.java:1203)
INFO   | jvm 1    | 2013/04/08 11:14:48 | 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.initializeBean(AbstractAutowireCapableBeanFactory.java:1167)
INFO   | jvm 1    | 2013/04/08 11:14:48 | 	... 17 more
INFO   | jvm 1    | 2013/04/08 11:14:48 | Caused by: org.springframework.beans.factory.BeanCreationException: Error creating bean with name 'com.atlassian.bamboo.plugin.dotnet.nant.NantCapabilityDefaultsHelper': Instantiation of bean failed; nested exception is java.lang.InternalError: Can't connect to window server - not enough permissions.
INFO   | jvm 1    | 2013/04/08 11:14:48 | 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:451)
INFO   | jvm 1    | 2013/04/08 11:14:48 | 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:246)
INFO   | jvm 1    | 2013/04/08 11:14:48 | 	at com.atlassian.spring.container.SpringContainerContext.createCompleteComponent(SpringContainerContext.java:90)
INFO   | jvm 1    | 2013/04/08 11:14:48 | 	at com.atlassian.bamboo.plugin.descriptor.AbstractBambooModuleDescriptor.instantiateClass(AbstractBambooModuleDescriptor.java:108)
INFO   | jvm 1    | 2013/04/08 11:14:48 | 	at com.atlassian.bamboo.plugin.descriptor.TaskModuleDescriptorImpl$2.create(TaskModuleDescriptorImpl.java:75)
INFO   | jvm 1    | 2013/04/08 11:14:48 | 	at com.atlassian.bamboo.plugin.descriptor.TaskModuleDescriptorImpl$2.create(TaskModuleDescriptorImpl.java:68)
INFO   | jvm 1    | 2013/04/08 11:14:48 | 	at com.atlassian.util.concurrent.ResettableLazyReference$InternalReference.create(ResettableLazyReference.java:143)
INFO   | jvm 1    | 2013/04/08 11:14:48 | 	at com.atlassian.util.concurrent.LazyReference$Sync.run(LazyReference.java:326)
INFO   | jvm 1    | 2013/04/08 11:14:48 | 	at com.atlassian.util.concurrent.LazyReference.getInterruptibly(LazyReference.java:146)
INFO   | jvm 1    | 2013/04/08 11:14:48 | 	... 30 more
INFO   | jvm 1    | 2013/04/08 11:14:48 | Caused by: java.lang.InternalError: Can't connect to window server - not enough permissions.
INFO   | jvm 1    | 2013/04/08 11:14:48 | 	at java.lang.ClassLoader$NativeLibrary.load(Native Method)
INFO   | jvm 1    | 2013/04/08 11:14:48 | 	at java.lang.ClassLoader.loadLibrary0(ClassLoader.java:1827)
INFO   | jvm 1    | 2013/04/08 11:14:48 | 	at java.lang.ClassLoader.loadLibrary(ClassLoader.java:1724)
INFO   | jvm 1    | 2013/04/08 11:14:48 | 	at java.lang.Runtime.loadLibrary0(Runtime.java:823)
INFO   | jvm 1    | 2013/04/08 11:14:48 | 	at java.lang.System.loadLibrary(System.java:1045)
INFO   | jvm 1    | 2013/04/08 11:14:48 | 	at sun.security.action.LoadLibraryAction.run(LoadLibraryAction.java:50)
INFO   | jvm 1    | 2013/04/08 11:14:48 | 	at java.security.AccessController.doPrivileged(Native Method)
INFO   | jvm 1    | 2013/04/08 11:14:48 | 	at sun.awt.NativeLibLoader.loadLibraries(NativeLibLoader.java:38)
INFO   | jvm 1    | 2013/04/08 11:14:48 | 	at sun.awt.DebugHelper.<clinit>(DebugHelper.java:29)
INFO   | jvm 1    | 2013/04/08 11:14:48 | 	at java.awt.Component.<clinit>(Component.java:566)
INFO   | jvm 1    | 2013/04/08 11:14:48 | 	at java.lang.Class.forName0(Native Method)
INFO   | jvm 1    | 2013/04/08 11:14:48 | 	at java.lang.Class.forName(Class.java:171)
INFO   | jvm 1    | 2013/04/08 11:14:48 | 	at com.sun.jna.Platform.<clinit>(Platform.java:64)
INFO   | jvm 1    | 2013/04/08 11:14:48 | 	at com.atlassian.bamboo.plugin.dotnet.nant.NantCapabilityDefaultsHelper.<clinit>(NantCapabilityDefaultsHelper.java:20)
INFO   | jvm 1    | 2013/04/08 11:14:48 | 	at sun.reflect.NativeConstructorAccessorImpl.newInstance0(Native Method)
INFO   | jvm 1    | 2013/04/08 11:14:48 | 	at sun.reflect.NativeConstructorAccessorImpl.newInstance(NativeConstructorAccessorImpl.java:39)
INFO   | jvm 1    | 2013/04/08 11:14:48 | 	at sun.reflect.DelegatingConstructorAccessorImpl.newInstance(DelegatingConstructorAccessorImpl.java:27)
INFO   | jvm 1    | 2013/04/08 11:14:48 | 	at java.lang.reflect.Constructor.newInstance(Constructor.java:513)
INFO   | jvm 1    | 2013/04/08 11:14:48 | 	at org.springframework.beans.BeanUtils.instantiateClass(BeanUtils.java:85)
INFO   | jvm 1    | 2013/04/08 11:14:48 | 	at org.springframework.beans.factory.support.SimpleInstantiationStrategy.instantiate(SimpleInstantiationStrategy.java:61)
INFO   | jvm 1    | 2013/04/08 11:14:48 | 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.instantiateBean(AbstractAutowireCapableBeanFactory.java:752)
INFO   | jvm 1    | 2013/04/08 11:14:48 | 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBeanInstance(AbstractAutowireCapableBeanFactory.java:717)
INFO   | jvm 1    | 2013/04/08 11:14:48 | 	at org.springframework.beans.factory.support.AbstractAutowireCapableBeanFactory.createBean(AbstractAutowireCapableBeanFactory.java:386)
INFO   | jvm 1    | 2013/04/08 11:14:48 | 	... 38 more
ERROR  | wrapper  | 2013/04/08 11:14:48 | JVM exited unexpectedly.
....

Resolution for Bamboo agent

1. Edit the wrapper.conf on the agent  located in  <bamboo-agent-home>/conf and add -Djava.awt.headless=true parameter. It will look like: "wrapper.java.additional.3=-Djava.awt.headless=true". 

# The Bamboo Agent home configuration file
wrapper.java.additional.1=-Dbamboo.home=/Users/bamboo/bamboo-agent-home
wrapper.java.additional.2=-Dbamboo.agent.ignoreServerCertName=false
wrapper.java.additional.3=-Djava.awt.headless=true

Resolution for Bamboo server

1. Shut down Bamboo
2. Edit the wrapper.conf located in  <bamboo-installation-directory>/conf and add the -Djava.awt.headless=true parameter if it does not already exist. It will look like "wrapper.java.additional.3=-Djava.awt.headless=true":

wrapper.java.additional.2=-XX:MaxPermSize=256m
wrapper.java.additional.3=-Djava.awt.headless=true
wrapper.java.additional.4=-Djava.io.tmpdir=%WINDIR%/Temp

3. Start Bamboo

Last modified on Dec 2, 2019

Was this helpful?

Yes
No
Provide feedback about this article
Powered by Confluence and Scroll Viewport.