Agents Authorization Failing on Save: "error: Trouble updating the Agent Action Invalid key length" #5998
-
What happened?I cannot save Authorization headers for Agent Actions. The server logs reveal that there is an "Invalid key length". Tried different lengths from 4 to 128 chars and different format. See below. Version Information0.7.7-rc1 on Railway Steps to ReproduceSteps
InputTried all possible header information, long and short, different formats, e.g.
What browsers are you seeing the problem on?Firefox Relevant log outputsee screenshot ScreenshotsCode of Conduct
|
Beta Was this translation helpful? Give feedback.
Replies: 3 comments
-
Hi @maxbraeutigam, this can't be reproduced. A 500 Status error could be the client losing connection to the server, the server logs would actually be helpful in this case to help you troubleshoot in any case. Log locations:
There are two types of logs that can help diagnose the issue:
Error logs contain exact stack traces and are especially helpful, but both can provide valuable information. Please only include the relevant portions of logs that correspond to when you reproduced the error. |
Beta Was this translation helpful? Give feedback.
-
Hi @danny-avila – sorry for the late reply. Since I am deploying on railway, I didn’t know how to see the logs until they recently released the ssh feature to their cli. Now, here are the log entries. /app/api/logs/debug-2025-04-02.log
/app/api/logs/error-2025-04-02.log {
"level": "error",
"message": "Trouble updating the Agent Action Invalid key length",
"stack": "DataError: Invalid key length\n at validateKeyLength (node:internal/crypto/aes:77:11)\n at Object.aesImportKey (node:internal/crypto/aes:271:7)\n at SubtleCrypto.importKey (node:internal/crypto/webcrypto:645:10)\n at encryptV2 (/app/api/server/utils/crypto.js:44:44)\n at encryptSensitiveValue (/app/api/server/services/ActionService.js:328:16)\n at encryptMetadata (/app/api/server/services/ActionService.js:353:41)\n at /app/api/server/routes/agents/actions.js:54:26\n at Layer.handle [as handle_request] (/app/node_modules/express/lib/router/layer.js:95:5)\n at next (/app/node_modules/express/lib/router/route.js:149:13)\n at Route.dispatch (/app/node_modules/express/lib/router/route.js:119:3)"
}
|
Beta Was this translation helpful? Give feedback.
-
Now, I found my error. I was creating CREDS_KEY and CREDS_IV on my own, but the encryption needs a Buffer of a specific length and thus, not every string of the given length can be converted into a Buffer of the correct size. Just used the generator and everything is fine. Sorry for wasting your time. |
Beta Was this translation helpful? Give feedback.
Now, I found my error. I was creating CREDS_KEY and CREDS_IV on my own, but the encryption needs a Buffer of a specific length and thus, not every string of the given length can be converted into a Buffer of the correct size. Just used the generator and everything is fine. Sorry for wasting your time.
https://www.librechat.ai/toolkit/creds_generator