Fix Bitbucket Data Center repository export failure due to dangling symlinks

Platform Notice: Data Center Only - This article only applies to Atlassian apps 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

Bitbucket repository exports fail with an error stating that metadata.atl.tar cannot be added to the export archive. This occurs in Atlassian Bitbucket Data Center when dangling symlinks exist in the repository storage directory.

Diagnosis

This issue affects Bitbucket Data Center environments where repositories have been modified by external tools like SubGit, or where manual file system changes have introduced symlinks.

Cause

The Bitbucket migration export process walks through the repository metadata to create an export archive. If the repository storage directory contains a dangling symlink (a link pointing to a non-existent path), the Java process encounters a java.nio.file.NoSuchFileException. Because the file referenced by the symlink cannot be read, the creation of the metadata.atl.tar file fails, halting the export.

Solution

To resolve this issue, you must identify and remove any dangling symlinks within the affected repository storage directory on the Bitbucket server.

Confirm the issue and identify the affected repository

  1. Review the Bitbucket application logs (atlassian-bitbucket.log) for an error similar to the following:

  2. Note the <REPO_ID> and the specific path mentioned in the NoSuchFileException.

com.atlassian.bitbucket.migration.ExportException: Failed to add entry 'com.atlassian.bitbucket.server.bitbucket-git_git/repositories/<REPO_ID>/metadata/metadata.atl.tar' to the export archive ... Caused by: java.nio.file.NoSuchFileException: /var/atlassian/application-data/bitbucket/shared/data/repositories/<REPO_ID>/svn

Verify and remove dangling symlinks

  1. Log in to the Bitbucket server terminal.

  2. Navigate to the repository storage directory identified in the log:

    cd <BITBUCKET_HOME>/shared/data/repositories/<REPO_ID>

  3. List all files, including hidden ones, and check for symlinks:

    ls -la

  4. Identify symlinks (indicated by l at the start of the permission string, e.g., lrwxrwxrwx).

  5. Check if the symlink is dangling by attempting to list the target path or using the file command: If the output says "broken symbolic link", it must be addressed.

    file <symlink_name>

  6. Remove the dangling symlink:

    rm <symlink_name>

  7. Retry the repository export via the API or UI.

Updated on July 20, 2026

Still need help?

The Atlassian Community is here for you.