{"record":{"id":"3dabbf9e154ff532","repo":"phacility/phabricator","slug":"specify-which-resources-you-want-to-release-see","errorCode":null,"errorMessage":"Specify which resources you want to release. See \"--help\" for guidance.","messagePattern":"Specify which resources you want to release\\. See \"--help\" for guidance\\.","errorType":"console","errorClass":"PhutilArgumentUsageException","httpStatus":null,"severity":"warning","filePath":"src/applications/drydock/management/DrydockManagementReleaseResourceWorkflow.php","lineNumber":29,"sourceCode":"        array(\n          array(\n            'name' => 'id',\n            'param' => 'id',\n            'repeat' => true,\n            'help' => pht('Resource ID to release.'),\n          ),\n          array(\n            'name' => 'all',\n            'help' => pht('Release all resources. Dangerous!'),\n          ),\n        ));\n  }\n\n  public function execute(PhutilArgumentParser $args) {\n    $is_all = $args->getArg('all');\n    $ids = $args->getArg('id');\n    if (!$ids && !$is_all) {\n      throw new PhutilArgumentUsageException(\n        pht(\n          'Specify which resources you want to release. See \"--help\" for '.\n          'guidance.'));\n    }\n\n    $viewer = $this->getViewer();\n    $statuses = $this->getReleaseableResourceStatuses();\n\n    $query = id(new DrydockResourceQuery())\n      ->setViewer($viewer)\n      ->withStatuses(mpull($statuses, 'getKey'));\n\n    if ($ids) {\n      $query->withIDs($ids);\n    }\n\n    $resources = $query->execute();\n","sourceCodeStart":11,"sourceCodeEnd":47,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/drydock/management/DrydockManagementReleaseResourceWorkflow.php#L11-L47","documentation":"Thrown by the `drydock release-resource` management workflow when the command is given neither `--id <n>` argument(s) nor `--all`. Like its lease counterpart it is a PhutilArgumentUsageException: the workflow prints usage guidance and aborts before issuing any query or mutation, because releasing resources (and implicitly their leases) is destructive and requires an explicit scope.","triggerScenarios":"Running `./bin/drydock release-resource` with an empty argument list; passing only non-scoping flags; a wrapper script that forwards an unpopulated ID array.","commonSituations":"Operators draining Drydock hosts after decommissioning Almanac services or working-copy blueprints; cron/automation that forgets to pass IDs; confusion with a different workflow that defaults to acting on all objects.","solutions":["Re-run with explicit resource IDs: `./bin/drydock release-resource --id 7`","To release every releaseable resource: `./bin/drydock release-resource --all` (understand it cascades to leases on those resources)","Check `./bin/drydock release-resource --help` for flag spelling and repeatability","Make automation assert a non-empty ID list before shelling out"],"exampleFix":"// before\n$ ./bin/drydock release-resource\nUsage Exception: Specify which resources you want to release. See \"--help\" for guidance.\n\n// after\n$ ./bin/drydock release-resource --id 7 --id 8","handlingStrategy":"validation","validationCode":"// Before invoking the workflow:\n$ids = $args->getArg('id');\n$is_all = $args->getArg('all');\nif (!$ids && !$is_all) {\n  throw new PhutilArgumentUsageException(pht(\n    'Pass --id <n> (repeatable) or --all.'));\n}","typeGuard":null,"tryCatchPattern":"catch (PhutilArgumentUsageException $ex) { print usage guidance; correct the invocation to include --id or --all and re-run }","preventionTips":["Require an explicit scope in automation: assert --id or --all present before exec","Prefer enumerated --id lists over --all unless a full drain is intended, since releasing resources cascades to their leases","Check --help output after upgrading Phabricator; workflow flags change between revisions"],"tags":["drydock","phabricator","cli","usage-error","argument-validation","resource"],"backgroundTag":"cli-missing-required-argument","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}