{"record":{"id":"be144d28c743b640","repo":"phacility/phabricator","slug":"some-specified-messages-do-not-exist-s-be144d","errorCode":null,"errorMessage":"Some specified messages do not exist: %s","messagePattern":"Some specified messages do not exist: (.+?)","errorType":"console","errorClass":"PhutilArgumentUsageException","httpStatus":null,"severity":"warning","filePath":"src/applications/metamta/management/PhabricatorMailManagementShowOutboundWorkflow.php","lineNumber":57,"sourceCode":"\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\n    if ($ids) {\n      $ids = array_fuse($ids);\n      $missing = array_diff_key($ids, $messages);\n      if ($missing) {\n        throw new PhutilArgumentUsageException(\n          pht(\n            'Some specified messages do not exist: %s',\n            implode(', ', array_keys($missing))));\n      }\n    }\n\n    $last_key = last_key($messages);\n    foreach ($messages as $message_key => $message) {\n      if ($args->getArg('dump-html')) {\n        $html_body = $message->getHTMLBody();\n        if (strlen($html_body)) {\n          $template =\n            \"<!doctype html><html><body>{$html_body}</body></html>\";\n          $console->writeOut(\"%s\\n\", $html_body);\n        } else {\n          $console->writeErr(\n            \"%s\\n\",\n            pht('(This message has no HTML body.)'));","sourceCodeStart":39,"sourceCodeEnd":75,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/metamta/management/PhabricatorMailManagementShowOutboundWorkflow.php#L39-L75","documentation":"show-outbound loaded `id IN (...)` against PhabricatorMetaMTAMail (the sent-mail table) and at least one requested ID has no row; the missing IDs are enumerated. The ID passed validation, so this is purely a data-availability mismatch.","triggerScenarios":"Passing a received-mail ID to show-outbound; the outbound mail was deleted or the table pruned; wrong environment/database; plain typo.","commonSituations":"Mixing up inbound and outbound ID spaces; IDs copied from stale logs or another install; archived databases.","solutions":["Confirm the ID belongs to sent (outbound) mail; use show-inbound for received mail.","Copy a valid ID from the web UI's outbound mail list.","Verify database/environment selection if the ID should exist."],"exampleFix":"// before\n$ bin/mail show-outbound --id 123\n// Exception: Some specified messages do not exist: 123\n\n// after (123 was a received mail)\n$ bin/mail show-inbound --id 123","handlingStrategy":"validation","validationCode":"// Confirm the rows exist in the outbound table before invoking:\n$messages = id(new PhabricatorMetaMTAMail())->loadAllWhere('id IN (%Ld)', $ids);\n$missing = array_diff($ids, mpull($messages, 'getID'));\nif ($missing) {\n  fwrite(STDERR, 'No such outbound mail: '.implode(', ', $missing).\"\\n\");\n  exit(1);\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Do not reuse IDs between show-inbound and show-outbound.","Pre-check existence in wrapper scripts.","Confirm the environment/database when an ID should exist."],"tags":["php","phabricator","cli","record-lookup","mail"],"backgroundTag":"record-not-found","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}