{"record":{"id":"9f016c78c5c1150f","repo":"RocketChat/Rocket.Chat","slug":"invalid-server-info","errorCode":null,"errorMessage":"Invalid server info","messagePattern":"Invalid server info","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"apps/meteor/client/hooks/useWorkspaceInfo.ts","lineNumber":15,"sourceCode":"import type { IStats, IWorkspaceInfo, Serialized } from '@rocket.chat/core-typings';\nimport type { IInstance } from '@rocket.chat/rest-typings';\nimport { useEndpoint } from '@rocket.chat/ui-contexts';\nimport { keepPreviousData, useMutation, useQueries, useQuery, useQueryClient } from '@tanstack/react-query';\n\nconst useServerInfoQueryOptions = () => {\n\tconst getServerInfo = useEndpoint('GET', '/info');\n\n\treturn {\n\t\tqueryKey: ['info', 'serverInfo'],\n\t\tqueryFn: async () => {\n\t\t\tconst data = await getServerInfo();\n\n\t\t\tif (!('minimumClientVersions' in data)) {\n\t\t\t\tthrow new Error('Invalid server info');\n\t\t\t}\n\t\t\tif (!('info' in data)) {\n\t\t\t\tthrow new Error('Invalid server info');\n\t\t\t}\n\t\t\tif (!('version' in data)) {\n\t\t\t\tthrow new Error('Invalid server info');\n\t\t\t}\n\n\t\t\treturn data as IWorkspaceInfo;\n\t\t},\n\t\tstaleTime: Infinity,\n\t\tplaceholderData: keepPreviousData,\n\t} as const;\n};\n\nexport const useServerInfo = () => useQuery(useServerInfoQueryOptions());\n\nexport const useWorkspaceInfo = ({ refreshStatistics }: { refreshStatistics?: boolean } = {}) => {","sourceCodeStart":1,"sourceCodeEnd":33,"githubUrl":"https://github.com/RocketChat/Rocket.Chat/blob/f9d3ec372bb580fa8d036f94cf03925a478ef768/apps/meteor/client/hooks/useWorkspaceInfo.ts#L1-L33","documentation":"Thrown by the useServerInfoQueryOptions queryFn when the GET /info response does not contain a `minimumClientVersions` key. The query performs three sequential structural checks against the IWorkspaceInfo contract; the first failing check throws this generic message. This check guards clients that rely on the server advertising minimum required client versions.","triggerScenarios":"The /info endpoint returned a body missing `minimumClientVersions` — e.g. an old server that predates the field, a proxied/modified response, or an error envelope with HTTP 200. Because the check is `!('minimumClientVersions' in data)`, even a null value would pass; only an absent key throws.","commonSituations":"Client bundle is newer than the server (server too old to advertise minimum versions); a reverse proxy rewriting /info; a non-Rocket.Chat service responding on the same path; testing against a mock that returns a partial /info body.","solutions":["Inspect the raw GET /info response in DevTools; a missing minimumClientVersions key indicates an old/patched server.","Upgrade the server to a version that includes minimumClientVersions in /info.","If behind a proxy, ensure /info is passed through unchanged.","In tests/mocks, return the full IWorkspaceInfo shape including minimumClientVersions, info, and version."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"const data = await getServerInfo();\nif (!('minimumClientVersions' in data)) {\n  throw new Error('Server too old: missing minimumClientVersions');\n}","typeGuard":"function hasMinimumClientVersions(d: unknown): d is { minimumClientVersions: unknown } {\n  return typeof d === 'object' && d !== null && 'minimumClientVersions' in d;\n}","tryCatchPattern":"try {\n  const info = await useServerInfo();\n} catch (e) {\n  if ((e as Error).message === 'Invalid server info') {\n    showServerUpgradeRequired();\n  }\n}","preventionTips":["Upgrade the server to a version that returns the full /info contract.","Ensure proxies pass /info through unchanged.","Mock the full IWorkspaceInfo shape in tests."],"tags":["workspace-info","version-compat","rest","response-shape","react-query"],"backgroundTag":null,"analyzedSha":"f9d3ec372bb580fa8d036f94cf03925a478ef768","analyzedAt":"2026-08-12T19:07:17.372Z","schemaVersion":2},"datasetVersion":"2026-08-12T23:17:12.415Z"}