You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Auto translation is broken for all providers (Microsoft, google, deepl) because the API key is not changing on the server when updated from admin panel.
The key is only read once on server startup.
Current workaround: After you set the key - restart the rocketchat.
Firstly I found the issue on v3.3.3. Still is present on v3.9.4.
Based on commits, I believe it is broken from 2.0 to latest
Steps to reproduce:
start a fresh rocketchat v3.9.4
enable auto-translate and add deepL key
as admin user (by default only admin is autotranslatable) take a livechat inquiry or start a chat with someone
receive a message and watch logs -> should have a error saying API key is missing
Expected behavior:
API key should change dynamically when we change it from admin panel.
Actual behavior:
API key does not change. Even if you set the key, you MUST restart the server for it to pick up.
Server Setup Information:
Judging that last commit in that area was 1y ago, all versions 2.0.0 onwards should be affected
Version of Rocket.Chat Server: 3.9.4.
Operating System: mac big sur 11.1 + docker
Deployment Method: docker
Number of Running Instances: 1
MongoDB Version: 4
Client Setup Information
Desktop App or Browser Version: Chrome Version 87.0.4280.88
Operating System: mac big sur 11.1
Additional context
I believe the issue is in this line. All other providers have the same behavior:
server.js:204 System ➔ error Error translating message Error: failed [403] { "error": { "code": 403, "message": "The request is missing a valid API key.", "errors": [ { "message": "The request is missing a valid API key.", "domain": "global", "reason": "forbidden" } ], "status": "PERMISSION_DENIED" } }
at Object.exports.makeErrorByStatus (packages/http.js:177:10)
at Request._callback (packages/http.js:141:24)
at Request.self.callback (/app/bundle/programs/server/npm/node_modules/meteor/http/node_modules/request/request.js:185:22)
at Request.emit (events.js:315:20)
at Request.EventEmitter.emit (domain.js:483:12)
at Request.<anonymous> (/app/bundle/programs/server/npm/node_modules/meteor/http/node_modules/request/request.js:1161:10)
at Request.emit (events.js:315:20)
at Request.EventEmitter.emit (domain.js:483:12)
at IncomingMessage.<anonymous> (/app/bundle/programs/server/npm/node_modules/meteor/http/node_modules/request/request.js:1083:12)
at Object.onceWrapper (events.js:421:28)
at IncomingMessage.emit (events.js:327:22)
at IncomingMessage.EventEmitter.emit (domain.js:483:12)
at endReadableNT (_stream_readable.js:1220:12)
at processTicksAndRejections (internal/process/task_queues.js:84:21) {
response: {
statusCode: 403,
content: '{\n' +
' "error": {\n' +
' "code": 403,\n' +
' "message": "The request is missing a valid API key.",\n' +
' "errors": [\n' +
' {\n' +
' "message": "The request is missing a valid API key.",\n' +
' "domain": "global",\n' +
' "reason": "forbidden"\n' +
' }\n' +
' ],\n' +
' "status": "PERMISSION_DENIED"\n' +
' }\n' +
'}\n',
headers: {
vary: 'X-Origin, Referer, Origin,Accept-Encoding',
'content-type': 'application/json; charset=UTF-8',
date: 'Mon, 04 Jan 2021 11:02:32 GMT',
server: 'ESF',
'cache-control': 'private',
'x-xss-protection': '0',
'x-frame-options': 'SAMEORIGIN',
'x-content-type-options': 'nosniff',
'alt-svc': 'h3-29=":443"; ma=2592000,h3-T051=":443"; ma=2592000,h3-Q050=":443"; ma=2592000,h3-Q046=":443"; ma=2592000,h3-Q043=":443"; ma=2592000,quic=":443"; ma=2592000; v="46,43"',
'accept-ranges': 'none',
connection: 'close',
'transfer-encoding': 'chunked'
},
data: { error: [Object] }
}
}
The text was updated successfully, but these errors were encountered:
eugeniumegherea
changed the title
Auto translate keys not changed dynamically, only read once on server start
Auto translate broken. API keys not changed on save, only read once on server start
Jan 4, 2021
Description:
Auto translation is broken for all providers (Microsoft, google, deepl) because the API key is not changing on the server when updated from admin panel.
The key is only read once on server startup.
Current workaround: After you set the key - restart the rocketchat.
Firstly I found the issue on v3.3.3. Still is present on v3.9.4.
Based on commits, I believe it is broken from 2.0 to latest
Steps to reproduce:
Expected behavior:
API key should change dynamically when we change it from admin panel.
Actual behavior:
API key does not change. Even if you set the key, you MUST restart the server for it to pick up.
Server Setup Information:
Judging that last commit in that area was 1y ago, all versions 2.0.0 onwards should be affected
Client Setup Information
Additional context
I believe the issue is in this line. All other providers have the same behavior:
Rocket.Chat/app/autotranslate/server/deeplTranslate.js
Lines 26 to 34 in 729e258
Relevant logs:
The text was updated successfully, but these errors were encountered: