RocketChat/Rocket.Chat · error · Meteor.Error
error-e2e-enabled
error-e2e-enabled
Error message
Enabling auto-translation in E2E encrypted rooms is not allowed
What it means
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.
Source
Thrown at apps/meteor/server/lib/autotranslate/functions/saveSettings.ts:44
throw new Meteor.Error('error-invalid-settings', 'Invalid settings field', {
method: 'saveAutoTranslateSettings',
});
}
const subscription = await Subscriptions.findOneByRoomIdAndUserId(rid, userId);
if (!subscription) {
throw new Meteor.Error('error-invalid-subscription', 'Invalid subscription', {
method: 'saveAutoTranslateSettings',
});
}
let shouldNotifySubscriptionChanged = false;
switch (field) {
case 'autoTranslate':
const room = await Rooms.findE2ERoomById(rid, { projection: { _id: 1 } });
if (room && value === '1') {
throw new Meteor.Error('error-e2e-enabled', 'Enabling auto-translation in E2E encrypted rooms is not allowed', {
method: 'saveAutoTranslateSettings',
});
}
const updateAutoTranslateResponse = await Subscriptions.updateAutoTranslateById(subscription._id, value === '1');
if (updateAutoTranslateResponse.modifiedCount) {
shouldNotifySubscriptionChanged = true;
}
if (!subscription.autoTranslateLanguage && options.defaultLanguage) {
const updateAutoTranslateLanguageResponse = await Subscriptions.updateAutoTranslateLanguageById(
subscription._id,
options.defaultLanguage,
);
if (updateAutoTranslateLanguageResponse.modifiedCount) {
shouldNotifySubscriptionChanged = true;
}
}View on GitHub (pinned to b2c16d5842)
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
Example fix
// before
await POST '/api/v1/autotranslate.saveSettings' { roomId, field: 'autoTranslate', value: '1' };
// after
const room = await GET '/api/v1/rooms.info' { roomId };
if (!room.encrypted) {
await POST '/api/v1/autotranslate.saveSettings' { roomId, field: 'autoTranslate', value: '1' };
} Defensive patterns
Strategy: validation
Validate before calling
const { room } = await GET '/api/v1/rooms.info' { roomId };
if (room.encrypted && wantEnable) {
// cannot enable auto-translation in E2E rooms - skip the call
} Type guard
const isE2ERoom = (room: { encrypted?: boolean; e2eKeyId?: string }): boolean =>
Boolean(room.encrypted ?? room.e2eKeyId); Try / catch
try {
await POST '/api/v1/autotranslate.saveSettings' { roomId, field: 'autoTranslate', value: '1' };
} catch (e) {
if (e.error === 'error-e2e-enabled') {
// by design: hide the toggle for encrypted rooms
} else {
throw e;
}
} Prevention
- 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
When it happens
Trigger: 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.
Common situations: 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.
Related errors
- error-invalid-subscription
- Failed to persist keys as they are not strings.
- Failed to encode private key with provided password.
- error-autotranslate-disabled
- error-action-not-allowed
AI-assisted analysis of RocketChat/Rocket.Chat@b2c16d5842 (2026-08-18).
Data as JSON: /api/errors/1e6178bfaf87482e.
Report an issue: GitHub.