{"record":{"id":"00170cdac7a32926","repo":"phacility/phabricator","slug":"use-the-s-flag-to-specify-one-or-more-messages-00170c","errorCode":null,"errorMessage":"Use the '%s' flag to specify one or more messages to show.","messagePattern":"Use the '(.+?)' flag to specify one or more messages to show\\.","errorType":"console","errorClass":"PhutilArgumentUsageException","httpStatus":null,"severity":"warning","filePath":"src/applications/metamta/management/PhabricatorMailManagementShowOutboundWorkflow.php","lineNumber":34,"sourceCode":"            'param'   => 'id',\n            'help'    => pht('Show details about outbound mail with given ID.'),\n            'repeat'  => true,\n          ),\n          array(\n            'name' => 'dump-html',\n            'help' => pht(\n              'Dump the HTML body of the mail. You can redirect it to a '.\n              'file and then open it in a browser.'),\n          ),\n        ));\n  }\n\n  public function execute(PhutilArgumentParser $args) {\n    $console = PhutilConsole::getConsole();\n\n    $ids = $args->getArg('id');\n    if (!$ids) {\n      throw new PhutilArgumentUsageException(\n        pht(\n          \"Use the '%s' flag to specify one or more messages to show.\",\n          '--id'));\n    }\n\n    foreach ($ids as $id) {\n      if (!ctype_digit($id)) {\n        throw new PhutilArgumentUsageException(\n          pht(\n            'Argument \"%s\" is not a valid message ID.',\n            $id));\n      }\n    }\n\n    $messages = id(new PhabricatorMetaMTAMail())->loadAllWhere(\n      'id IN (%Ld)',\n      $ids);\n","sourceCodeStart":16,"sourceCodeEnd":52,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/metamta/management/PhabricatorMailManagementShowOutboundWorkflow.php#L16-L52","documentation":"`bin/mail show-outbound` requires at least one message ID via the repeatable `--id` flag; the workflow throws PhutilArgumentUsageException before any database access when the list is empty. Outbound IDs are the numeric IDs of PhabricatorMetaMTAMail rows (sent mail).","triggerScenarios":"Running show-outbound with no arguments; empty ID list from a script; passing flags like --subject that this workflow does not accept.","commonSituations":"Exploratory runs; scripts built around a queue that turned out empty.","solutions":["Pass one or more IDs: `bin/mail show-outbound --id 456`.","Get IDs from the web UI's sent-mail (MetaMTAMail) list or from daemon transaction logs.","Assert non-empty ID lists in automation before invoking the workflow."],"exampleFix":"// before\n$ bin/mail show-outbound\n// Exception: Use the '--id' flag to specify one or more messages to show.\n\n// after\n$ bin/mail show-outbound --id 456 --dump-html","handlingStrategy":"validation","validationCode":"if (empty($ids)) {\n  fwrite(STDERR, \"show-outbound requires one or more --id values.\\n\");\n  exit(1);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Source outbound IDs from the sent-mail list in the web UI.","Assert non-empty ID lists in automation.","Use --dump-html to inspect rendered bodies once you have a valid ID."],"tags":["php","phabricator","cli","argument-validation","mail"],"backgroundTag":"missing-cli-argument","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}