imac下bamboo-agent启动报错

2013年12月23日 发表评论 阅读评论

新布的一台imac下的bamboo agent代理编译机器在启动时报错,报错主要内容为:Can't connect to window server - not enough permissions  .具体解决步骤现做下总结。

先看下报错内容:

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

解决方法:

找到bamboo agent 的data目录并修改其中的conf文件,增加如下内容:

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

其中程序启动脚本如下:

cat  /App/bamboo-installer/run.sh
#!/bin/bash
cd /App/bamboo-installer/;nohup java -Ddisable_agent_auto_capability_detection=true -Dbamboo.home=/data1/bamboo-agent-home -jar atlassian-bamboo-agent-installer-4.4.5.jar http://sgoa.361way.com/bamboo/agentServer/ &

修改完wrapper.conf文件后,sudo sh run.sh重新启动 ,登陆bamboo并用管理员账号在Agent authentication选项approve刚刚的agent即可。过一会儿就会在Online remote agents查看到新加的那台主机。

参考atlassian官方页面




本站的发展离不开您的资助,金额随意,欢迎来赏!

You can donate through PayPal.
My paypal id: itybku@139.com
Paypal page: https://www.paypal.me/361way

分类: Linux/unix/mac 标签:
  1. 本文目前尚无任何评论.
  1. 本文目前尚无任何 trackbacks 和 pingbacks.