phacility/phabricator · error · Exception

No such build target

Error message

No such build target "%s"!

What it means

Fires in the harbormaster.createartifact Conduit method when a HarbormasterBuildTargetQuery for the supplied buildTargetPHID returns no row. This is a policy-filtered lookup-miss guard: the PHID may be wrong, the target deleted, or invisible to the acting user; the offending PHID is interpolated into the message.

Solutions

  1. Verify the build target PHID is correct and not deleted
  2. Check the conduit user has permission to see the build target
  3. Ensure the target exists before the artifact-creation call runs
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at src/applications/harbormaster/conduit/HarbormasterCreateArtifactConduitAPIMethod.php:112 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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

Appendix: source

Thrown at src/applications/harbormaster/conduit/HarbormasterCreateArtifactConduitAPIMethod.php:112

      'artifactType' => 'string',
      'artifactData' => 'map<string, wild>',
    );
  }

  protected function defineReturnType() {
    return 'wild';
  }

  protected function execute(ConduitAPIRequest $request) {
    $viewer = $request->getUser();

    $build_target_phid = $request->getValue('buildTargetPHID');
    $build_target = id(new HarbormasterBuildTargetQuery())
      ->setViewer($viewer)
      ->withPHIDs(array($build_target_phid))
      ->executeOne();
    if (!$build_target) {
      throw new Exception(
        pht(
          'No such build target "%s"!',
          $build_target_phid));
    }

    $artifact_type = $request->getValue('artifactType');

    // Cast "artifactData" parameters to acceptable types if this request
    // is submitting raw HTTP parameters. This is not ideal. See T11887 for
    // discussion.
    $artifact_data = $request->getValue('artifactData');
    if (!$request->getIsStrictlyTyped()) {
      $impl = HarbormasterArtifact::getArtifactType($artifact_type);
      if ($impl) {
        foreach ($artifact_data as $key => $value) {
          $artifact_data[$key] = $impl->readArtifactHTTPParameter(
            $key,
            $value);

View on GitHub (pinned to 5720a38cfe)