phacility/phabricator · error · Exception

No resource source exists with name "%s"!

Error message

No resource source exists with name "%s"!

What it means

CelerityResourceMap::getNamedInstance($name) only accepts names registered by CelerityPhysicalResources::getAll() (i.e. real resource sources like the Phabricator and Phriction maps). Requesting any other name throws, because no physical resources directory exists to build a map from.

Source

Thrown at src/applications/celerity/CelerityResourceMap.php:45

    $this->packageMap = idx($map, 'packages', array());
    $this->nameMap = idx($map, 'names', array());

    // We derive these reverse maps at runtime.

    $this->hashMap = array_flip($this->nameMap);
    $this->componentMap = array();
    foreach ($this->packageMap as $package_name => $symbols) {
      foreach ($symbols as $symbol) {
        $this->componentMap[$symbol] = $package_name;
      }
    }
  }

  public static function getNamedInstance($name) {
    if (empty(self::$instances[$name])) {
      $resources_list = CelerityPhysicalResources::getAll();
      if (empty($resources_list[$name])) {
        throw new Exception(
          pht(
            'No resource source exists with name "%s"!',
            $name));
      }

      $instance = new CelerityResourceMap($resources_list[$name]);
      self::$instances[$name] = $instance;
    }

    return self::$instances[$name];
  }

  public function getNameMap() {
    return $this->nameMap;
  }

  public function getSymbolMap() {
    return $this->symbolMap;

View on GitHub (pinned to 5720a38cfe)

Solutions

  1. Use a name returned by array_keys(CelerityPhysicalResources::getAll())
  2. If you intended a custom source, implement the CelerityPhysicalResources subclass (with the matching getName()) so getAll() registers it
  3. Fix the typo or pass the name dynamically from getAll() instead of a hardcoded string

Example fix

// before
$map = CelerityResourceMap::getNamedInstance('my-resource');

// after
$sources = array_keys(CelerityPhysicalResources::getAll());
$map = CelerityResourceMap::getNamedInstance($sources[0]); // e.g. 'phabricator'
Defensive patterns

Strategy: validation

Validate before calling

$known = array_keys(CelerityPhysicalResources::getAll());
if (!in_array($name, $known, true)) {
  throw new Exception(
    'Unknown celerity resource source: '.$name.'. Known: '.implode(', ', $known));
}
$map = CelerityResourceMap::getNamedInstance($name);

Try / catch

try {
  $map = CelerityResourceMap::getNamedInstance($name);
} catch (Exception $ex) {
  // Fall back to the default distribution map.
  $map = CelerityResourceMap::getNamedInstance('phabricator');
}

Prevention

When it happens

Trigger: Calling CelerityResourceMap::getNamedInstance('my-resources') without having registered a CelerityPhysicalResources subclass named 'my-resources'; A config value or call site referencing a resource source name that was renamed or never existed (typo: 'phabricato'); Fork code that removed a resources source while a lookup remains

Common situations: Building a custom/static distribution with an extra resource package; upgrading Phabricator versions where a map name changed; hardcoded names in dev scripts drifting from the actual class names.

Related errors


AI-assisted analysis of phacility/phabricator@5720a38cfe (2026-08-21). Data as JSON: /api/errors/32559fc9414021a4. Report an issue: GitHub.