When installing a remote agent, the agent home value is not properly set and a different path is used
Platform notice: Server and Data Center only. This article only applies to Atlassian products on the server and data center platforms.
When a user runs the official command to install a new remote agent, also specifying a home directory, a different home directory is used instead.
Any supported version of Bamboo.
Any supported environment to install remote agents.
To describe this example, we will install a remote agent in Linux. The example command is as follows:
java -Dbamboo.home=/var/agent-home -jar atlassian-bamboo-agent-installer-x.x.x.jar <Bamboo Base URL>/agentServer/
The agent is installed and in the logs we then see:
INFO | jvm 1 | 2022/03/30 11:42:53 | 2022-03-30 11:42:53,904 INFO [WrapperSimpleAppMain] [RemoteAgentHomeLocatorForBootstrap] Using agent home located at [/var/differentDirectory]
As far as we have observed, there are 2 known causes for this problem:
There is a formatting error in the command, and the java argument is not properly loaded.
The installation process creates the file conf/wrapper.conf, which contains a lot of information, including the absolute path to the home directory. If the file already exists prior to the command execution, then there will be mismatches in the installation.
This is a common scenario when the installation process is automated and there is a pre-existing home directory (for example, in a Docker image).
Make sure you are installing the agent in a clean empty directory.