phacility/phabricator · error · Exception

Object ("%s") claims "%s" is a GitHub repository URI, but th

Error message

Object ("%s") claims "%s" is a GitHub repository URI, but the domain does not appear to be GitHub.

What it means

Thrown by Phabricator's Harbormaster "Build with CircleCI" step when the buildable object's getCircleCIGitHubRepositoryURI() returns a URI whose host is not exactly github.com or www.github.com (case-insensitive). The step derives the CircleCI project from a GitHub owner/repo path, so it refuses to run against anything that is not GitHub-hosted. getGitHubPath() (src/applications/harbormaster/step/HarbormasterCircleCIBuildStepImplementation.php:68) does the host check and returns null for every other domain.

Source

Thrown at src/applications/harbormaster/step/HarbormasterCircleCIBuildStepImplementation.php:111

    $object = $buildable->getBuildableObject();
    $object_phid = $object->getPHID();
    if (!($object instanceof HarbormasterCircleCIBuildableInterface)) {
      throw new Exception(
        pht(
          'Object ("%s") does not implement interface "%s". Only objects '.
          'which implement this interface can be built with CircleCI.',
          $object_phid,
          'HarbormasterCircleCIBuildableInterface'));
    }

    $github_uri = $object->getCircleCIGitHubRepositoryURI();
    $build_type = $object->getCircleCIBuildIdentifierType();
    $build_identifier = $object->getCircleCIBuildIdentifier();

    $path = self::getGitHubPath($github_uri);
    if ($path === null) {
      throw new Exception(
        pht(
          'Object ("%s") claims "%s" is a GitHub repository URI, but the '.
          'domain does not appear to be GitHub.',
          $object_phid,
          $github_uri));
    }

    $path_parts = trim($path, '/');
    $path_parts = explode('/', $path_parts);
    if (count($path_parts) < 2) {
      throw new Exception(
        pht(
          'Object ("%s") claims "%s" is a GitHub repository URI, but the '.
          'path ("%s") does not have enough components (expected at least '.
          'two).',
          $object_phid,
          $github_uri,
          $path));

View on GitHub (pinned to 5720a38cfe)

Solutions

  1. Point the buildable's GitHub repository URI at github.com (for revisions: host the repository staging area on GitHub; for commits: track a repository imported from GitHub).
  2. If you maintain the buildable class, fix getCircleCIGitHubRepositoryURI() so it returns the GitHub-hosted URI (the staging URI for revisions, the GitHub remote for commits).
  3. If the project is not on GitHub, remove the CircleCI step from the build plan and use a step that supports your host (Jenkins, HTTP request, dry run).
  4. Gate the build plan with a build-plan condition so it only runs for buildables whose repository URI is on github.com.

Example fix

// before (custom buildable returns a non-GitHub URI)
public function getCircleCIGitHubRepositoryURI() {
  return 'https://gitlab.example.com/acme/app.git';
}

// after (return the GitHub-hosted staging URI)
public function getCircleCIGitHubRepositoryURI() {
  return 'https://github.com/acme/app-staging.git';
}
Defensive patterns

Strategy: validation

Validate before calling

// Before enabling/running a CircleCI step for a buildable:
$uri = $object->getCircleCIGitHubRepositoryURI();
if (HarbormasterCircleCIBuildStepImplementation::getGitHubPath($uri) === null) {
  // host is not github.com/www.github.com - do not use the CircleCI step
}

Type guard

function isGitHubRepositoryURI($uri) {
  $domain = phutil_utf8_strtolower((new PhutilURI($uri))->getDomain());
  return in_array($domain, array('github.com', 'www.github.com'), true);
}

Try / catch

try {
  $step->execute($build, $build_target);
} catch (Exception $ex) {
  if (preg_match('/domain does not appear to be GitHub/', $ex->getMessage())) {
    // configuration problem, not transient: fail fast with a clear message
  }
}

Prevention

When it happens

Trigger: Executing a build plan containing the CircleCI step against a buildable whose repository URI points to gitlab.com, bitbucket.org, a self-hosted git server, or a URI with an empty/unparseable domain. Concretely: a Differential revision whose repository staging area is not hosted on GitHub, or a commit in a repository that is not imported from GitHub.

Common situations: Repository is mirrored from GitHub but its canonical remote in Diffusion is an internal host; staging area URI configured on a non-GitHub host; a custom application implements HarbormasterCircleCIBuildableInterface and returns the wrong URI; the CircleCI step was enabled for all build plans instead of only GitHub-hosted repositories.

Related errors


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