phacility/phabricator · error · Exception

This commit ("%s") is associated with a repository ("%s") wh

Error message

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.

What it means

After the hosted check, the repository's remote URI is passed to HarbormasterCircleCIBuildStepImplementation::getGitHubPath(), which accepts only domains 'github.com' and 'www.github.com' (case-insensitive) and returns null for anything else (HarbormasterCircleCIBuildStepImplementation.php:68-80). A null path means Phabricator cannot derive the GitHub 'owner/repo' identifier CircleCI needs, so it throws. GitHub Enterprise domains are not supported by this step.

Source

Thrown at src/applications/repository/storage/PhabricatorRepositoryCommit.php:715

    $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.',
          $commit_phid,
          $repository_phid,
          $remote_uri));
    }

    return $remote_uri;
  }

  public function getCircleCIBuildIdentifierType() {
    return 'revision';
  }

  public function getCircleCIBuildIdentifier() {

View on GitHub (pinned to 5720a38cfe)

Solutions

  1. Inspect and correct the remote URI in the Diffusion repository configuration so it points at github.com (e.g. https://github.com/owner/repo.git)
  2. If the repository lives on GitHub Enterprise or another forge, replace the CircleCI step with a generic HTTP/command build step, or fork/patch getGitHubPath to accept your domain
  3. Re-run the build after saving the corrected URI

Example fix

# before (repository remote URI)
https://gitlab.example.com/team/project.git

# after (must be github.com for the CircleCI step)
https://github.com/team/project.git
Defensive patterns

Strategy: validation

Validate before calling

// Reuse the same check the step uses, before triggering a build.
$uri = new PhutilURI($repository->getRemoteURI());
$domain = phutil_utf8_strtolower($uri->getDomain());
if ($domain !== 'github.com' && $domain !== 'www.github.com') {
  // not buildable by the CircleCI step; do not enqueue it
}

Type guard

function isGitHubRemote(PhabricatorRepository $repository) {
  return HarbormasterCircleCIBuildStepImplementation::getGitHubPath(
    $repository->getRemoteURI()) !== null;
}

Try / catch

try {
  $remote_uri = $commit->getCircleCIGitHubRepositoryURI();
} catch (Exception $ex) {
  // Remote URI is not github.com: surface as a configuration failure with
  // the offending URI from the message; no retry can help.
  $build_target->log($ex->getMessage());
  throw new HarbormasterBuildFailureException();
}

Prevention

When it happens

Trigger: A CircleCI build step on an observed repository whose remote URI is gitlab.com, bitbucket.org, a self-hosted GitHub Enterprise host (e.g. ghe.company.com), or any URI whose domain does not lowercase to exactly github.com/www.github.com.

Common situations: Companies running GitHub Enterprise and expecting the CircleCI step to work; copy-paste errors or typos in the remote URI; wanting CircleCI for GitLab/Bitbucket mirrors; URIs with credentials embedded that shift where PhutilURI sees the domain.

Related errors


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