phacility/phabricator · error · PhutilProxyException

Expected valid JSON response from Disqus account data…

Error message

Expected valid JSON response from Disqus account data request.

What it means

Raised in the Disqus OAuth adapter when the GET to disqus.com/api/3.0/users/details.json returns a body that fails phutil_json_decode(). The PhutilJSONParserException is wrapped in a proxy exception; it means Disqus returned a non-JSON payload (error page, empty body, or HTML).

Solutions

  1. Retry authentication; the failure is often transient
  2. Check that the Disqus client ID (api_key) and access token are valid
  3. Inspect server logs for the raw Disqus response
Defensive patterns

Strategy: try-catch

When it happens

Trigger: Thrown at src/applications/auth/adapter/PhutilDisqusAuthAdapter.php:78 when the library encounters an invalid state.

Common situations: See trigger scenarios.


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

Appendix: source

Thrown at src/applications/auth/adapter/PhutilDisqusAuthAdapter.php:78

      'grant_type' => 'authorization_code',
    );
  }

  protected function loadOAuthAccountData() {
    $uri = new PhutilURI('https://disqus.com/api/3.0/users/details.json');
    $uri->replaceQueryParam('api_key', $this->getClientID());
    $uri->replaceQueryParam('access_token', $this->getAccessToken());
    $uri = (string)$uri;

    $future = new HTTPSFuture($uri);
    $future->setMethod('GET');
    list($body) = $future->resolvex();

    try {
      $data = phutil_json_decode($body);
      return $data['response'];
    } catch (PhutilJSONParserException $ex) {
      throw new PhutilProxyException(
        pht('Expected valid JSON response from Disqus account data request.'),
        $ex);
    }
  }

}

View on GitHub (pinned to 5720a38cfe)