{"record":{"id":"2bffcfbc82035539","repo":"phacility/phabricator","slug":"specify-at-least-one-import-id-to-reload","errorCode":null,"errorMessage":"Specify at least one import ID to reload.","messagePattern":"Specify at least one import ID to reload\\.","errorType":"console","errorClass":"PhutilArgumentUsageException","httpStatus":null,"severity":"warning","filePath":"src/applications/calendar/management/PhabricatorCalendarManagementReloadWorkflow.php","lineNumber":29,"sourceCode":"        pht(\n          'Reload event imports from the command line. Useful for '.\n          'testing and debugging importers.'))\n      ->setArguments(\n        array(\n          array(\n            'name' => 'ids',\n            'wildcard' => true,\n            'help' => pht('List of import IDs to reload.'),\n          ),\n        ));\n  }\n\n  public function execute(PhutilArgumentParser $args) {\n    $viewer = $this->getViewer();\n\n    $ids = $args->getArg('ids');\n    if (!$ids) {\n      throw new PhutilArgumentUsageException(\n        pht('Specify at least one import ID to reload.'));\n    }\n\n    $imports = id(new PhabricatorCalendarImportQuery())\n      ->setViewer($viewer)\n      ->withIDs($ids)\n      ->execute();\n    $imports = mpull($imports, null, 'getID');\n    foreach ($ids as $id) {\n      if (empty($imports[$id])) {\n        throw new PhutilArgumentUsageException(\n          pht(\n            'Unable to load Calendar import with ID \"%s\".',\n            $id));\n      }\n    }\n\n    $imports = array_select_keys($imports, $ids);","sourceCodeStart":11,"sourceCodeEnd":47,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/calendar/management/PhabricatorCalendarManagementReloadWorkflow.php#L11-L47","documentation":"Thrown by the bin/calendar import-reload management workflow when no import IDs are given. The workflow takes a wildcard list of IDs; an empty list is rejected immediately because there is nothing to reload.","triggerScenarios":"Running 'bin/calendar import-reload' with no arguments; passing an empty array of ids programmatically.","commonSituations":"Forgetting the ID argument in cron jobs or runbooks; shell variable that expands to nothing ($IDS unset) leaving the command with zero arguments.","solutions":["Pass one or more import IDs: 'bin/calendar import-reload 12 15'.","Find valid IDs in Calendar -> Imports (or via the calendar.import.search Conduit method).","Quote/check shell variables before invoking: ensure \"$IDS\" is non-empty."],"exampleFix":"// before\n$ bin/calendar import-reload\n// after\n$ bin/calendar import-reload 42","handlingStrategy":"validation","validationCode":"$ids = array_values(array_filter($args->getArg('ids'), 'is_numeric'));\nif (!$ids) {\n  fwrite(STDERR, \"No import IDs supplied; nothing to reload.\\n\");\n  exit(1);\n}\n$args->setArg('ids', $ids);","typeGuard":"function hasImportIds(array $ids) {\n  return count(array_filter($ids, 'is_numeric')) > 0;\n}","tryCatchPattern":"try {\n  $workflow->execute($args);\n} catch (PhutilArgumentUsageException $ex) {\n  fwrite(STDERR, $ex->getMessage().\"\\n\");\n  exit(1);\n}","preventionTips":["Quote shell variables and assert they are non-empty before invoking the CLI.","Look up valid import IDs from Calendar -> Imports before scripting reloads."],"tags":["phabricator","cli","calendar","import","required-argument"],"backgroundTag":"missing-required-argument","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}