phacility/phabricator · error · PhutilArgumentUsageException
Service " " does not exist or could not be loaded!
Error message
Service "%s" does not exist or could not be loaded!
What it means
Thrown by the shared loadServices() helper in Almanac management workflows: one or more --service names passed on the command line did not resolve to an AlmanacService via AlmanacServiceQuery withNames(). The 'or could not be loaded' wording also covers the case where the row exists but the acting viewer cannot see it under policy rules.
Solutions
- Check the exact service name in the Almanac service UI (names are case-sensitive) and re-run with it verbatim.
- Confirm the service still exists and was not renamed or deleted.
- If policy filtering is plausible (workflow runs as a restricted viewer), verify the acting user can actually see that service.
Defensive patterns
Strategy: validation
Validate before calling
// Pre-resolve names the way loadServices() does, before running the workflow:
$services = id(new AlmanacServiceQuery())
->setViewer($viewer)
->withNames($names)
->execute();
$missing = array_diff($names, mpull($services, 'getName'));
if ($missing) {
throw new Exception('Unknown/invisible services: '.implode(', ', $missing));
} Try / catch
try {
// execute management workflow taking --service names
} catch (PhutilArgumentUsageException $ex) {
if (preg_match('/does not exist or could not be loaded/', $ex->getMessage())) {
// Re-check spelling/case against the service list, then retry once.
}
throw $ex;
} Prevention
- Almanac name lookups are exact and case-sensitive - copy names from the UI, never retype them.
- Validate the service exists in provisioning scripts before binding operations.
- When a rename happens, grep automation for the old name the same day.
When it happens
Trigger: Running any Almanac management workflow that accepts service names (e.g. binding workflows) with a name that has a typo, wrong case, extra whitespace, or that designates a service the viewer cannot load; withNames() is exact-match, not fuzzy.
Common situations: Copying a service name from notes that has since been renamed; case mismatches ('MyService' vs 'myservice'); referencing a deleted service in automation after a cleanup.
Understand the failure class
Background: "Not found" and "does not exist" errors: why "Task not found", "No such folder", and "Can't find" fire when a lookup comes back empty — this error's family across 14 libraries.
Related errors
- No public key exists with ID
- Blueprint " " could not be loaded. Try a blueprint ID or…
- Commit " " does not exist.
- Commit " " is not valid.
- Config option "phd.user" is not set. You must set this…
AI-assisted analysis of phacility/phabricator@5720a38cfe (2026-08-21).
Data as JSON: /api/errors/30879216afcff5e1.
Report an issue: GitHub.
Appendix: source
Thrown at src/applications/almanac/management/AlmanacManagementWorkflow.php:19
<?php
abstract class AlmanacManagementWorkflow
extends PhabricatorManagementWorkflow {
protected function loadServices(array $names) {
if (!$names) {
return array();
}
$services = id(new AlmanacServiceQuery())
->setViewer($this->getViewer())
->withNames($names)
->execute();
$services = mpull($services, null, 'getName');
foreach ($names as $name) {
if (empty($services[$name])) {
throw new PhutilArgumentUsageException(
pht(
'Service "%s" does not exist or could not be loaded!',
$name));
}
}
return $services;
}
}
View on GitHub (pinned to 5720a38cfe)