phacility/phabricator · warning · PhutilArgumentUsageException
No such collector " ". Choose a valid collector: .
Error message
No such collector "%s". Choose a valid collector: %s.
What it means
getCollector() throws this usage exception when the supplied --collector value is not a key of PhabricatorGarbageCollector::getAllCollectors(). The message embeds both the requested constant and the sorted list of valid ones, so it is a straightforward unknown-name/typo indicator.
Solutions
- Copy a constant verbatim from the list printed in the exception message.
- Update operational scripts to the current collector constants after Phabricator upgrades.
- Check shell quoting/whitespace around the --collector value.
Example fix
# before bin/garbagecollector set-policy --collector general.filez --days 30 # after (name taken verbatim from the list the error prints) bin/garbagecollector set-policy --collector <exact-constant-from-message> --days 30
Defensive patterns
Strategy: validation
Validate before calling
$collectors = PhabricatorGarbageCollector::getAllCollectors();
if (empty($collectors[$const])) {
// reject the constant before running the workflow
} Type guard
function is_valid_collector_const($const) {
$collectors = PhabricatorGarbageCollector::getAllCollectors();
return isset($collectors[$const]);
} Prevention
- Copy collector constants verbatim from the error output or the collector list workflow.
- Refresh constants in operational scripts after Phabricator upgrades.
When it happens
Trigger: bin/garbagecollector set-policy --collector <misspelled-or-unknown-constant>; also when a collector constant was renamed or removed between Phabricator versions and an old script still uses the previous name.
Common situations: Typos in collector constants; operational scripts written for an older Phabricator release; shell quoting or whitespace issues that mangle the argument value.
Understand the failure class
Background: "Must be a positive integer", "Invalid value", "Unsupported": the invalid-argument-value error family, when a library rejects the value you pass — this error's family across 35 libraries.
Related errors
- Specify a positive number of days to retain data for.
- Choose a policy with
- Options " ", " " and " " represent mutually exclusive ways…
- Specify a collector with
- Unable to parse argument to "--until".
AI-assisted analysis of phacility/phabricator@5720a38cfe (2026-08-21).
Data as JSON: /api/errors/35a8f1953eb87a03.
Report an issue: GitHub.
Appendix: source
Thrown at src/infrastructure/daemon/garbagecollector/management/PhabricatorGarbageCollectorManagementWorkflow.php:22
extends PhabricatorManagementWorkflow {
protected function getCollector($const) {
$collectors = PhabricatorGarbageCollector::getAllCollectors();
$collector_list = array_keys($collectors);
sort($collector_list);
$collector_list = implode(', ', $collector_list);
if (!$const) {
throw new PhutilArgumentUsageException(
pht(
'Specify a collector with "%s". Valid collectors are: %s.',
'--collector',
$collector_list));
}
if (empty($collectors[$const])) {
throw new PhutilArgumentUsageException(
pht(
'No such collector "%s". Choose a valid collector: %s.',
$const,
$collector_list));
}
return $collectors[$const];
}
}
View on GitHub (pinned to 5720a38cfe)