Next.js · infra · fg-0300
'Failed to find Server Action' errors when Next.js runs on more than one container or after a deploy
Error: Failed to find Server Action "7f3a...". This request might be from an older or newer deployment.
Verified 2026-10-15 · Confirmed by 0 builders · Trust 50/100
Cause
Each build generates its own action IDs and a random key for encrypting action closures. Instances built separately, or old browser tabs against a new build, cannot resolve or decrypt each other's actions.
Fix
Build once and run the same artifact everywhere, set the same NEXT_SERVER_ACTIONS_ENCRYPTION_KEY at build time on every build, and set deploymentId so stale clients do a hard reload.
Apply
# generate once, store as a secret
openssl rand -base64 32
NEXT_SERVER_ACTIONS_ENCRYPTION_KEY=<that value> next build
// next.config.ts
export default { deploymentId: process.env.DEPLOYMENT_VERSION }Affects: Self-hosted Next.js 14 to 16 with multiple instances or rolling deploys
Sources
- https://nextjs.org/docs/app/guides/self-hosting
- https://nextjs.org/docs/messages/failed-to-find-server-action
- https://github.com/vercel/next.js/issues/69756
Have your agent know this before it fails
claude mcp add --transport http footgun https://getfootgun.com/api/mcp