{"record":{"id":"9c1120f8e4a84f91","repo":"phacility/phabricator","slug":"object-s-is-not-a-harbormasterbuildable-it-is","errorCode":null,"errorMessage":"Object \"%s\" is not a HarbormasterBuildable (it is a \"%s\"). Name one or more buildables to publish, like \"B123\".","messagePattern":"Object \"(.+?)\" is not a HarbormasterBuildable \\(it is a \"(.+?)\"\\)\\. Name one or more buildables to publish, like \"B123\"\\.","errorType":"console","errorClass":"PhutilArgumentUsageException","httpStatus":null,"severity":"warning","filePath":"src/applications/harbormaster/management/HarbormasterManagementPublishWorkflow.php","lineNumber":53,"sourceCode":"      ->withNames($buildable_names);\n\n    $query->execute();\n\n    $result_map = $query->getNamedResults();\n\n    foreach ($buildable_names as $name) {\n      if (!isset($result_map[$name])) {\n        throw new PhutilArgumentUsageException(\n          pht(\n            'Argument \"%s\" does not name a buildable. Provide one or more '.\n            'valid buildable monograms or PHIDs.',\n            $name));\n      }\n    }\n\n    foreach ($result_map as $name => $result) {\n      if (!($result instanceof HarbormasterBuildable)) {\n        throw new PhutilArgumentUsageException(\n          pht(\n            'Object \"%s\" is not a HarbormasterBuildable (it is a \"%s\"). '.\n            'Name one or more buildables to publish, like \"B123\".',\n            $name,\n            get_class($result)));\n      }\n    }\n\n    foreach ($result_map as $buildable) {\n      echo tsprintf(\n        \"%s\\n\",\n        pht(\n          'Publishing \"%s\"...',\n        $buildable->getMonogram()));\n\n      // Reload the buildable to pick up builds.\n      $buildable = id(new HarbormasterBuildableQuery())\n        ->setViewer($viewer)","sourceCodeStart":35,"sourceCodeEnd":71,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/harbormaster/management/HarbormasterManagementPublishWorkflow.php#L35-L71","documentation":"Thrown by the 'bin/harbormaster publish' management workflow. It first resolves each command-line name (monogram or PHID) through PhabricatorObjectQuery; any name that does not resolve at all fails earlier, but a name that resolves to an object of the wrong type reaches this check. Publishing buildables only makes sense for HarbormasterBuildable objects, so anything else (a task, a revision, a commit) is rejected with the offending name and its actual class.","triggerScenarios":"Running 'bin/harbormaster publish D123' or 'bin/harbormaster publish T123' where the monogram resolves to a DifferentialRevision or ManiphestTask; passing a PHID of a non-HMBB type (e.g. PHID-TASK-...) from a script into the publish workflow.","commonSituations":"Scripts that feed arbitrary object names or PHIDs into the CLI without filtering by type; typos that coincidentally match another object type's monogram; assuming any valid object name is accepted because name resolution succeeded.","solutions":["Pass buildable monograms only, e.g. 'bin/harbormaster publish B123' (multiple are allowed: 'B123 B124')","If you use PHIDs, confirm they start with PHID-HMBB- (HarbormasterBuildable) and exist in this instance","Look up the correct buildable from the build or commit page, or via the harbormaster.buildable.search Conduit method, before publishing"],"exampleFix":"# before\n$ bin/harbormaster publish D123\n# Object \"D123\" is not a HarbormasterBuildable (it is a \"DifferentialRevision\").\n# after\n$ bin/harbormaster publish B123","handlingStrategy":"type-guard","validationCode":"$results = id(new PhabricatorObjectQuery())\n  ->setViewer($viewer)\n  ->withNames($names)\n  ->execute();\nforeach ($results as $name => $object) {\n  if (!($object instanceof HarbormasterBuildable)) {\n    // report and stop before invoking the publish workflow\n  }\n}","typeGuard":"function isHarbormasterBuildable($object) {\n  return ($object instanceof HarbormasterBuildable);\n}","tryCatchPattern":null,"preventionTips":["Always pass B-prefixed buildable monograms to harbormaster publish","Filter script inputs by PHID type (PHID-HMBB-) before feeding them to the CLI","Resolve names via harbormaster.buildable.search first in automated pipelines"],"tags":["harbormaster","phabricator","cli","argument-validation","buildable"],"backgroundTag":"wrong-object-type","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}