{"record":{"id":"1986361915e4fdf9","repo":"phacility/phabricator","slug":"unable-to-determine-how-to-fetch-changes-this-bui","errorCode":null,"errorMessage":"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.","messagePattern":"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\\.","errorType":"exception","errorClass":"Exception","httpStatus":null,"severity":"error","filePath":"src/applications/harbormaster/step/HarbormasterLeaseWorkingCopyBuildStepImplementation.php","lineNumber":190,"sourceCode":"\n    $repository = $repositories[$repository_phid];\n\n    $commit = idx($variables, 'buildable.commit');\n    $ref_uri = idx($variables, 'repository.staging.uri');\n    $ref_ref = idx($variables, 'repository.staging.ref');\n    if ($commit) {\n      $spec = array(\n        'commit' => $commit,\n      );\n    } else if ($ref_uri && $ref_ref) {\n      $spec = array(\n        'ref' => array(\n          'uri' => $ref_uri,\n          'ref' => $ref_ref,\n        ),\n      );\n    } else {\n      throw new Exception(\n        pht(\n          'Unable to determine how to fetch changes: this buildable does not '.\n          'identify a commit or a staging ref. You may need to configure a '.\n          'repository staging area.'));\n    }\n\n    $directory = $repository->getCloneName();\n    $map[$directory] = array(\n      'phid' => $repository->getPHID(),\n      'default' => true,\n    ) + $spec;\n\n    return $map;\n  }\n\n}\n","sourceCodeStart":172,"sourceCodeEnd":207,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/harbormaster/step/HarbormasterLeaseWorkingCopyBuildStepImplementation.php#L172-L207","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Configure a staging area for the repository in Diffusion (Repository > Edit Staging Area: URI and staging tag prefix), then retry the build.","Verify pushes to the staging repository succeed (credentials, permissions) so refs like refs/tags/phabricator/... exist for the revision.","Alternatively build commits instead of revisions, since 'buildable.commit' is always present for commit buildables."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Before building revisions with a working-copy step:\n$variables = $build_target->getVariables();\n$has_commit = !empty($variables['buildable.commit']);\n$has_staging = !empty($variables['repository.staging.uri'])\n  && !empty($variables['repository.staging.ref']);\nif (!$has_commit && !$has_staging) {\n  // configure a repository staging area before running this plan\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Configure a staging area on every repository whose revisions will be built.","Periodically verify pushes to the staging repository succeed so refs exist for new revisions."],"tags":["harbormaster","drydock","staging","phabricator"],"backgroundTag":"missing-required-configuration","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}