phacility/phabricator · error · Exception
The value for parameter '%s' is not valid JSON. All paramete
Error message
The value for parameter '%s' is not valid JSON. All parameters must be encoded as JSON values, including strings (which means you need to surround them in double quotes). Check your syntax. Value was: %s.
What it means
When parameters arrive console-style as array fields (params[key]=value), Phabricator JSON-decodes each value individually. If json_decode() returns null for a value that is not the literal string 'null', the value is not valid JSON and this exception is raised, echoing the offending key and raw value. Bare, unquoted strings are the classic cause.
Source
Thrown at src/applications/conduit/controller/PhabricatorConduitAPIController.php:665
$params = $request->getArr('params', null);
if ($params !== null) {
foreach ($params as $key => $value) {
if ($value == '') {
// Interpret empty string null (e.g., the user didn't type anything
// into the box).
$value = 'null';
}
$decoded_value = json_decode($value, true);
if ($decoded_value === null && strtolower($value) != 'null') {
// When json_decode() fails, it returns null. This almost certainly
// indicates that a user was using the web UI and didn't put quotes
// around a string value. We can either do what we think they meant
// (treat it as a string) or fail. For now, err on the side of
// caution and fail. In the future, if we make the Conduit API
// actually do type checking, it might be reasonable to treat it as
// a string if the parameter type is string.
throw new Exception(
pht(
"The value for parameter '%s' is not valid JSON. All ".
"parameters must be encoded as JSON values, including strings ".
"(which means you need to surround them in double quotes). ".
"Check your syntax. Value was: %s.",
$key,
$value));
}
$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 theView on GitHub (pinned to 5720a38cfe)
Solutions
- Surround every string value in double quotes so it is a valid JSON value.
- Paste the whole params blob into a JSON linter before submitting the console call.
- For programmatic calls, build params with a real JSON encoder instead of string concatenation.
Example fix
// before (console params box)
{"name": phabricator}
// after
{"name": "phabricator"} Defensive patterns
Strategy: validation
Validate before calling
// Browser console: validate the params box before submitting the call.
try {
const parsed = JSON.parse(document.querySelector('textarea[name="params"]').value);
// Each top-level value must also be a valid JSON *value* (strings quoted).
} catch (e) {
alert('Params are not valid JSON: ' + e.message);
} Prevention
- Treat every string in the console params box as a quoted JSON string.
- Run the params blob through a JSON linter before clicking Call Method.
- For repeated testing, save the last known-good params JSON and edit incrementally.
When it happens
Trigger: In the Conduit API Console, entering a string parameter as phabricator instead of "phabricator"; unbalanced quotes or braces in a parameter value; copying a value from documentation that strips the surrounding quotes.
Common situations: First-time console users assuming parameters are plain form text; hand-editing the params textarea of a previously working console call and accidentally removing quotes around one value.
Related errors
- Invalid parameter information was passed to method '%s'.
- 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/78deddc6310d7c7c.
Report an issue: GitHub.