diff --git a/src/applications/repository/storage/PhabricatorRepository.php b/src/applications/repository/storage/PhabricatorRepository.php --- a/src/applications/repository/storage/PhabricatorRepository.php +++ b/src/applications/repository/storage/PhabricatorRepository.php @@ -2024,10 +2024,35 @@ } if ($never_proxy) { + // See PHI1030. This error can arise from various device name/address + // mismatches which are hard to detect, so try to provide as much + // information as we can. + + if ($writable) { + $request_type = pht('(This is a write request.)'); + } else { + $request_type = pht('(This is a read request.)'); + } + throw new Exception( pht( - 'Refusing to proxy a repository request from a cluster host. '. - 'Cluster hosts must correctly route their intracluster requests.')); + 'This repository request (for repository "%s") has been '. + 'incorrectly routed to a cluster host (with device name "%s", '. + 'and hostname "%s") which can not serve the request.'. + "\n\n". + 'The Almanac device address for the correct device may improperly '. + 'point at this host, or the "device.id" configuration file on '. + 'this host may be incorrect.'. + "\n\n". + 'Requests routed within the cluster by Phabricator are always '. + 'expected to be sent to a node which can serve the request. To '. + 'prevent loops, this request will not be proxied again.'. + "\n\n". + "%s", + $this->getDisplayName(), + $local_device, + php_uname('n'), + $request_type)); } if (count($results) > 1) {