{"record":{"id":"381ea8a2bbb44bc1","repo":"phacility/phabricator","slug":"names-s-and-s-identify-the-same-object-spec","errorCode":null,"errorMessage":"Names \"%s\" and \"%s\" identify the same object. Specify only unique objects.","messagePattern":"Names \"(.+?)\" and \"(.+?)\" identify the same object\\. Specify only unique objects\\.","errorType":"console","errorClass":"PhutilArgumentUsageException","httpStatus":null,"severity":"warning","filePath":"src/infrastructure/daemon/workers/management/PhabricatorWorkerManagementWorkflow.php","lineNumber":296,"sourceCode":"      ->setViewer($viewer)\n      ->withNames($names);\n\n    $object_query->execute();\n\n    $name_map = $object_query->getNamedResults();\n    $phid_map = array();\n    foreach ($names as $name) {\n      if (!isset($name_map[$name])) {\n        throw new PhutilArgumentUsageException(\n          pht(\n            'No object with name \"%s\" could be loaded.',\n            $name));\n      }\n\n      $phid = $name_map[$name]->getPHID();\n\n      if (isset($phid_map[$phid])) {\n        throw new PhutilArgumentUsageException(\n          pht(\n            'Names \"%s\" and \"%s\" identify the same object. Specify only '.\n            'unique objects.',\n            $name,\n            $phid_map[$phid]));\n      }\n\n      $phid_map[$phid] = $name;\n    }\n\n    return array_keys($phid_map);\n  }\n\n}\n","sourceCodeStart":278,"sourceCodeEnd":311,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/infrastructure/daemon/workers/management/PhabricatorWorkerManagementWorkflow.php#L278-L311","documentation":"Thrown when two different name arguments resolve to the same underlying object (same PHID). Example: passing both `--object T123` and `--object PHID-TASK-xxxx` where the PHID belongs to T123. After each name resolves, the workflow maps results by PHID and rejects the list if one PHID would be selected twice through different spellings — the constraint must reference distinct objects.","triggerScenarios":"Mixing monograms and PHIDs for the same object in one command: `--object D12 --object PHID-DREV-abc123`. Also two aliases/IDs that the object query normalizes to one object. Distinct names only — literal duplicates throw the earlier 'specified more than once' error.","commonSituations":"Scripts that merge a list of monograms from one system with PHIDs from another without canonicalizing; operators pasting a PHID to be 'safe' alongside the monogram; renamed/aliased objects where both spellings still resolve.","solutions":["Keep only one spelling of each object in the command","Canonicalize all names to PHIDs (or all to monograms) before building the argument list and de-duplicate"],"exampleFix":"# before\n./bin/worker retry --object D12 --object PHID-DREV-abc123\n\n# after\n./bin/worker retry --object D12","handlingStrategy":"validation","validationCode":"// Canonicalize every name to a PHID, then de-duplicate by PHID\n$lookup = $client->callMethod('phid.lookup', array('names' => $names));\n$phids = array();\nforeach ($names as $name) {\n  if (isset($lookup[$name])) {\n    $phids[$lookup[$name]['phid']] = true;\n  }\n}\n$unique_phids = array_keys($phids);","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pick one canonical identifier form (PHID) for scripts; never mix monograms and PHIDs for the same object","De-duplicate after resolution, not just before, to catch alias collisions"],"tags":["phabricator","cli","worker-queue","duplicate-argument","object-resolution"],"backgroundTag":"duplicate-argument","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}