{"record":{"id":"58c60038fd6552a2","repo":"phacility/phabricator","slug":"this-request-reached-a-site-which-requires-https","errorCode":null,"errorMessage":"This request reached a site which requires HTTPS, but the request is not marked as HTTPS.","messagePattern":"This request reached a site which requires HTTPS, but the request is not marked as HTTPS\\.","errorType":"exception","errorClass":"AphrontMalformedRequestException","httpStatus":500,"severity":"error","filePath":"src/aphront/configuration/AphrontApplicationConfiguration.php","lineNumber":451,"sourceCode":"            pht(\n              'This service is configured in cluster mode and the address '.\n              'this request was received on (\"%s\") is not whitelisted as '.\n              'a cluster address.',\n              $server_addr));\n        }\n      }\n    }\n\n    $site = $this->buildSiteForRequest($request);\n\n    if ($site->shouldRequireHTTPS()) {\n      if (!$request->isHTTPS()) {\n\n        // Don't redirect intracluster requests: doing so drops headers and\n        // parameters, imposes a performance penalty, and indicates a\n        // misconfiguration.\n        if ($request->isProxiedClusterRequest()) {\n          throw new AphrontMalformedRequestException(\n            pht('HTTPS Required'),\n            pht(\n              'This request reached a site which requires HTTPS, but the '.\n              'request is not marked as HTTPS.'));\n        }\n\n        $https_uri = $request->getRequestURI();\n        $https_uri->setDomain($request->getHost());\n        $https_uri->setProtocol('https');\n\n        // In this scenario, we'll be redirecting to HTTPS using an absolute\n        // URI, so we need to permit an external redirect.\n        return $this->buildRedirectController($https_uri, true);\n      }\n    }\n\n    $maps = $site->getRoutingMaps();\n    $path = $request->getPath();","sourceCodeStart":433,"sourceCodeEnd":469,"githubUrl":"https://github.com/phacility/phabricator/blob/5720a38cfe95b00ca4be5016dd0d2f3195f4fa04/src/aphront/configuration/AphrontApplicationConfiguration.php#L433-L469","documentation":"Thrown by 'bin/repository thaw --promote' when the device being promoted has no active binding to the repository's Almanac service. Promotion makes a device the authoritative leader, which is only meaningful for devices actively serving the service, so the workflow checks $service->getActiveBindings() for the device's PHID and refuses otherwise. Demotion, by contrast, is allowed for inactive devices too.","triggerScenarios":"Running 'bin/repository thaw --promote repo-005 R12' where repo-005's binding to the repository service is disabled/inactive: $bindings = $service->getActiveBindings() indexed by device PHID lacks $device->getPHID(), so the check at PhabricatorRepositoryManagementThawWorkflow.php:222 throws.","commonSituations":"A device taken out of rotation (binding disabled) during maintenance and then chosen as promotion target by mistake; promoting a newly added device whose binding was never activated; stale runbooks referencing decommissioned devices.","solutions":["Pick a device that currently has an active binding to the repository's service and re-run thaw --promote with it.","If the device should be promotable, reactivate its Almanac binding for that service first.","If the device was retired intentionally, promote a healthy active device instead (or demote the retired one with --demote, which permits inactive devices)."],"exampleFix":"# before\nbin/repository thaw --promote repo-old R12\n\n# after (promote a device with an active binding)\nbin/repository thaw --promote repo-005 R12","handlingStrategy":"validation","validationCode":"// Confirm the promote target has an active binding first:\n$bindings = $service->getActiveBindings();\n$bindings = mpull($bindings, null, 'getDevicePHID');\nif (empty($bindings[$device->getPHID()])) { /* choose another device or reactivate binding */ }","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Only promote devices currently serving the repository service.","Reactivate disabled bindings before choosing that device as a promotion target."],"tags":["phabricator","cli","almanac","cluster-repositories","promote-demote","service-binding"],"backgroundTag":"inactive-service-binding","analyzedSha":"5720a38cfe95b00ca4be5016dd0d2f3195f4fa04","analyzedAt":"2026-08-21T05:07:25.672Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}