{"record":{"id":"c1feb8e9e3188351","repo":"octobercms/october","slug":"system-lang-server-response-empty","errorCode":"system::lang.server.response_empty","errorMessage":"Empty response from the server.","messagePattern":"Empty response from the server\\.","errorType":"exception","errorClass":"ApplicationException","httpStatus":null,"severity":"error","filePath":"modules/system/classes/updatemanager/HasGatewayAccess.php","lineNumber":49,"sourceCode":"    protected $secret;\n\n    /**\n     * requestServerData contacts the update server for a response.\n     * @param  string $uri\n     * @param  array  $postData\n     * @return array\n     */\n    public function requestServerData($uri, $postData = [])\n    {\n        $result = $this->makeHttpRequest($this->createServerUrl($uri), $postData);\n        $contents = $result->body();\n\n        if ($result->status() === 404) {\n            throw new ApplicationException(Lang::get('system::lang.server.response_not_found'));\n        }\n\n        if ($result->status() !== 200) {\n            throw new ApplicationException(\n                strlen($contents)\n                ? $contents\n                : Lang::get('system::lang.server.response_empty')\n            );\n        }\n\n        $resultData = false;\n\n        try {\n            $resultData = @json_decode($contents, true);\n        }\n        catch (Exception $ex) {\n            throw new ApplicationException(Lang::get('system::lang.server.response_invalid'));\n        }\n\n        if ($resultData === false || (is_string($resultData) && !strlen($resultData))) {\n            throw new ApplicationException(Lang::get('system::lang.server.response_invalid'));\n        }","sourceCodeStart":31,"sourceCodeEnd":67,"githubUrl":"https://github.com/octobercms/october/blob/b608633a7e8922487d91a8161499020121c3b3bf/modules/system/classes/updatemanager/HasGatewayAccess.php#L31-L67","documentation":"In requestServerData(), any non-200, non-404 status whose body is empty throws 'Empty response from the server' (system::lang.server.response_empty). So the gateway returned an error status (5xx, 429, gateway timeouts) with a blank body — the updater refuses to guess and surfaces it. Distinct from a 404 (response_not_found) and from a 200 with bad JSON (response_invalid).","triggerScenarios":"Update server overloaded or returning 502/503 with empty body; a proxy stripping error bodies; rate limiting (429) from the marketplace; middleware resetting connections into blank responses. Any backend update/marketplace operation that calls requestServerData().","commonSituations":"Temporary marketplace outages; corporate proxies; hosting providers rate-limiting outbound APIs; maintenance windows on the update infrastructure.","solutions":["Retry after a short wait — transient 5xx/429 responses usually clear on their own","Reproduce with curl -i against the gateway to see the raw status/body","If a proxy sits in front, configure it to pass through response bodies instead of blanking them","Check the marketplace status page / community channels for outages if it persists"],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"$attempts = 0;\nwhile (true) {\n    try {\n        return \\System\\Classes\\UpdateManager::instance()->requestServerData($uri, $postData);\n    } catch (\\October\\Rain\\Exception\\ApplicationException $ex) {\n        $transient = str_contains($ex->getMessage(), 'Empty response');\n        if (!$transient || ++$attempts >= 3) {\n            throw $ex;\n        }\n        usleep((2 ** $attempts) * 1000000); // 0.2s, 0.4s, 0.8s backoff\n    }\n}","preventionTips":["Wrap marketplace calls in retry with exponential backoff for 5xx/empty-body errors","Schedule update checks off-peak to dodge gateway load spikes","Log the status/endpoint alongside failures to separate 404s from empty-body errors"],"tags":["octobercms","updates","network","http-5xx","empty-response"],"backgroundTag":"empty-server-response","analyzedSha":"b608633a7e8922487d91a8161499020121c3b3bf","analyzedAt":"2026-08-21T04:24:57.515Z","schemaVersion":2},"datasetVersion":"2026-08-21T11:28:35.574Z"}