{"record":{"id":"7b68cf804d54364f","repo":"phacility/phabricator","slug":"choose-a-build-log-to-rebuild-with-id-or-rebu","errorCode":null,"errorMessage":"Choose a build log to rebuild with \"--id\", or rebuild all logs with \"--all\".","messagePattern":"Choose a build log to rebuild with \"--id\", or rebuild all logs with \"--all\"\\.","errorType":"console","errorClass":"PhutilArgumentUsageException","httpStatus":null,"severity":"warning","filePath":"src/applications/harbormaster/management/HarbormasterManagementRebuildLogWorkflow.php","lineNumber":46,"sourceCode":"          array(\n            'name' => 'force',\n            'help' => pht(\n              'Force logs to rebuild even if they appear to be in good '.\n              'shape already.'),\n          ),\n        ));\n  }\n\n  public function execute(PhutilArgumentParser $args) {\n    $viewer = $this->getViewer();\n\n    $is_force = $args->getArg('force');\n\n    $log_id = $args->getArg('id');\n    $is_all = $args->getArg('all');\n\n    if (!$is_all && !$log_id) {\n      throw new PhutilArgumentUsageException(\n        pht(\n          'Choose a build log to rebuild with \"--id\", or rebuild all '.\n          'logs with \"--all\".'));\n    }\n\n    if ($is_all && $log_id) {\n      throw new PhutilArgumentUsageException(\n        pht(\n          'You can not specify both \"--id\" and \"--all\". Choose one or '.\n          'the other.'));\n    }\n\n    if ($log_id) {\n      $log = id(new HarbormasterBuildLogQuery())\n        ->setViewer($viewer)\n        ->withIDs(array($log_id))\n        ->executeOne();\n      if (!$log) {","sourceCodeStart":28,"sourceCodeEnd":64,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/harbormaster/management/HarbormasterManagementRebuildLogWorkflow.php#L28-L64","documentation":"Usage exception from 'bin/harbormaster rebuild-log'. The command reconstructs raw build log content (for example after a change in storage format) and must know its scope: one log selected with --id, or every log with --all. When neither flag is given there is nothing to rebuild, so the workflow refuses to start instead of doing a silent no-op.","triggerScenarios":"Running 'bin/harbormaster rebuild-log' with no options at all.","commonSituations":"An operator copies the command from documentation without parameters; an automation script builds the command line from variables that are unset, so both flags end up omitted.","solutions":["Add '--id <log-id>' to rebuild one log; the ID is the number in the build log URI","Add '--all' to rebuild every build log in the instance","Run 'bin/harbormaster rebuild-log --help' to confirm the accepted flags before scripting it"],"exampleFix":"# before\n$ bin/harbormaster rebuild-log\n# after\n$ bin/harbormaster rebuild-log --all","handlingStrategy":"validation","validationCode":"# shell wrapper before invoking rebuild-log\nif [ -z ${LOG_ID:-} ] && [ ${REBUILD_ALL:-0} -eq 0 ]; then\n  echo 'error: pass --id <id> or --all' >&2\n  exit 1\nfi","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Default automation to --all or require an explicit log ID variable","Abort wrapper scripts early when neither selection option is set"],"tags":["harbormaster","phabricator","cli","missing-option","build-log"],"backgroundTag":"missing-required-option","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}