Downloading remote agent jar in Bamboo failing with access is denied exception

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

Summary

An exception is seen on the Bamboo User Interface while trying to download the remote agent JAR file and the below exception is seen:

1 2 3 4 io.atlassian.util.concurrent.LazyReference$InitializationException: java.lang.RuntimeException: Unexpected exception at io.atlassian.util.concurrent.LazyReference.getInterruptibly(LazyReference.java:156) Caused by: java.io.FileNotFoundException: C:\BAMBOO_HOME\caches\classpath.zip (Access is denied) at java.io.FileOutputStream.open0(Native Method)

Environment

Issue seen on Bamboo 8.0.5 but might be applicable for any supported version. 

Diagnosis

The issue is seen while trying to download the remote agent jar in Bamboo via Bamboo Administration > Agents > Install remote agent >download remote agent JAR page.

The below error is seen on the Bamboo page and <bamboo-home>/atlassian-bamboo.log file

1 2 3 4 io.atlassian.util.concurrent.LazyReference$InitializationException: java.lang.RuntimeException: Unexpected exception at io.atlassian.util.concurrent.LazyReference.getInterruptibly(LazyReference.java:156) Caused by: java.io.FileNotFoundException: C:\BAMBOO_HOME\caches\classpath.zip (Access is denied) at java.io.FileOutputStream.open0(Native Method)

Cause

There are possible 2 causes

  1. The user account running Bamboo does not have read/write access to the caches folder under <bamboo-home>.

  2. There is already classpath.zip file present inside <bamboo-home>/caches folder and this file does not have read/write access to the user which is running Bamboo. 

Solution

Option 1:

  1. The first step is to make sure the user which is running Bamboo has full read and write access to <bamboo-home>/caches folder

  2. In the second step clear the contents of <bamboo-home>/caches folder and restart Bamboo and then try to download the jar again.

    Please make sure to take backup of the above folder before deleting the content inside as it might be required in case of rolling back this change.

Option 2:

You can copy the remote agent installer by following the below steps:

  1. Copy the remote agent jar from path <bamboo-install>/atlassian-bamboo/admin/agent/atlassian-bamboo-agent-installer-VERSION.jar on the Bamboo server.

  2. Place the remote agent JAR on the machine where you want to run the remote agent.

  3. Run the JAR file with the command provided by your Bamboo instance.

Updated on February 28, 2025

Still need help?

The Atlassian Community is here for you.