phacility/phabricator · error · PhutilArgumentUsageException
Unable to load specified object ("%s").
Error message
Unable to load specified object ("%s"). What it means
PhutilArgumentUsageException thrown by HeraldTestManagementWorkflow when the --object value does not resolve through PhabricatorObjectQuery::withNames() — i.e. no object with that monogram/name is loadable. The workflow then has nothing to build test adapters against, so it aborts. withNames() accepts monograms (T123, D456, P78...) and other object names, but the object must exist and be visible to the script's viewer.
Source
Thrown at src/applications/herald/management/HeraldTestManagementWorkflow.php:43
),
));
}
public function execute(PhutilArgumentParser $args) {
$viewer = $this->getViewer();
$object_name = $args->getArg('object');
if (!strlen($object_name)) {
throw new PhutilArgumentUsageException(
pht('Specify an object to test rules for with "--object".'));
}
$objects = id(new PhabricatorObjectQuery())
->setViewer($viewer)
->withNames(array($object_name))
->execute();
if (!$objects) {
throw new PhutilArgumentUsageException(
pht(
'Unable to load specified object ("%s").',
$object_name));
}
$object = head($objects);
$adapters = HeraldAdapter::getAllAdapters();
$can_select = array();
$display_adapters = array();
foreach ($adapters as $key => $adapter) {
if (!$adapter->isTestAdapterForObject($object)) {
continue;
}
if (!$adapter->isAvailableToUser($viewer)) {
continue;
}View on GitHub (pinned to 5720a38cfe)
Solutions
- Use a valid, existing monogram (T123, D456, P1, M9 ...); copy it fresh from the UI URL.
- If you only know a title, resolve the monogram in the UI or via Conduit (maniphest.query.search etc.) first.
- Confirm the script runs against the right environment/database.
- Check the object is not deleted/Archived beyond the viewer's visibility.
Example fix
# before bin/herald test --object mytask --type maniphest.task # after bin/herald test --object T123 --type maniphest.task
Defensive patterns
Strategy: validation
Validate before calling
// Verify the name resolves before running the workflow
$objects = id(new PhabricatorObjectQuery())
->setViewer($viewer)
->withNames(array($object_name))
->execute();
if (!$objects) {
// suggest: use a monogram from the object's URL (T123, D456, ...)
} Type guard
function isPhabricatorMonogram($s) {
return is_string($s) && preg_match('/^[A-Z]\d+$/', $s) === 1;
} Try / catch
try {
(new HeraldTestManagementWorkflow())->execute($args);
} catch (PhutilArgumentUsageException $ex) {
if (strpos($ex->getMessage(), 'Unable to load specified object') !== false) {
// re-check the monogram against the UI, confirm environment, retry
}
} Prevention
- Copy monograms directly from the object URL, never from prose/emails that may reference deleted objects.
- In automation, resolve names via Conduit search endpoints and fail fast on zero results.
When it happens
Trigger: Running 'bin/herald test --object T99999' for a nonexistent task; passing a plain word ('--object mytask') that matches no object name; typo in the monogram; object deleted between copy and paste; running against the wrong database/environment.
Common situations: Monograms copied from stale emails or search results after the object was deleted; scripts parameterized by object name where the name is a title rather than a monogram; testing on a dev checkout pointed at an empty database.
Related errors
- Unable to load Herald rule with ID or monogram "%s".
- Specify an object to test rules for with "--object".
- Specify a content type to run rules for. For this object, va
- Specify a content type to run rules for. The specified conte
- The specified content type ("%s") does not support dry runs.
AI-assisted analysis of phacility/phabricator@5720a38cfe (2026-08-21).
Data as JSON: /api/errors/5c45042a14a91f2b.
Report an issue: GitHub.