{"record":{"id":"8fa966f5fc3d6692","repo":"flarum/framework","slug":"unexpected-response-from-discuss-flarum-org","errorCode":null,"errorMessage":"Unexpected response from discuss.flarum.org.","messagePattern":"Unexpected response from discuss\\.flarum\\.org\\.","errorType":"exception","errorClass":"RuntimeException","httpStatus":null,"severity":"error","filePath":"framework/core/src/Announcements/AnnouncementsFetcher.php","lineNumber":83,"sourceCode":"        ]);\n\n        try {\n            $response = $this->client->get($url, [\n                'headers' => [\n                    'Accept' => 'application/json',\n                    'User-Agent' => 'Flarum/'.Application::VERSION\n                        .' PHP/'.$this->appInfo->identifyPHPVersion()\n                        .' Database/'.$this->appInfo->identifyDatabaseDriver().'/'.$this->appInfo->identifyDatabaseVersion(),\n                ],\n            ]);\n        } catch (GuzzleException $e) {\n            throw new RuntimeException('Could not fetch announcements from discuss.flarum.org: '.$e->getMessage(), 0, $e);\n        }\n\n        $body = json_decode((string) $response->getBody(), true);\n\n        if (! is_array($body['data'] ?? null)) {\n            throw new RuntimeException('Unexpected response from discuss.flarum.org.');\n        }\n\n        $posts = [];\n        $users = [];\n        $tagSlugs = [];\n        foreach ($body['included'] ?? [] as $resource) {\n            if (Arr::get($resource, 'type') === 'posts') {\n                $posts[$resource['id']] = $resource;\n            } elseif (Arr::get($resource, 'type') === 'users') {\n                $users[$resource['id']] = $resource;\n            } elseif (Arr::get($resource, 'type') === 'tags') {\n                $tagSlugs[$resource['id']] = Arr::get($resource, 'attributes.slug');\n            }\n        }\n\n        $items = [];\n        foreach ($body['data'] as $discussion) {\n            $id = Arr::get($discussion, 'id');","sourceCodeStart":65,"sourceCodeEnd":101,"githubUrl":"https://github.com/flarum/framework/blob/4b939f685389bfe8a380e9e28ddf305a1c66950c/framework/core/src/Announcements/AnnouncementsFetcher.php#L65-L101","documentation":"Response-validation error in AnnouncementsFetcher::fetch: the HTTP request to discuss.flarum.org succeeded at the transport level, but the response was not the expected JSON announcement feed (unexpected status, wrong content type, or malformed body), so the fetcher rejects it rather than parsing garbage. Generic guard on the remote API response.","triggerScenarios":"Thrown at framework/core/src/Announcements/AnnouncementsFetcher.php:83 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Inspect the actual response body/status from discuss.flarum.org (may be a 5xx or an HTML error page from a proxy/CDN).","Retry later; the remote API may be temporarily degraded.","Cache the last good announcements payload and serve it as a fallback.","Verify no outbound proxy is rewriting the response."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"4b939f685389bfe8a380e9e28ddf305a1c66950c","analyzedAt":"2026-09-15T18:09:20.879Z","contentChangedAt":"2026-09-15T18:09:20.879Z","schemaVersion":2},"datasetVersion":"2026-09-16T09:17:16.951Z"}