Bamboo Build fails with Exception "No such file or directory"
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
The Bamboo Plan has the following configuration
There is a "Source Code Checkout Task" which checks out two repositories.
During the build process, the following exception is thrown
1
cp: cannot stat 'C:\Users\bamboo\bamboo-agent-home\xml-data\build-dir\PRO-PLA-JOB1/bamboo-repo//build_task.py': No such file or directory
Environment
Issue seen on Bamboo 8.0.4.
Diagnosis
Bamboo build fails post Source code Checkout task is completed Successfully. In the logs following exception is seen.
1
cp: cannot stat 'C:\Users\bamboo\bamboo-agent-home\xml-data\build-dir\TGC-UD-JOB1/bamboo-utils//clang_format_to_junit.py': No such file or directory
Cause
The problem is related to the way the Source code checkout task is configured for both repositories. Please see below for the second repository where the checkout directory is not mentioned.

The Build script is written in such a way that it expects both repositories to be checked out in the same directory.
Solution
The solution is to mention the same Checkout Directory for the second repository which is part of Source code checkout Task.
Was this helpful?