phacility/phabricator · warning · PhutilArgumentUsageException
Specify which resources you want to release. See "--help"…
Error message
Specify which resources you want to release. See "--help" for guidance.
What it means
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.
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
Example fix
// before $ ./bin/drydock release-resource Usage Exception: Specify which resources you want to release. See "--help" for guidance. // after $ ./bin/drydock release-resource --id 7 --id 8
Defensive patterns
Strategy: validation
Validate before calling
// Before invoking the workflow:
$ids = $args->getArg('id');
$is_all = $args->getArg('all');
if (!$ids && !$is_all) {
throw new PhutilArgumentUsageException(pht(
'Pass --id <n> (repeatable) or --all.'));
} Try / catch
catch (PhutilArgumentUsageException $ex) { print usage guidance; correct the invocation to include --id or --all and re-run } Prevention
- 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
When it happens
Trigger: Running `./bin/drydock release-resource` with an empty argument list; passing only non-scoping flags; a wrapper script that forwards an unpopulated ID array.
Common situations: 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.
Related errors
- Specify one or more resource IDs to update with
- Select which leases you want to release. See "--help" for…
- Specify one or more lease IDs to update with
- Resource " " does not exist.
- Specify the dumpfile to read with "--input", or use…
AI-assisted analysis of phacility/phabricator@5720a38cfe (2026-08-21).
Data as JSON: /api/errors/3dabbf9e154ff532.
Report an issue: GitHub.
Appendix: source
Thrown at src/applications/drydock/management/DrydockManagementReleaseResourceWorkflow.php:29
array(
array(
'name' => 'id',
'param' => 'id',
'repeat' => true,
'help' => pht('Resource ID to release.'),
),
array(
'name' => 'all',
'help' => pht('Release all resources. Dangerous!'),
),
));
}
public function execute(PhutilArgumentParser $args) {
$is_all = $args->getArg('all');
$ids = $args->getArg('id');
if (!$ids && !$is_all) {
throw new PhutilArgumentUsageException(
pht(
'Specify which resources you want to release. See "--help" for '.
'guidance.'));
}
$viewer = $this->getViewer();
$statuses = $this->getReleaseableResourceStatuses();
$query = id(new DrydockResourceQuery())
->setViewer($viewer)
->withStatuses(mpull($statuses, 'getKey'));
if ($ids) {
$query->withIDs($ids);
}
$resources = $query->execute();
View on GitHub (pinned to 5720a38cfe)