{"record":{"id":"35a8f1953eb87a03","repo":"phacility/phabricator","slug":"no-such-collector-s-choose-a-valid-collector","errorCode":null,"errorMessage":"No such collector \"%s\". Choose a valid collector: %s.","messagePattern":"No such collector \"(.+?)\"\\. Choose a valid collector: (.+?)\\.","errorType":"console","errorClass":"PhutilArgumentUsageException","httpStatus":null,"severity":"warning","filePath":"src/infrastructure/daemon/garbagecollector/management/PhabricatorGarbageCollectorManagementWorkflow.php","lineNumber":22,"sourceCode":"  extends PhabricatorManagementWorkflow {\n\n  protected function getCollector($const) {\n    $collectors = PhabricatorGarbageCollector::getAllCollectors();\n\n    $collector_list = array_keys($collectors);\n    sort($collector_list);\n    $collector_list = implode(', ', $collector_list);\n\n    if (!$const) {\n      throw new PhutilArgumentUsageException(\n        pht(\n          'Specify a collector with \"%s\". Valid collectors are: %s.',\n          '--collector',\n          $collector_list));\n    }\n\n    if (empty($collectors[$const])) {\n      throw new PhutilArgumentUsageException(\n        pht(\n          'No such collector \"%s\". Choose a valid collector: %s.',\n          $const,\n          $collector_list));\n    }\n\n    return $collectors[$const];\n  }\n\n}\n","sourceCodeStart":4,"sourceCodeEnd":33,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/infrastructure/daemon/garbagecollector/management/PhabricatorGarbageCollectorManagementWorkflow.php#L4-L33","documentation":"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.","triggerScenarios":"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.","commonSituations":"Typos in collector constants; operational scripts written for an older Phabricator release; shell quoting or whitespace issues that mangle the argument value.","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."],"exampleFix":"# before\nbin/garbagecollector set-policy --collector general.filez --days 30\n# after (name taken verbatim from the list the error prints)\nbin/garbagecollector set-policy --collector <exact-constant-from-message> --days 30","handlingStrategy":"validation","validationCode":"$collectors = PhabricatorGarbageCollector::getAllCollectors();\nif (empty($collectors[$const])) {\n  // reject the constant before running the workflow\n}","typeGuard":"function is_valid_collector_const($const) {\n  $collectors = PhabricatorGarbageCollector::getAllCollectors();\n  return isset($collectors[$const]);\n}","tryCatchPattern":null,"preventionTips":["Copy collector constants verbatim from the error output or the collector list workflow.","Refresh constants in operational scripts after Phabricator upgrades."],"tags":["phabricator","garbage-collector","cli","validation"],"backgroundTag":"invalid-argument-value","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}