fatal: Not a git repository, GIT_DISCOVERY_ACROSS_FILESYSTEM not set

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.

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

Problem

The following exception appears when:

  • Remote agent perform checkout
    OR
  • Bamboo runs Change Detection as part of a Plan or for its automated actions
Cannot fetch branch 'BRANCH_NAME' from 'REPO_URL' to source directory '/var/atlassian/application-data/bamboo/xml-data/build-dir/_git-repositories-cache/HASH'. command /usr/local/bin/git fetch URL +refs/heads/develop:refs/heads/develop --update-head-ok failed with code 128. Working directory was [/var/atlassian/application-data/bamboo/xml-data/build-dir/_git-repositories-cache/HASH]., stderr: fatal: Not a git repository (or any parent up to mount point /mnt) Stopping at filesystem boundary (GIT_DISCOVERY_ACROSS_FILESYSTEM not set).

Diagnosis

  1. Check if there is any special character in the branch name
  2. Run the command "locale" to confirm if it is using UTF-8 or en_US.UTF-8
  3. Please run the following command to check that the specific cache directory and its contents exist and are accessible by the Bamboo user:

    ls -alR <bamboo-home>/xml-data/build-dir/_git-repositories-cache/HASH/.git

    Please be sure to replace the filepath with the path in the error message.

Cause

  1. Remote agent is not using file encoding UTF-8
  2. The machine is not using UTF-8 or en_US.UTF-8. The configured locale does not work well in the machine
  3. This is caused by Bamboo server being unable to access the .git directory in the local repository cache

Resolution

  1. Restart remote agent with the following file encoding setting in REMOTE_AGENT_HOME/conf/wrapper.conf file:

    wrapper.java.additional.3=-Dfile.encoding=UTF-8
    wrapper.java.additional.4=-Dsun.jnu.encoding=UTF-8
  2. Configure the machine locale to be UTF-8 or en_US.UTF-8
  3. Delete the affected local cache directory in Bamboo server

Last modified on Jun 21, 2019

Was this helpful?

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