phacility/phabricator · error · AphrontMalformedRequestException

This service is configured in cluster mode and the address t

Error message

This service is configured in cluster mode and the address this request was received on ("%s") is not whitelisted as a cluster address.

What it means

Thrown by 'bin/repository thaw' while processing a repository when $repository->loadAlmanacService() returns null, i.e. the repository is not bound to any Almanac service and therefore is not a cluster repository. Thaw exists to repair cluster working-copy version locks and leadership; a non-cluster repository has no cluster state to repair, so the command refuses rather than pretending to thaw it.

Source

Thrown at src/aphront/configuration/AphrontApplicationConfiguration.php:431

      $server_addr = idx($_SERVER, 'SERVER_ADDR');
      if (!$server_addr) {
        if (php_sapi_name() == 'cli') {
          // This is a command line script (probably something like a unit
          // test) so it's fine that we don't have SERVER_ADDR defined.
        } else {
          throw new AphrontMalformedRequestException(
            pht('No %s', 'SERVER_ADDR'),
            pht(
              'This service is configured to operate in cluster mode, but '.
              '%s is not defined in the request context. Your webserver '.
              'configuration needs to forward %s to PHP so the software can '.
              'reject requests received on external interfaces.',
              'SERVER_ADDR',
              'SERVER_ADDR'));
        }
      } else {
        if (!PhabricatorEnv::isClusterAddress($server_addr)) {
          throw new AphrontMalformedRequestException(
            pht('External Interface'),
            pht(
              'This service is configured in cluster mode and the address '.
              'this request was received on ("%s") is not whitelisted as '.
              'a cluster address.',
              $server_addr));
        }
      }
    }

    $site = $this->buildSiteForRequest($request);

    if ($site->shouldRequireHTTPS()) {
      if (!$request->isHTTPS()) {

        // Don't redirect intracluster requests: doing so drops headers and
        // parameters, imposes a performance penalty, and indicates a
        // misconfiguration.

View on GitHub (pinned to 5720a38cfe)

Solutions

  1. Remove the non-cluster repository from the thaw command and thaw only repositories bound to a cluster service.
  2. Check the repository's 'Cluster' / service setting (or Almanac bindings) to confirm which repositories are actually clustered.
  3. If the repository should be clustered, bind it to an Almanac repository service first, then re-run thaw.

Example fix

# before
bin/repository thaw --demote dev-001 R77 R12

# after (thaw only cluster repositories)
bin/repository thaw --demote dev-001 R12
Defensive patterns

Strategy: validation

Validate before calling

// Filter to cluster repositories before thaw:
$service = $repository->loadAlmanacService();
if (!$service) { /* skip: not a cluster repository, thaw does not apply */ }

Prevention

When it happens

Trigger: Naming a plain (non-cluster) repository in a thaw command, e.g. 'bin/repository thaw --demote dev-001 R77' where R77 is hosted locally without an Almanac repository service: the per-repository loop at PhabricatorRepositoryManagementThawWorkflow.php:210 finds no service and throws.

Common situations: Mixed installations where only some repositories are clustered; running thaw on a single-device Phabricator after reading cluster-recovery docs; a repository that lost its service binding after Almanac reconfiguration; using '--all-repositories' on a device whose service also hosts non-cluster repos.

Related errors


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