{"record":{"id":"2757833239d25baf","repo":"vercel/next.js","slug":"missing-encryption-key-for-server-actions","errorCode":null,"errorMessage":"Missing encryption key for Server Actions","messagePattern":"Missing encryption key for Server Actions","errorType":"exception","errorClass":"InvariantError","httpStatus":null,"severity":"error","filePath":"packages/next/src/server/app-render/encryption-utils.ts","lineNumber":79,"sourceCode":"    },\n    key,\n    data\n  )\n}\n\nexport async function getActionEncryptionKey() {\n  if (__next_loaded_action_key) {\n    return __next_loaded_action_key\n  }\n\n  const serverActionsManifest = getServerActionsManifest()\n\n  const rawKey =\n    process.env.NEXT_SERVER_ACTIONS_ENCRYPTION_KEY ||\n    serverActionsManifest.encryptionKey\n\n  if (rawKey === undefined) {\n    throw new InvariantError('Missing encryption key for Server Actions')\n  }\n\n  __next_loaded_action_key = await crypto.subtle.importKey(\n    'raw',\n    stringToUint8Array(atob(rawKey)),\n    'AES-GCM',\n    true,\n    ['encrypt', 'decrypt']\n  )\n\n  return __next_loaded_action_key\n}\n","sourceCodeStart":61,"sourceCodeEnd":92,"githubUrl":"https://github.com/vercel/next.js/blob/0eb377541648e63402a47b38fee00a8d0ce8f8f1/packages/next/src/server/app-render/encryption-utils.ts#L61-L92","documentation":"Invariant from getActionEncryptionKey: neither NEXT_SERVER_ACTIONS_ENCRYPTION_KEY nor an encryptionKey in the server actions manifest provided a key, yet Server Actions encryption/decryption was requested. It indicates an incomplete build or missing configuration for encrypted action payloads, not user code misuse.","triggerScenarios":"Server Actions encryption runs without an encryption key.","commonSituations":"Missing NEXT_SERVER_ACTIONS_ENCRYPTION_KEY or key generation failure when using Server Actions.","solutions":["Ensure the server action encryption key is generated at build time; do not strip process.env.NEXT_SERVER_ACTIONS_ENCRYPTION_KEY, and rebuild."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"0eb377541648e63402a47b38fee00a8d0ce8f8f1","analyzedAt":"2026-08-19T02:10:13.922Z","contentChangedAt":"2026-08-19T02:10:13.922Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}