phacility/phabricator · error · Exception

Object ("%s") does not implement interface "%s". Only object

Error message

Object ("%s") does not implement interface "%s". Only objects which implement this interface can be built with CircleCI.

What it means

The CircleCI build step requires the buildable's underlying object to implement HarbormasterCircleCIBuildableInterface, which supplies the GitHub repository URI and the build identifier used to build the CircleCI request path. If the object being built lacks the interface, the step throws during execution and the build target fails.

Source

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

    }
  }

  public function execute(
    HarbormasterBuild $build,
    HarbormasterBuildTarget $build_target) {
    $viewer = PhabricatorUser::getOmnipotentUser();

    if (PhabricatorEnv::getEnvConfig('phabricator.silent')) {
      $this->logSilencedCall($build, $build_target, pht('CircleCI'));
      throw new HarbormasterBuildFailureException();
    }

    $buildable = $build->getBuildable();

    $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,

View on GitHub (pinned to 5720a38cfe)

Solutions

  1. Only run CircleCI steps against Diffusion repositories hosted on GitHub
  2. Remove the CircleCI step from plans building other object types
  3. If you own the buildable class, implement HarbormasterCircleCIBuildableInterface (repository URI plus build identifier methods) on it

Example fix

// before: CircleCI step attached to a plan building a custom object
// -> throws at execute time
// after: either (a) attach CircleCI steps only to GitHub-hosted repository
// builds, or (b) implement the interface on the buildable object:
class MyBuildableObject implements HarbormasterCircleCIBuildableInterface {
  // ...implement the interface methods...
}
Defensive patterns

Strategy: type-guard

Validate before calling

$object = $build->getBuildable()->getBuildableObject();
if (!($object instanceof HarbormasterCircleCIBuildableInterface)) {
  // fail fast with a clear message; do not attach this step to such plans
}

Type guard

function supportsCircleCIBuilds(HarbormasterBuild $build) {
  return ($build->getBuildable()->getBuildableObject()
    instanceof HarbormasterCircleCIBuildableInterface);
}

Prevention

When it happens

Trigger: Attaching a CircleCI build step to a plan whose buildable object does not implement HarbormasterCircleCIBuildableInterface (custom object types, non-GitHub-hosted repositories).

Common situations: Copying a CI plan from a GitHub-hosted repository to plans for other object types; custom applications providing buildable objects without the CircleCI methods.

Related errors


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