RocketChat / RocketChat/Rocket.Chat

DeepL AutoTranslate not working after upgrade to 8.5.1

Open Beginner friendly
#41,100 1 comment 2 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

type: bug
Dominant language
TypeScript
Stars
46.1k
Forks
13.9k
Avg merge
3d 3h
Merged PRs (30d)
130

Description

Description:

After upgrading to Rocket.Chat 8.5.1, DeepL AutoTranslate stopped working. Messages in channels with auto-translate enabled are not being translated.

Server logs show the following error when messages are received in a channel with auto-translate enabled:

{"level":50,"name":"System","msg":"Error translating message attachment","err":{"type":"Error","message":"Forbidden","stack":"Error: Forbidden\n at DeeplAutoTranslate._translateAttachmentDescriptions (app/autotranslate/server/deeplTranslate.ts:203:12)\n at processTicksAndRejections (node:internal/process/task_queues:103:5)\n at Immediate. (app/autotranslate/server/autotranslate.ts:327:28)"}}

Possible root cause (hypothesis): The bundled code shows that _translateMessage and _translateAttachmentDescriptions use different DeepL authentication methods. _translateMessage uses the current format (Authorization: DeepL-Auth-Key header), while _translateAttachmentDescriptions uses the deprecated format (auth_key as a query parameter with no Authorization header). DeepL no longer accepts the auth_key query parameter and returns HTTP 403 Forbidden for such requests. It is possible this inconsistency affects the overall translation flow.

This can be verified independently:

# Returns 403 — old format used by _translateAttachmentDescriptions
curl -X POST "https://api.deepl.com/v2/translate?auth_key=YOUR_KEY" -d "text=Hello&target_lang=EN"

# Returns 200 — new format used by _translateMessage
curl -X POST "https://api.deepl.com/v2/translate" \
  -H "Authorization: DeepL-Auth-Key YOUR_KEY" \
  -d "text=Hello&target_lang=EN"

Steps to reproduce:

1. Go to Admin → Settings → Message → Auto Translate
2. Enable Auto Translate, select DeepL as provider, enter a valid DeepL API key
3. Enable auto-translate in any channel
4. Post or receive a message in that channel

Expected behavior:

Messages are automatically translated for users who have auto-translate enabled in that channel.

Actual behavior:

Messages are not translated. Server logs show Error: Forbidden originating fromions in deeplTranslate.ts.

Server Setup Information:

- Version of Rocket.Chat Server: 8.5.1
- License Type: Community
- Number of Users: ~50
- Operating System: Linux (Ubuntu 24.04)
- Deployment Method: docker
- Number of Running Instances: 1
- DB Replicaset Oplog: Yes
- NodeJS Version: (bundled in container)
- MongoDB Version: 8.2

Contributor guide

Open the contributing guide

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Start in app/autotranslate/server/deeplTranslate.ts, comparing _translateMessage with _translateAttachmentDescriptions and the logged call path from autotranslate.ts. Reproduce the DeepL requests with the curl examples and verify the attachment-description translation path uses accepted authentication. Done means messages and attachment descriptions translate without the 403 Forbidden error.

Written by the indexing model from the issue text.

Assessment

Tech stack
typescript
Domain
internationalization
Issue type
Bug
Difficulty
2/5
Estimated time
1-3 hours
Activity status
Quiet
Clarity
Clearly specified
Newbie friendliness
74/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.