phacility/phabricator · warning · PhutilArgumentUsageException
Names "%s" and "%s" identify the same object. Specify only u
Error message
Names "%s" and "%s" identify the same object. Specify only unique objects.
What it means
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.
Source
Thrown at src/infrastructure/daemon/workers/management/PhabricatorWorkerManagementWorkflow.php:296
->setViewer($viewer)
->withNames($names);
$object_query->execute();
$name_map = $object_query->getNamedResults();
$phid_map = array();
foreach ($names as $name) {
if (!isset($name_map[$name])) {
throw new PhutilArgumentUsageException(
pht(
'No object with name "%s" could be loaded.',
$name));
}
$phid = $name_map[$name]->getPHID();
if (isset($phid_map[$phid])) {
throw new PhutilArgumentUsageException(
pht(
'Names "%s" and "%s" identify the same object. Specify only '.
'unique objects.',
$name,
$phid_map[$phid]));
}
$phid_map[$phid] = $name;
}
return array_keys($phid_map);
}
}
View on GitHub (pinned to 5720a38cfe)
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
Example fix
# before ./bin/worker retry --object D12 --object PHID-DREV-abc123 # after ./bin/worker retry --object D12
Defensive patterns
Strategy: validation
Validate before calling
// Canonicalize every name to a PHID, then de-duplicate by PHID
$lookup = $client->callMethod('phid.lookup', array('names' => $names));
$phids = array();
foreach ($names as $name) {
if (isset($lookup[$name])) {
$phids[$lookup[$name]['phid']] = true;
}
}
$unique_phids = array_keys($phids); Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- Object "%s" is specified more than once. Specify only unique
- No object with name "%s" could be loaded.
- Specify how long to delay tasks for with "--until".
- Select a new priority for selected tasks with "--priority".
- Priority must be a positive integer.
AI-assisted analysis of phacility/phabricator@5720a38cfe (2026-08-21).
Data as JSON: /api/errors/381ea8a2bbb44bc1.
Report an issue: GitHub.