{"record":{"id":"99e6fe16d8819646","repo":"phacility/phabricator","slug":"some-specified-messages-do-not-exist-s","errorCode":null,"errorMessage":"Some specified messages do not exist: %s","messagePattern":"Some specified messages do not exist: (.+?)","errorType":"console","errorClass":"PhutilArgumentUsageException","httpStatus":null,"severity":"error","filePath":"src/applications/metamta/management/PhabricatorMailManagementResendWorkflow.php","lineNumber":42,"sourceCode":"    $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 resend.\",\n          '--id'));\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    foreach ($messages as $message) {\n      $message->setStatus(PhabricatorMailOutboundStatus::STATUS_QUEUE);\n      $message->save();\n\n      $mailer_task = PhabricatorWorker::scheduleTask(\n        'PhabricatorMetaMTAWorker',\n        $message->getID(),\n        array(\n          'priority' => PhabricatorWorker::PRIORITY_ALERTS,\n        ));\n\n      $console->writeOut(","sourceCodeStart":24,"sourceCodeEnd":60,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/metamta/management/PhabricatorMailManagementResendWorkflow.php#L24-L60","documentation":"resend loaded rows for the requested IDs via PhabricatorMetaMTAMail->loadAllWhere('id IN (%Ld)', $ids) and compared: array_diff_key found requested IDs with no matching row. It refuses to resend a partial set and lists exactly which IDs do not exist - they are typos, IDs from another install, or mail rows removed by retention/garbage collection.","triggerScenarios":"Passing --id with a typo'd or nonexistent mail ID; copy-pasting IDs between environments (dev vs prod); the mail was old enough that the outbound mail table was pruned by GC; a race where the row was deleted between listing and resending.","commonSituations":"Scripted resends fed from stale lists; installs with aggressive mail retention; cross-environment ID confusion.","solutions":["Drop the listed missing IDs from the command and resend only the ones that exist - the error message enumerates them precisely.","Verify each ID in the Outbound Mail UI before resending.","If the mail was garbage-collected, resend is impossible - re-generate the notification instead (e.g. trigger the sending action again)."],"exampleFix":"# before: 34 does not exist\n./bin/mail resend --id 12 --id 34\n\n# after: resend only existing IDs\n./bin/mail resend --id 12","handlingStrategy":"validation","validationCode":"// Verify all IDs exist before invoking resend.\n$messages = id(new PhabricatorMetaMTAMail())->loadAllWhere(\n  'id IN (%Ld)',\n  $ids);\n$missing = array_diff($ids, mpull($messages, 'getID'));\nif ($missing) {\n  // drop or abort before calling ./bin/mail resend\n}","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Validate mail IDs against the Outbound Mail UI or a fresh query before scripting resends.","Watch mail retention settings - garbage-collected messages cannot be resent, only regenerated."],"tags":["phabricator","cli","mail","id-not-found","resend"],"backgroundTag":"referenced-entity-not-found","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}