Crucible patches are not anchored

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

Problem

In some cases Crucible may fail to anchor a patch file, the following message is presented to the end user in the user interface:

1 No repository found to anchor patch to

An alternative scenario is when the patch is anchored, but some of the files do not appear as anchored and the file context is not displayed.

Diagnosis

After clicking to upload the patch, this is how the anchoring process usually works:

  1. Try to find the correct repository for 3 seconds (UI only)

  2. Try to anchor against the specified repository for 30 seconds (timeout is UI only), when the following is done:

    1. Get root paths from repository:

      Perforce and Subversion: Finds all the directories with paths ending in the patch paths

      Git, Hg/Mercurial and CVS: Just finds the patch paths directly

    2. If there are multiple root paths (and there is time), picks the one with the most matching paths

      While finding roots, paths in the patch might also be stripped (i.e. had leading directories dropped to match the repository)

    3. Check if all revisions at the right versions exist in the repositories

      For Git and Hg/Mercurial this might require remapping content hashes into commit hashes.

      Allow only some to exist (partial anchoring - usually happens for new files).

    4. For all existing revisions: validate the content by getting the revision content from repository and seeing if the patch applies

  3. If we got here, than the anchor is valid, so it is persisted in the database

  4. If multiple root paths match, the user can chose which one he wants to anchor to.

  5. After that, depending on whether the patch is anchored or not, content for patch revisions is retrieved differently:

    1. For unanchored, we only render the uploaded patch

    2. For anchored, we get the anchored revision content from the repository, then apply the patch.

Cause

There may be various causes for this problem.

Cause #1 - SVN repository with Start revision set

When this is the case only certain files are anchored, for the not anchored files the only content displayed is the one from the patch itself.

Solution

Resolution

Cause #1 - SVN repository with Start revision set

In the repository details, select Import without tag informationas option for the Initial Import setting (see Subversion configuration options for details).

Updated on April 2, 2025

Still need help?

The Atlassian Community is here for you.