phacility/phabricator · error · ConduitException
ERR-INVALID-ENGINE
ERR-INVALID-ENGINE
Error message
ERR-INVALID-ENGINE
What it means
Conduit exception ERR-INVALID-ENGINE from remarkup.process: the 'context' parameter is not one of the installed markup engine contexts. execute() maps the context through getEngineContexts(), which only defines 'phriction', 'maniphest', 'differential', 'phame', 'feed', and 'diffusion'; any other string raises this error code.
Source
Thrown at src/applications/remarkup/conduit/RemarkupProcessConduitAPIMethod.php:44
}
protected function defineParamTypes() {
$available_contexts = array_keys($this->getEngineContexts());
$available_const = $this->formatStringConstants($available_contexts);
return array(
'context' => 'required '.$available_const,
'contents' => 'required list<string>',
);
}
protected function execute(ConduitAPIRequest $request) {
$contents = $request->getValue('contents');
$context = $request->getValue('context');
$engine_class = idx($this->getEngineContexts(), $context);
if (!$engine_class) {
throw new ConduitException('ERR-INVALID-ENGINE');
}
$engine = PhabricatorMarkupEngine::$engine_class();
$engine->setConfig('viewer', $request->getUser());
$results = array();
foreach ($contents as $content) {
$text = $engine->markupText($content);
if ($text) {
$content = hsprintf('%s', $text)->getHTMLContent();
} else {
$content = '';
}
$results[] = array(
'content' => $content,
);
}
return $results;View on GitHub (pinned to 5720a38cfe)
Solutions
- Call remarkup.process with one of: phriction, maniphest, differential, phame, feed, diffusion.
- Inspect the method's parameter description at conduit method discovery time; it enumerates valid contexts dynamically.
- If you need a custom context, extend RemarkupProcessConduitAPIMethod::getEngineContexts() in a fork rather than sending an unknown key.
- Wrap the call and treat ERR-INVALID-ENGINE as a client error: do not retry with the same context.
Example fix
// before
$request = $conduit->callMethod('remarkup.process', array(
'context' => 'phabricator',
'contents' => array('**hi**'),
));
// after
$request = $conduit->callMethod('remarkup.process', array(
'context' => 'phriction',
'contents' => array('**hi**'),
)); Defensive patterns
Strategy: validation
Validate before calling
$valid = array(
'phriction', 'maniphest', 'differential', 'phame', 'feed', 'diffusion',
);
if (!in_array($context, $valid, true)) {
throw new InvalidArgumentException('Invalid remarkup context: '.$context);
} Type guard
function isValidRemarkupContext($context) {
static $valid = array(
'phriction', 'maniphest', 'differential', 'phame', 'feed', 'diffusion',
);
return is_string($context) && in_array($context, $valid, true);
} Try / catch
try {
$result = $client->callMethod('remarkup.process', $params);
} catch (ConduitException $ex) {
if ($ex->getMessage() === 'ERR-INVALID-ENGINE') {
// fix the context parameter; do not retry unchanged
}
throw $ex;
} Prevention
- Read the enumerated contexts from remarkup.process parameter metadata instead of guessing.
- Centralize the context constant in one place in client code.
- Treat ERR-INVALID-ENGINE as a permanent client error; never auto-retry.
When it happens
Trigger: Calling conduit method remarkup.process with context outside the fixed map, e.g. context='phabricator', 'markdown', 'wiki', or a typo like 'phrictio'. The parameter spec advertises the valid constants, but execute() re-checks and throws ConduitException('ERR-INVALID-ENGINE').
Common situations: Client code guesses a context name instead of reading the method's parameter spec; scripts written against a fork that added custom contexts then run against stock Phorge; version drift after contexts were added/removed upstream.
Related errors
- Service "%s" is unrecognized, restricted, or you do not have
- Conduit API method "%s" does not exist.
- Method '%s' belongs to application '%s', which is not instal
- Specify a method to call with "--method".
- Specify a file to read parameters from with "--input".
AI-assisted analysis of phacility/phabricator@5720a38cfe (2026-08-21).
Data as JSON: /api/errors/9d043cac7a0c1566.
Report an issue: GitHub.