phacility/phabricator · error · PhutilProxyException
Invalid parameter information was passed to method '%s'.
Error message
Invalid parameter information was passed to method '%s'.
What it means
When parameters come as a single 'params' POST field, Phabricator decodes its contents with phutil_json_decode(). Failure raises a PhutilProxyException whose message names the Conduit method and which wraps the underlying PhutilJSONParserException carrying the exact parse error and offset.
Source
Thrown at src/applications/conduit/controller/PhabricatorConduitAPIController.php:691
}
$params[$key] = $decoded_value;
}
$metadata = idx($params, '__conduit__', array());
unset($params['__conduit__']);
return array($metadata, $params, true);
}
// Otherwise, look for a single parameter called 'params' which has the
// entire param dictionary JSON encoded.
$params_json = $request->getStr('params');
if (phutil_nonempty_string($params_json)) {
$params = null;
try {
$params = phutil_json_decode($params_json);
} catch (PhutilJSONParserException $ex) {
throw new PhutilProxyException(
pht(
"Invalid parameter information was passed to method '%s'.",
$method),
$ex);
}
$metadata = idx($params, '__conduit__', array());
unset($params['__conduit__']);
return array($metadata, $params, true);
}
// If we do not have `params`, assume this is a simple HTTP request with
// HTTP key-value pairs.
$params = array();
$metadata = array();
foreach ($request->getPassthroughRequestData() as $key => $value) {
$meta_key = ConduitAPIMethod::getParameterMetadataKey($key);View on GitHub (pinned to 5720a38cfe)
Solutions
- Build the params payload with your language's JSON encoder (json_encode/json.dumps) instead of by hand.
- Inspect the wrapped PhutilJSONParserException (or run the payload through a JSON linter) to find the exact syntax offset.
- Replace bespoke HTTP calls with arc call-conduit, which encodes parameters correctly.
Example fix
# before
$ curl -d 'params={"query":phabricator}' https://phab.example.com/api/phabricator.macro.query
# after
$ curl -d 'params={"query":"phabricator"}' https://phab.example.com/api/phabricator.macro.query Defensive patterns
Strategy: validation
Validate before calling
# Always build the params field with an encoder, never string templates.
import json
body = 'params=' + requests.utils.quote(json.dumps(params))
requests.post(url, data=body,
headers={'Content-Type': 'application/x-www-form-urlencoded'}) Prevention
- Use json.dumps/json_encode for the params payload and let the HTTP library handle form encoding.
- Round-trip check before sending: json.loads(payload) must succeed.
- Prefer arc call-conduit over raw curl in scripts; it encodes parameters correctly.
When it happens
Trigger: curl -d 'params={"query":phabricator}' with an unquoted string or trailing comma; client code assembling the params string via string concatenation or printf with unescaped values; a shell mangling quotes so the body arrives truncated or altered.
Common situations: Hand-written curl incantations in scripts or wiki docs; clients that 'look right' but interpolate quotes incorrectly when values contain quotes or newlines.
Related errors
- The value for parameter '%s' is not valid JSON. All paramete
- Use form-encoded data to submit parameters to Conduit endpoi
- Error while reading "%s": %s
- Invalid JSON input.
- Service "%s" is unrecognized, restricted, or you do not have
AI-assisted analysis of phacility/phabricator@5720a38cfe (2026-08-21).
Data as JSON: /api/errors/b44c17c898551154.
Report an issue: GitHub.