{"record":{"id":"776f5de3ece57448","repo":"phacility/phabricator","slug":"blueprint-s-is-specified-more-than-once-as-s","errorCode":null,"errorMessage":"Blueprint \"%s\" is specified more than once (as \"%s\" and \"%s\").","messagePattern":"Blueprint \"(.+?)\" is specified more than once \\(as \"(.+?)\" and \"(.+?)\"\\)\\.","errorType":"console","errorClass":"PhutilArgumentUsageException","httpStatus":null,"severity":"error","filePath":"src/applications/drydock/management/DrydockManagementLeaseWorkflow.php","lineNumber":297,"sourceCode":"    $blueprints = mpull($blueprints, null, 'getPHID');\n\n    $map = $query->getIdentifierMap();\n\n    $seen = array();\n    foreach ($identifiers as $identifier) {\n      if (!isset($map[$identifier])) {\n        throw new PhutilArgumentUsageException(\n          pht(\n            'Blueprint \"%s\" could not be loaded. Try a blueprint ID or '.\n            'PHID.',\n            $identifier));\n      }\n\n      $blueprint = $map[$identifier];\n\n      $blueprint_phid = $blueprint->getPHID();\n      if (isset($seen[$blueprint_phid])) {\n        throw new PhutilArgumentUsageException(\n          pht(\n            'Blueprint \"%s\" is specified more than once (as \"%s\" and \"%s\").',\n            $blueprint->getBlueprintName(),\n            $seen[$blueprint_phid],\n            $identifier));\n      }\n\n      $seen[$blueprint_phid] = true;\n    }\n\n    return mpull($map, null, 'getPHID');\n  }\n\n  private function newAllowedBlueprintPHIDs(\n    DrydockLease $lease,\n    array $filter_blueprints) {\n    assert_instances_of($filter_blueprints, 'DrydockBlueprint');\n","sourceCodeStart":279,"sourceCodeEnd":315,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/drydock/management/DrydockManagementLeaseWorkflow.php#L279-L315","documentation":"A PhutilArgumentUsageException from `bin/drydock lease --blueprint` when two different identifiers in the repeatable flag resolve to the same blueprint PHID — classically the blueprint given once by ID and once by PHID. The workflow keeps a $seen map of PHIDs and rejects the second reference to avoid acquiring the same blueprint twice.","triggerScenarios":"`bin/drydock lease --type host --blueprint 3 --blueprint PHID-DRYB-sameblueprint` where both '3' and the PHID resolve to blueprint 3; identifiers built dynamically by concatenating an explicit ID with a config-provided PHID for the same blueprint.","commonSituations":"Configuration lists a blueprint ID and a monitoring script appends its PHID; documentation examples mixing the two identifier styles get combined.","solutions":["Pass each blueprint exactly once, using one identifier style consistently (all IDs or all PHIDs).","Deduplicate identifier lists in scripts before invoking the CLI (resolve each to a PHID and unique it)."],"exampleFix":"# before\nbin/drydock lease --type host --blueprint 3 --blueprint PHID-DRYB-sameblueprint\n\n# after\nbin/drydock lease --type host --blueprint 3","handlingStrategy":"validation","validationCode":"// resolve each identifier to a PHID, then dedupe before calling the CLI\n$query = id(new DrydockBlueprintQuery())\n  ->setViewer($viewer)\n  ->withIdentifiers($identifiers);\n$query->execute();\n$map = $query->getIdentifierMap();\n$phids = array_unique(mpull($map, 'getPHID', null));\n// pass each distinct PHID exactly once","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Pick one identifier style (all IDs or all PHIDs) for a given invocation and stick to it.","When combining identifiers from config and command line, merge-and-dedupe programmatically first."],"tags":["drydock","phabricator","cli","blueprint","duplicate","identifier"],"backgroundTag":"duplicate-identifier","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}