{"record":{"id":"2b0f1b1828f98b50","repo":"phacility/phabricator","slug":"this-build-plan-can-not-be-run-manually","errorCode":null,"errorMessage":"This build plan can not be run manually.","messagePattern":"This build plan can not be run manually\\.","errorType":"console","errorClass":"PhutilArgumentUsageException","httpStatus":null,"severity":"warning","filePath":"src/applications/harbormaster/management/HarbormasterManagementBuildWorkflow.php","lineNumber":74,"sourceCode":"    $plan_id = $args->getArg('plan');\n    if (!$plan_id) {\n      throw new PhutilArgumentUsageException(\n        pht(\n          'Use %s to specify a build plan to run.',\n          '--plan'));\n    }\n\n    $plan = id(new HarbormasterBuildPlanQuery())\n      ->setViewer($viewer)\n      ->withIDs(array($plan_id))\n      ->executeOne();\n    if (!$plan) {\n      throw new PhutilArgumentUsageException(\n        pht('Build plan \"%s\" does not exist.', $plan_id));\n    }\n\n    if (!$plan->canRunManually()) {\n      throw new PhutilArgumentUsageException(\n        pht('This build plan can not be run manually.'));\n    }\n\n    $console = PhutilConsole::getConsole();\n\n    $buildable = HarbormasterBuildable::initializeNewBuildable($viewer)\n      ->setIsManualBuildable(true)\n      ->setBuildablePHID($buildable->getHarbormasterBuildablePHID())\n      ->setContainerPHID($buildable->getHarbormasterContainerPHID())\n      ->save();\n\n    $buildable->sendMessage(\n      $viewer,\n      HarbormasterMessageType::BUILDABLE_BUILD,\n      false);\n\n    $console->writeOut(\n      \"%s\\n\",","sourceCodeStart":56,"sourceCodeEnd":92,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/harbormaster/management/HarbormasterManagementBuildWorkflow.php#L56-L92","documentation":"The plan exists but canRunManually() is false. In this codebase that method returns false exactly when the plan is an 'autoplan' (a generated, built-in plan keyed by planAutoKey, e.g. the ones driving internal publishing), and true otherwise. Manual execution from the CLI (or the UI's Run button, which uses the same check) is therefore refused.","triggerScenarios":"Passing the ID of an autoplan (internal generated plan) to `harbormaster build --plan`; plans whose planAutoKey column is set because they were created by Harbormaster itself rather than a user.","commonSituations":"Discovering a plan ID via the database or a build record and trying to run it manually; expecting every row in the plan table to be runnable.","solutions":["Use a user-created plan's ID for manual runs; autoplans are invoked internally by the application and cannot be started by hand.","Identify autoplan rows by their planAutoKey (non-null) or by the 'Generated Plan' style naming/URI in the UI, and exclude them from scripts.","If you genuinely need to run the same steps manually, recreate them in a new plan."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"if ($plan->isAutoplan() || !$plan->canRunManually()) {\n  // cannot be run by hand; pick a user-created plan instead\n}","typeGuard":"function isManuallyRunnablePlan(HarbormasterBuildPlan $plan) {\n  return $plan->canRunManually();\n}","tryCatchPattern":null,"preventionTips":["Filter plan lists with canRunManually() before offering them to automation or users.","Remember autoplans (generated, planAutoKey set) are internal-only; never target them with manual runs."],"tags":["harbormaster","cli","usage-error","autoplan","not-allowed"],"backgroundTag":"operation-not-permitted","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}