{"record":{"id":"4e27795e5e4b81b1","repo":"RocketChat/Rocket.Chat","slug":"failed-to-retrieve-registration-confirmation-poll","errorCode":null,"errorMessage":"Failed to retrieve registration confirmation poll data: ${response.statusText}","messagePattern":"Failed to retrieve registration confirmation poll data: (.+?)","errorType":"exception","errorClass":null,"httpStatus":400,"severity":"error","filePath":"apps/meteor/server/lib/cloud/getConfirmationPoll.ts","lineNumber":26,"sourceCode":"export async function getConfirmationPoll(deviceCode: string): Promise<CloudConfirmationPollData> {\n\tassertNotOfflineLicense();\n\n\ttry {\n\t\tconst cloudUrl = settings.get<string>('Cloud_Url');\n\t\tconst response = await fetch(`${cloudUrl}/api/v2/register/workspace/poll`, {\n\t\t\tparams: { token: deviceCode },\n\t\t\t// SECURITY: the URL is a default hardcoded value or an envvar/setting set by an admin. It's safe to disable this check.\n\t\t\tignoreSsrfValidation: true,\n\t\t});\n\n\t\ttry {\n\t\t\tif (!response.ok) {\n\t\t\t\tthrow new Error((await response.json()).error);\n\t\t\t}\n\n\t\t\treturn await response.json();\n\t\t} catch (err) {\n\t\t\tthrow new Error(`Failed to retrieve registration confirmation poll data: ${response.statusText}`);\n\t\t}\n\t} catch (err: any) {\n\t\tSystemLogger.error({\n\t\t\tmsg: 'Failed to get confirmation poll from Rocket.Chat Cloud',\n\t\t\turl: '/api/v2/register/workspace/poll',\n\t\t\terr,\n\t\t});\n\n\t\tthrow err;\n\t}\n}\n","sourceCodeStart":8,"sourceCodeEnd":38,"githubUrl":"https://github.com/RocketChat/Rocket.Chat/blob/b2c16d5842cbe6b69b59bdf6fc5e5f1afcd1f0b0/apps/meteor/server/lib/cloud/getConfirmationPoll.ts#L8-L38","documentation":"During device-code style registration, getConfirmationPoll polls cloud /api/v2/register/workspace/poll with the device token. Any non-ok response or unreadable body is rethrown as 'Failed to retrieve registration confirmation poll data: <statusText>'. The original detail (including the cloud's JSON error) is only visible in SystemLogger under 'Failed to get confirmation poll from Rocket.Chat Cloud'.","triggerScenarios":"Polling while the cloud rejects the device code (expired or unknown), during cloud outages, or when a proxy answers instead of the cloud so the body cannot be parsed.","commonSituations":"Registration left pending past the device-code expiry; cloud maintenance windows; blocked egress to cloud.rocket.chat; slow approvals exceeding the code lifetime.","solutions":["Check SystemLogger for the underlying error detail before trusting the generic statusText message.","Restart the registration to obtain a fresh device code and approve it promptly in the cloud console.","Verify network egress and proxy access to Cloud_Url from the server.","If the cloud is temporarily down, wait and retry the poll later."],"exampleFix":null,"handlingStrategy":"retry","validationCode":null,"typeGuard":null,"tryCatchPattern":"try {\n  const poll = await getConfirmationPoll(deviceCode);\n} catch (e) {\n  if (e instanceof Error && e.message.startsWith('Failed to retrieve registration confirmation poll data')) {\n    // inspect SystemLogger for the real cause; restart registration if the device code expired\n  }\n  throw e;\n}","preventionTips":["Approve device-code requests promptly — codes expire; poll results only within their lifetime.","Correlate the generic message with the SystemLogger 'Failed to get confirmation poll' entry before debugging.","Monitor egress to Cloud_Url so poll failures due to network are distinguished from cloud rejections."],"tags":["rocket-chat","cloud","polling","device-code","network"],"backgroundTag":"device-code-poll-failed","analyzedSha":"b2c16d5842cbe6b69b59bdf6fc5e5f1afcd1f0b0","analyzedAt":"2026-08-18T15:26:39.429Z","schemaVersion":2},"datasetVersion":"2026-08-21T13:17:26.733Z"}