{"record":{"id":"1e6178bfaf87482e","repo":"RocketChat/Rocket.Chat","slug":"error-e2e-enabled","errorCode":"error-e2e-enabled","errorMessage":"Enabling auto-translation in E2E encrypted rooms is not allowed","messagePattern":"Enabling auto-translation in E2E encrypted rooms is not allowed","errorType":"exception","errorClass":"Meteor.Error","httpStatus":null,"severity":"error","filePath":"apps/meteor/server/lib/autotranslate/functions/saveSettings.ts","lineNumber":44,"sourceCode":"\t\tthrow new Meteor.Error('error-invalid-settings', 'Invalid settings field', {\n\t\t\tmethod: 'saveAutoTranslateSettings',\n\t\t});\n\t}\n\n\tconst subscription = await Subscriptions.findOneByRoomIdAndUserId(rid, userId);\n\tif (!subscription) {\n\t\tthrow new Meteor.Error('error-invalid-subscription', 'Invalid subscription', {\n\t\t\tmethod: 'saveAutoTranslateSettings',\n\t\t});\n\t}\n\n\tlet shouldNotifySubscriptionChanged = false;\n\n\tswitch (field) {\n\t\tcase 'autoTranslate':\n\t\t\tconst room = await Rooms.findE2ERoomById(rid, { projection: { _id: 1 } });\n\t\t\tif (room && value === '1') {\n\t\t\t\tthrow new Meteor.Error('error-e2e-enabled', 'Enabling auto-translation in E2E encrypted rooms is not allowed', {\n\t\t\t\t\tmethod: 'saveAutoTranslateSettings',\n\t\t\t\t});\n\t\t\t}\n\n\t\t\tconst updateAutoTranslateResponse = await Subscriptions.updateAutoTranslateById(subscription._id, value === '1');\n\t\t\tif (updateAutoTranslateResponse.modifiedCount) {\n\t\t\t\tshouldNotifySubscriptionChanged = true;\n\t\t\t}\n\n\t\t\tif (!subscription.autoTranslateLanguage && options.defaultLanguage) {\n\t\t\t\tconst updateAutoTranslateLanguageResponse = await Subscriptions.updateAutoTranslateLanguageById(\n\t\t\t\t\tsubscription._id,\n\t\t\t\t\toptions.defaultLanguage,\n\t\t\t\t);\n\t\t\t\tif (updateAutoTranslateLanguageResponse.modifiedCount) {\n\t\t\t\t\tshouldNotifySubscriptionChanged = true;\n\t\t\t\t}\n\t\t\t}","sourceCodeStart":26,"sourceCodeEnd":62,"githubUrl":"https://github.com/RocketChat/Rocket.Chat/blob/b2c16d5842cbe6b69b59bdf6fc5e5f1afcd1f0b0/apps/meteor/server/lib/autotranslate/functions/saveSettings.ts#L26-L62","documentation":"Rocket.Chat refuses to enable auto-translation (field 'autoTranslate', value '1') in end-to-end encrypted rooms: Rooms.findE2ERoomById matches the rid, and translating would require the server to read ciphertext it cannot decrypt. error-e2e-enabled is a by-design restriction, not a malfunction.","triggerScenarios":"Toggling 'Translate' on inside an E2E encrypted channel/group via room settings; REST call with field 'autoTranslate' and value true/'true' (the REST wrapper coerces to '1') for an encrypted rid.","commonSituations":"Users in E2EE rooms expecting translation to work; clients not hiding the toggle based on the room's encrypted flag; the default-language fallback also blocked for encrypted rooms.","solutions":["Keep auto-translation off in E2E rooms - the server cannot translate encrypted content","Hide the translate option in the UI when the room is encrypted (room.encrypted / e2e key present)","If translation matters more than E2EE, use a non-encrypted room"],"exampleFix":"// before\nawait POST '/api/v1/autotranslate.saveSettings' { roomId, field: 'autoTranslate', value: '1' };\n\n// after\nconst room = await GET '/api/v1/rooms.info' { roomId };\nif (!room.encrypted) {\n  await POST '/api/v1/autotranslate.saveSettings' { roomId, field: 'autoTranslate', value: '1' };\n}","handlingStrategy":"validation","validationCode":"const { room } = await GET '/api/v1/rooms.info' { roomId };\nif (room.encrypted && wantEnable) {\n  // cannot enable auto-translation in E2E rooms - skip the call\n}","typeGuard":"const isE2ERoom = (room: { encrypted?: boolean; e2eKeyId?: string }): boolean =>\n  Boolean(room.encrypted ?? room.e2eKeyId);","tryCatchPattern":"try {\n  await POST '/api/v1/autotranslate.saveSettings' { roomId, field: 'autoTranslate', value: '1' };\n} catch (e) {\n  if (e.error === 'error-e2e-enabled') {\n    // by design: hide the toggle for encrypted rooms\n  } else {\n    throw e;\n  }\n}","preventionTips":["Hide the translate toggle whenever the room's encrypted flag is set","Never attempt to work around it - the server cannot decrypt E2E content","Test translate flows separately for encrypted and plain rooms"],"tags":["rocket-chat","autotranslate","e2ee","encryption","rooms"],"backgroundTag":"e2ee-encryption-conflict","analyzedSha":"b2c16d5842cbe6b69b59bdf6fc5e5f1afcd1f0b0","analyzedAt":"2026-08-18T15:26:39.429Z","schemaVersion":2},"datasetVersion":"2026-08-21T13:17:26.733Z"}