Error when running agent java.net.SocketException Address already in use
This KB article is not relevant to any version of Bamboo currently supported. If this fits your current installation, please consider upgrading Bamboo
Symptoms
The remote agent won't start,
java \-jar atlassian-bamboo-agent-installer-2.2.1.jar}} {{[http://myserver:8085/agentServer/]
It reports that the address is already in use;
STATUS | wrapper | 2009/05/29 10:10:08 | --> Wrapper Started as Console
STATUS | wrapper | 2009/05/29 10:10:09 | Launching a JVM...
INFO | jvm 1 | 2009/05/29 10:10:09 | Wrapper (Version 3.2.3) http://wrapper.tanukisoftware.org
INFO | jvm 1 | 2009/05/29 10:10:09 | Copyright 1999-2006 Tanuki Software,Inc. All Rights Reserved.
INFO | jvm 1 | 2009/05/29 10:10:09
INFO | jvm 1 | 2009/05/29 10:10:09 | java.net.SocketException: Address already in use
INFO | jvm 1 | 2009/05/29 10:10:09 | java.net.SocketException: Address already in use
...
So far limited to Platform SunOS authbuild02 5.10 Generic_138889-02 i86pc i386 i86pc, Solaris 10 zone running on Intel hardware.
Cause
The problem is in the version of the tanuki wrapper version 232 that ships with bamboo. The wrapper is attempting to open a socket on the remote agent port but failing.
However, it is not recognizing the exception correctly in order to try the next available port number.
The problem seems to be the logic inside WrapperManager.openSocket(), which looks for either a BindException or an exception with "errno: 48" in the message. In this case there is neither.
Resolution
download the latest version of the wrapper yourself for your platform (if your organization allows you to) and copy,
- <wrapper>/bin/wrapper
- <wrapper>/lib/libwrapper.jnilib
- <wrapper>/lib/wrapper.jar
into <bamboo-agent-home>. Then set,
BAMBOO_AGENT_HOME=<bamboo-agent-home>
BAMBOO_SERVER=http://<myserver>:8085/agentServer/
and restart the agent with ./bin/bamboo-agent.sh