Error when running agent java.net.SocketException Address already in use

Platform Notice: Data Center Only - This article only applies to Atlassian products on the Data Center platform.

Note that this KB was created for the Data Center version of the product. Data Center KBs for non-Data-Center-specific features may also work for Server versions of the product, however they have not been tested. Support for Server* products ended on February 15th 2024. If you are running a Server product, you can visit the Atlassian Server end of support announcement to review your migration options.

*Except Fisheye and Crucible

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,

1 java \-jar atlassian-bamboo-agent-installer-2.2.1.jar}} {{[http://myserver:8085/agentServer/]

It reports that the address is already in use;

1 2 3 4 5 6 7 8 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,

1 2 BAMBOO_AGENT_HOME=<bamboo-agent-home> BAMBOO_SERVER=http://<myserver>:8085/agentServer/

and restart the agent with ./bin/bamboo-agent.sh

Updated on April 8, 2025

Still need help?

The Atlassian Community is here for you.