{"record":{"id":"1ef7bee640454684","repo":"phacility/phabricator","slug":"specify-one-or-more-resource-ids-to-update-with","errorCode":null,"errorMessage":"Specify one or more resource IDs to update with \"%s\".","messagePattern":"Specify one or more resource IDs to update with \"(.+?)\"\\.","errorType":"console","errorClass":"PhutilArgumentUsageException","httpStatus":null,"severity":"warning","filePath":"src/applications/drydock/management/DrydockManagementUpdateResourceWorkflow.php","lineNumber":26,"sourceCode":"      ->setName('update-resource')\n      ->setSynopsis(pht('Update a resource.'))\n      ->setArguments(\n        array(\n          array(\n            'name' => 'id',\n            'param' => 'id',\n            'repeat' => true,\n            'help' => pht('Resource ID to update.'),\n          ),\n        ));\n  }\n\n  public function execute(PhutilArgumentParser $args) {\n    $viewer = $this->getViewer();\n\n    $ids = $args->getArg('id');\n    if (!$ids) {\n      throw new PhutilArgumentUsageException(\n        pht(\n          'Specify one or more resource IDs to update with \"%s\".',\n          '--id'));\n    }\n\n    $resources = id(new DrydockResourceQuery())\n      ->setViewer($viewer)\n      ->withIDs($ids)\n      ->execute();\n\n    PhabricatorWorker::setRunAllTasksInProcess(true);\n\n    foreach ($ids as $id) {\n      $resource = idx($resources, $id);\n\n      if (!$resource) {\n        echo tsprintf(\n          \"%s\\n\",","sourceCodeStart":8,"sourceCodeEnd":44,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/drydock/management/DrydockManagementUpdateResourceWorkflow.php#L8-L44","documentation":"Thrown by the `drydock update-resource` management workflow when no `--id` argument was given. Identical contract to the lease updater: explicit repeatable IDs only, no `--all`, because each update runs resource update workers in-process. PhutilArgumentUsageException; nothing is modified.","triggerScenarios":"Running `./bin/drydock update-resource` with an empty argv; assuming a default 'all pending resources' scope that does not exist; forwarding an empty array of IDs from a wrapper script.","commonSituations":"Forcing a resource through its activation/broken state machine after a daemon die-off; debugging a blueprint whose resources never leave PENDING; re-running a command from history after the resource list was cleared.","solutions":["Re-run with explicit IDs: `./bin/drydock update-resource --id 9 --id 10`","Discover the stuck resource IDs via `./bin/drydock resource --status pending` or the Drydock UI","Verify flag spelling with `./bin/drydock update-resource --help`","Wrap in a shell loop over IDs if you need bulk behavior"],"exampleFix":"// before\n$ ./bin/drydock update-resource\nUsage Exception: Specify one or more resource IDs to update with \"--id\".\n\n// after\n$ ./bin/drydock update-resource --id 9","handlingStrategy":"validation","validationCode":"// Before invoking the workflow:\n$ids = $args->getArg('id');\nif (!$ids) {\n  throw new PhutilArgumentUsageException(pht(\n    'Pass one or more --id flags; there is no --all for update-resource.'));\n}","typeGuard":null,"tryCatchPattern":"catch (PhutilArgumentUsageException $ex) { print guidance; supply --id <n> (repeatable) and re-run }","preventionTips":["Query pending/stuck resources first to build the ID list","No bulk mode exists; loop explicitly over IDs in automation","Verify flag spelling with --help after upgrades"],"tags":["drydock","phabricator","cli","usage-error","resource","argument-validation"],"backgroundTag":"cli-missing-required-argument","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}