Bamboo Git LFS checkout fails to materialise the files for submodules

XMLWordPrintable

    • Type: Bug
    • Resolution: Fixed
    • Priority: Low
    • 12.1.10
    • Affects Version/s: 12.1.7
    • Component/s: Source Checkout Task
    • None
    • 1
    • Severity 3 - Minor
    • 1

      Issue Summary

      When a Bamboo agent has a global Git configuration (e.g., in /etc/gitconfig or ~/.gitconfig) that sets the LFS smudge/process filters to --skip, Bamboo correctly overrides these for the main repository during the "Source Code Checkout" task. However, it fails to apply these same overrides to submodules. As a result, submodules are checked out as LFS pointer files (ASCII text) instead of the actual content, and the build proceeds silently without error.

      • Bamboo Version: 12.1.7 (and likely earlier)
      • Git Version: 2.54.0
      • Git LFS Version: 3.7.1
      • Agent Config:
        [filter "lfs"]
        clean = git-lfs clean -- %f
        smudge = git-lfs smudge --skip -- %f
        process = git-lfs filter-process --skip
        required = true
        

        Steps to Reproduce

      1. Setup a Bamboo agent with below gitconfig
      [filter "lfs"]
      clean = git-lfs clean -- %f
      smudge = git-lfs smudge --skip -- %f
      process = git-lfs filter-process --skip
      required = true
      

       

      1. Create a Git LFS repository with submodule and both main and submodule containing LFS objects
      2. Create linked repository with submodule and LFS enabled.
      3. Create a Bamboo build plan
      4. Inspect the submodule directory on the agent after the checkout task.

      Expected Results

      Bamboo should ensure that all Git and LFS commands, regardless of whether they are targeting the root repository or a submodule,have their critical options enforced via -c. This ensures a deterministic and isolated build environment that is immune to local agent configurations.

      Actual Results

      Technical Evidence (from logs):
      Main repository (Correct):

      MAIN_REPO_sample-report.pdf: PDF document, version 1.3
      MAIN_REPO_lib.so: ELF 64-bit LSB shared object

      Submodule (Incorrect):
       

      sample-report.pdf: ASCII text
      large_file.txt: ASCII textlib.so: ASCII text

      The build log file:

      26-Jun-2026 06:24:30	+ env
      26-Jun-2026 06:24:30	+ grep -E ^GIT_LFS|^GIT_
      26-Jun-2026 06:24:30	+ file MAIN_REPO_sample-report.pdf
      26-Jun-2026 06:24:30	MAIN_REPO_sample-report.pdf: PDF document, version 1.3, 4 pages
      26-Jun-2026 06:24:30	+ file MAIN_REPO_large_file.txt
      26-Jun-2026 06:24:30	MAIN_REPO_large_file.txt: ASCII text
      26-Jun-2026 06:24:30	+ file /lib/MAIN_REPO_lib.so
      26-Jun-2026 06:24:30	/lib/MAIN_REPO_lib.so: ELF 64-bit LSB shared object, x86-64, version 1 (SYSV), too many program (26951)
      26-Jun-2026 06:24:30	+ echo git lfs ls-files OUTPUT
      26-Jun-2026 06:24:30	+ git lfs ls-files --long
      26-Jun-2026 06:24:30	git lfs ls-files OUTPUT
      26-Jun-2026 06:24:30	99b01750e451adbeb8944788c6e7e161f3aa6744cfe9d85ad7a0a6cbdb9dc33d * MAIN_REPO_large_file.txt
      26-Jun-2026 06:24:30	710e231a6fc315c14c1997c3fe9dfd1fdd65ef6dd9319ceb0bffeaebec09f833 * MAIN_REPO_sample-image.jpeg
      26-Jun-2026 06:24:30	cecc207cc04617293b9bc0f1b044d9772e49b9240ac564bc06421e7b85ef77f5 * MAIN_REPO_sample-report.pdf
      26-Jun-2026 06:24:30	297526fff9f9b113d1e204cf9e9a56907d9a9e7bc2b7707aa128b584e124808e * /lib/MAIN_REPO_lib.so
      26-Jun-2026 06:24:30	Finished task 'Script' with result: Success
      26-Jun-2026 06:24:30	Starting task 'List Submodule fiels' of type 'com.atlassian.bamboo.plugins.scripttask:task.builder.script'
      26-Jun-2026 06:24:30	
      Beginning to execute external process for build 'Test-project - plan2 - Default Job #121 (TES-PL2-JOB1-121)'
       ... running command line: 
      /home/ubuntu/DA/temp/TES-PL2-JOB1-121-ScriptBuildTask-573368753733108827.sh
       ... in: /home/ubuntu/DA/xml-data/build-dir/TES-PL2-JOB1
      26-Jun-2026 06:24:30	+ echo checking files inside the submodule
      26-Jun-2026 06:24:30	+ cd modules/bb_lfs_repo
      26-Jun-2026 06:24:30	+ file sample-report.pdf
      26-Jun-2026 06:24:30	checking files inside the submodule
      26-Jun-2026 06:24:30	sample-report.pdf: ASCII text
      26-Jun-2026 06:24:30	+ file large_file.txt
      26-Jun-2026 06:24:30	large_file.txt: ASCII text
      26-Jun-2026 06:24:30	+ file /lib/lib.so
      26-Jun-2026 06:24:30	/lib/lib.so: ASCII text
      26-Jun-2026 06:24:30	git lfs ls-files OUTPUT
      26-Jun-2026 06:24:30	+ echo git lfs ls-files OUTPUT
      26-Jun-2026 06:24:30	+ git lfs ls-files --long
      26-Jun-2026 06:24:30	99b01750e451adbeb8944788c6e7e161f3aa6744cfe9d85ad7a0a6cbdb9dc33d - large_file.txt
      26-Jun-2026 06:24:30	710e231a6fc315c14c1997c3fe9dfd1fdd65ef6dd9319ceb0bffeaebec09f833 - sample-image.jpeg
      26-Jun-2026 06:24:30	cecc207cc04617293b9bc0f1b044d9772e49b9240ac564bc06421e7b85ef77f5 - sample-report.pdf
      26-Jun-2026 06:24:30	297526fff9f9b113d1e204cf9e9a56907d9a9e7bc2b7707aa128b584e124808e - /lib/lib.so
      26-Jun-2026 06:24:30	
      

      Workaround

      Currently there is no known workaround for this behavior. A workaround will be added here when available

              Assignee:
              Alexey Chystoprudov
              Reporter:
              Vani
              Votes:
              1 Vote for this issue
              Watchers:
              3 Start watching this issue

                Created:
                Updated:
                Resolved: