phacility/phabricator · error · Exception
This commit ("%s") is associated with a hosted repository ("
Error message
This commit ("%s") is associated with a hosted repository ("%s"). Repositories must be imported from GitHub to be built with CircleCI. What it means
getCircleCIGitHubRepositoryURI() (PhabricatorRepositoryCommit.php:695-727) implements HarbormasterCircleCIBuildableInterface for commits. Phabricator can only trigger CircleCI builds on repositories it observes that live on GitHub; a repository marked as Hosted (Phabricator itself is the origin) fails immediately, because CircleCI would never be able to fetch the commits.
Source
Thrown at src/applications/repository/storage/PhabricatorRepositoryCommit.php:702
);
}
public function newBuildableEngine() {
return new DiffusionBuildableEngine();
}
/* -( HarbormasterCircleCIBuildableInterface )----------------------------- */
public function getCircleCIGitHubRepositoryURI() {
$repository = $this->getRepository();
$commit_phid = $this->getPHID();
$repository_phid = $repository->getPHID();
if ($repository->isHosted()) {
throw new Exception(
pht(
'This commit ("%s") is associated with a hosted repository '.
'("%s"). Repositories must be imported from GitHub to be built '.
'with CircleCI.',
$commit_phid,
$repository_phid));
}
$remote_uri = $repository->getRemoteURI();
$path = HarbormasterCircleCIBuildStepImplementation::getGitHubPath(
$remote_uri);
if (!$path) {
throw new Exception(
pht(
'This commit ("%s") is associated with a repository ("%s") which '.
'has a remote URI ("%s") that does not appear to be hosted on '.
'GitHub. Repositories must be hosted on GitHub to be built with '.
'CircleCI.',View on GitHub (pinned to 5720a38cfe)
Solutions
- Remove the CircleCI step from any build plan that runs against hosted repositories
- Or move the code to GitHub and reconfigure the repository as an observed repository pointing at the GitHub remote
- For hosted repositories, switch to a CI adapter that can fetch from Phabricator (e.g., Jenkins/other Harbormaster step types)
Defensive patterns
Strategy: validation
Validate before calling
// Before attaching/running a CircleCI step, verify the repo is observed, not hosted.
if ($repository->isHosted()) {
// skip or fail the plan with a clear message; do not call
// getCircleCIGitHubRepositoryURI()
} Type guard
function canUseCircleCI(PhabricatorRepository $repository) {
return !$repository->isHosted()
&& HarbormasterCircleCIBuildStepImplementation::getGitHubPath(
$repository->getRemoteURI()) !== null;
} Try / catch
try {
$uri = $commit->getCircleCIGitHubRepositoryURI();
} catch (Exception $ex) {
// Configuration error: fail the build target with a readable message
// instead of crashing the worker.
$build_target->log($ex->getMessage());
throw new HarbormasterBuildFailureException();
} Prevention
- Maintain separate build plans for hosted vs observed repositories
- When flipping a repository from observed to hosted, audit build plans that reference it
- Document that CircleCI steps only work on GitHub-hosted observed repositories
When it happens
Trigger: A Harbormaster build plan containing a CircleCI build step (HarbormasterCircleCIBuildStepImplementation) executes against a Diffusion commit whose repository is configured as 'Hosted' in the repository's hosting/serve settings.
Common situations: One generic build plan applied to all repositories, including locally-hosted ones; migrating a repository from observed-on-GitHub to hosted-in-Phabricator without updating the build plan; misunderstanding that the CircleCI step is an observation-side adapter, not a generic CI trigger.
Related errors
- This commit ("%s") is associated with a repository ("%s") wh
- Commit "%s" is not an ancestor of any branch head, so it can
- Object ("%s") does not implement interface "%s". Only object
- Object ("%s") claims "%s" is a GitHub repository URI, but th
- Object ("%s") claims "%s" is a GitHub repository URI, but th
AI-assisted analysis of phacility/phabricator@5720a38cfe (2026-08-21).
Data as JSON: /api/errors/d62d76f3937ffc77.
Report an issue: GitHub.