phacility/phabricator · error · Exception

Unable to determine how to fetch changes: this buildable doe

Error message

Unable to determine how to fetch changes: this buildable does not identify a commit or a staging ref. You may need to configure a repository staging area.

What it means

To give the leased working copy something to fetch, the step needs either 'buildable.commit' (set when building a commit) or both 'repository.staging.uri' and 'repository.staging.ref' (set when building a Differential revision through a staging area). With neither, it cannot construct a fetch spec and throws, hinting that a staging area is missing.

Source

Thrown at src/applications/harbormaster/step/HarbormasterLeaseWorkingCopyBuildStepImplementation.php:190

    $repository = $repositories[$repository_phid];

    $commit = idx($variables, 'buildable.commit');
    $ref_uri = idx($variables, 'repository.staging.uri');
    $ref_ref = idx($variables, 'repository.staging.ref');
    if ($commit) {
      $spec = array(
        'commit' => $commit,
      );
    } else if ($ref_uri && $ref_ref) {
      $spec = array(
        'ref' => array(
          'uri' => $ref_uri,
          'ref' => $ref_ref,
        ),
      );
    } else {
      throw new Exception(
        pht(
          'Unable to determine how to fetch changes: this buildable does not '.
          'identify a commit or a staging ref. You may need to configure a '.
          'repository staging area.'));
    }

    $directory = $repository->getCloneName();
    $map[$directory] = array(
      'phid' => $repository->getPHID(),
      'default' => true,
    ) + $spec;

    return $map;
  }

}

View on GitHub (pinned to 5720a38cfe)

Solutions

  1. Configure a staging area for the repository in Diffusion (Repository > Edit Staging Area: URI and staging tag prefix), then retry the build.
  2. Verify pushes to the staging repository succeed (credentials, permissions) so refs like refs/tags/phabricator/... exist for the revision.
  3. Alternatively build commits instead of revisions, since 'buildable.commit' is always present for commit buildables.
Defensive patterns

Strategy: validation

Validate before calling

// Before building revisions with a working-copy step:
$variables = $build_target->getVariables();
$has_commit = !empty($variables['buildable.commit']);
$has_staging = !empty($variables['repository.staging.uri'])
  && !empty($variables['repository.staging.ref']);
if (!$has_commit && !$has_staging) {
  // configure a repository staging area before running this plan
}

Prevention

When it happens

Trigger: Building a Differential revision whose repository has no staging area configured, so the repository.staging.* variables are absent and no buildable.commit exists (revisions are not commits). The else branch at HarbormasterLeaseWorkingCopyBuildStepImplementation.php:189 fires.

Common situations: New Differential build plan enabled before staging was set up; staging URI configured but staging ref missing; building revision-type buildables on a repository where staging pushes are disabled or the staging repository is unreachable so refs never get created.

Related errors


AI-assisted analysis of phacility/phabricator@5720a38cfe (2026-08-21). Data as JSON: /api/errors/1986361915e4fdf9. Report an issue: GitHub.