phacility/phabricator · error · Exception
Attempting to build function "%s" from dictionary, but that
Error message
Attempting to build function "%s" from dictionary, but that function is unknown. Known functions are: %s.
What it means
PhabricatorChartFunction::newFromDictionary() constructs a chart function from a dictionary with 'function' and 'arguments' keys. The function name is looked up in the registry of PhabricatorChartFunction subclasses; an unknown name throws this Exception and the message lists all known function names.
Source
Thrown at src/applications/fact/chart/PhabricatorChartFunction.php:79
}
final public function getKey() {
return $this->getFunctionLabel()->getKey();
}
final public static function newFromDictionary(array $map) {
PhutilTypeSpec::checkMap(
$map,
array(
'function' => 'string',
'arguments' => 'list<wild>',
));
$functions = self::getAllFunctions();
$function_name = $map['function'];
if (!isset($functions[$function_name])) {
throw new Exception(
pht(
'Attempting to build function "%s" from dictionary, but that '.
'function is unknown. Known functions are: %s.',
$function_name,
implode(', ', array_keys($functions))));
}
$function = id(clone $functions[$function_name])
->setArguments($map['arguments']);
return $function;
}
public function getSubfunctions() {
$result = array();
$result[] = $this;
foreach ($this->getFunctionArguments() as $argument) {View on GitHub (pinned to 5720a38cfe)
Solutions
- Use a function name from the list in the error message exactly (case-sensitive).
- Check the function registry with PhabricatorChartFunction::getAllFunctions() to see the exact keys available in your version.
- Rebuild the chart/spec that embeds the bad function name and re-save it.
- If a custom function class stopped registering, verify it extends PhabricatorChartFunction and its class is loadable.
Example fix
// before $fn = PhabricatorChartFunction::newFromDictionary(array( 'function' => 'sum', // unknown -> Exception 'arguments' => array(1, 2), )); // after $known = PhabricatorChartFunction::getAllFunctions(); $name = isset($known['sum']) ? 'sum' : 'constant'; $fn = PhabricatorChartFunction::newFromDictionary(array( 'function' => $name, 'arguments' => array(1, 2), ));
Defensive patterns
Strategy: validation
Validate before calling
$functions = PhabricatorChartFunction::getAllFunctions();
if (!isset($functions[$map['function']])) {
throw new Exception('Unsupported chart function: '.$map['function']);
}
$fn = PhabricatorChartFunction::newFromDictionary($map); Prevention
- Build function dictionaries only from keys of getAllFunctions().
- Centralize chart-spec construction in one helper that validates names.
- After upgrades, re-save custom charts so stored dictionaries match current function names.
When it happens
Trigger: Calling PhabricatorChartFunction::newFromDictionary(array('function' => $name, 'arguments' => ...)) where $name is not a key of PhabricatorChartFunction::getAllFunctions() — e.g. a typo, a renamed function, or a custom function class not loaded.
Common situations: Stored charts referencing chart functions removed/renamed across Phabricator versions; hand-written chart function dictionaries; custom chart function classes whose getFunctionName() changed; JSON specs authored externally with guessed function names.
Related errors
- Trying to construct a dataset of type "%s", but this type is
- Function "%s" is unknown. Valid functions are: %s
- Value for "fact-key" argument must be a string, got %s.
- Fact key "%s" is not a known fact key.
- Value for "function" argument must be a function definition,
AI-assisted analysis of phacility/phabricator@5720a38cfe (2026-08-21).
Data as JSON: /api/errors/947dceb0e844269a.
Report an issue: GitHub.