{"record":{"id":"30879216afcff5e1","repo":"phacility/phabricator","slug":"service-s-does-not-exist-or-could-not-be-loaded","errorCode":null,"errorMessage":"Service \"%s\" does not exist or could not be loaded!","messagePattern":"Service \"(.+?)\" does not exist or could not be loaded!","errorType":"console","errorClass":"PhutilArgumentUsageException","httpStatus":null,"severity":"error","filePath":"src/applications/almanac/management/AlmanacManagementWorkflow.php","lineNumber":19,"sourceCode":"<?php\n\nabstract class AlmanacManagementWorkflow\n  extends PhabricatorManagementWorkflow {\n\n  protected function loadServices(array $names) {\n    if (!$names) {\n      return array();\n    }\n\n    $services = id(new AlmanacServiceQuery())\n      ->setViewer($this->getViewer())\n      ->withNames($names)\n      ->execute();\n\n    $services = mpull($services, null, 'getName');\n    foreach ($names as $name) {\n      if (empty($services[$name])) {\n        throw new PhutilArgumentUsageException(\n          pht(\n            'Service \"%s\" does not exist or could not be loaded!',\n            $name));\n      }\n    }\n\n    return $services;\n  }\n\n}\n","sourceCodeStart":1,"sourceCodeEnd":30,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/applications/almanac/management/AlmanacManagementWorkflow.php#L1-L30","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","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."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"// Pre-resolve names the way loadServices() does, before running the workflow:\n$services = id(new AlmanacServiceQuery())\n  ->setViewer($viewer)\n  ->withNames($names)\n  ->execute();\n$missing = array_diff($names, mpull($services, 'getName'));\nif ($missing) {\n  throw new Exception('Unknown/invisible services: '.implode(', ', $missing));\n}","typeGuard":null,"tryCatchPattern":"try {\n  // execute management workflow taking --service names\n} catch (PhutilArgumentUsageException $ex) {\n  if (preg_match('/does not exist or could not be loaded/', $ex->getMessage())) {\n    // Re-check spelling/case against the service list, then retry once.\n  }\n  throw $ex;\n}","preventionTips":["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."],"tags":["almanac","service","not-found","cli","phabricator"],"backgroundTag":"entity-not-found","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}