Bamboo remote agent on Windows running as a service with a local account still uses the SYSTEM account

Still need help?

The Atlassian Community is here for you.

Ask the community

Platform notice: Server and Data Center only. This article only applies to Atlassian products on the server and data center platforms.

Summary

A Bamboo Windows agent is running using a local account but the build logs show that the user is SYSTEM:

build	09-Dec-2022 06:58:50	USERNAME=SYSTEM
build	09-Dec-2022 06:58:50	USERPROFILE=C:\Users\<BAMBOO_LOCAL_ACCOUNT>

Environment

Observed on Bamboo 8.2 after an upgrade.

Diagnosis

  1. Run a Bamboo build containing a Script Task with the following content:

    env

    The build logs will then contain all the environment variables. Look for the USERNAME variable, which will show as SYSTEM even though the USERPROFILE location points to the home directory of the local account running the agent:

    PROD
    build	09-Dec-2022 06:58:50	USERNAME=SYSTEM
    build	09-Dec-2022 06:58:50	USERPROFILE=C:\Users\<BAMBOO_LOCAL_ACCOUNT>
    
    
  2. On the command line, open <bamboo-agent-home>/bin directory and run the command below to check the Tanuki Wrapper version of your Bamboo instance:

    ./wrapper --version

    Bamboo 8.0+ agents come with wrapper version 3.5 or newer. The following would indicate that the wrapper from your remote agent is too old:

    Wrapper (Version 3.2.3-atlassian-1) http://wrapper.tanukisoftware.org

Cause

This issue can happen if the remote agent is running an older version of the wrapper, which can cause issues with the newer versions of Bamboo.

Additionally, while upgrading to Bamboo 8.2 or newer, it's recommended to upgrade the agents' wrappers as well.

Solution

Older wrapper version

If you identify that the wrapper running on your agents is too old (from the Diagnosis steps), please upgrade the wrapper on your remote agent: 

  1. Stop the agent.
  2. Back up the <remote-agent-home> directory.
  3. Remove the <remote-agent-home>\conf\ directory.
  4. Download a new Remote Agent JAR from your Bamboo Server.
  5. Launch the remote agent, pointing its home directory to the existing home folder by using the following Java property:

    -Dbamboo.home=<remote-agent-home>

If you run your agent as a service, you also need to remove the existing service and install it again.

Last modified on Dec 16, 2022

Was this helpful?

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