phacility/phabricator · error · PhutilProxyException

Invalid parameter information was passed to method

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.

Solutions

  1. Build the params payload with your language's JSON encoder (json_encode/json.dumps) instead of by hand.
  2. Inspect the wrapped PhutilJSONParserException (or run the payload through a JSON linter) to find the exact syntax offset.
  3. 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

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.

Understand the failure class

Background: JSON parse error: "Unexpected token" / "not valid JSON" / "failed to parse" — what JSON parsers are really complaining about — this error's family across 45 libraries.

Related errors


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

Appendix: 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)