[Error: Failed to find Server Action "{ID}"
Answered
Eulophid wasp posted this in #help-forum
Eulophid waspOP
How can I fix this in production - it works fine in staging but is failing in production. It gives me a server action ID but I don't know how to match it.
The help page linked ([link](https://nextjs.org/docs/messages/failed-to-find-server-action)) is a little vague.
Any help appreciated!
The help page linked ([link](https://nextjs.org/docs/messages/failed-to-find-server-action)) is a little vague.
Any help appreciated!
Answered by Eulophid wasp
The guidance says I can add a
It's just a string right? or am I meant to encrypt a specific key?
NEXT_SERVER_ACTIONS_ENCRYPTION_KEY
which is cool but I don't really understand the "This variable must be AES-GCM encrypted" part?It's just a string right? or am I meant to encrypt a specific key?
17 Replies
Asian black bear
Are you scaling your application to multiple instances or is it just a single instance? How are you hosting?
Eulophid waspOP
Hi @Asian black bear - I'm on Vercel as a basic (hobby) plan.
Asian black bear
Which version of Next.js are you using?
Eulophid waspOP
"next": "^15.3.2"
A full build works locally (and as I stay dev is fine) but this error is filling my logs.
Asian black bear
You should maybe test one or two prior patch versions to see if it's a regression. Sadly, I can't help you otherwise, the possible causes I was familiar with are not really relevant in your case.
Eulophid waspOP
So try a different Next version? OK, I can do that I think 🙂
Thanks for your help!
Eulophid waspOP
ugh, that hasn't helped - thanks though!
Any ideas how I can debug - I don't have much to go on.
Any ideas how I can debug - I don't have much to go on.
Dutch
can you share that error you see
Eulophid waspOP
OK, after 24 hours those errors have now stopped.
This was the error:
This was the error:
[Error: Failed to find Server Action "004855739b175147fe491e0ebc084243712e0b6fa5". This request might be from an older or newer deployment.
Read more: https://nextjs.org/docs/messages/failed-to-find-server-action]
Eulophid waspOP
The guidance says I can add a
It's just a string right? or am I meant to encrypt a specific key?
NEXT_SERVER_ACTIONS_ENCRYPTION_KEY
which is cool but I don't really understand the "This variable must be AES-GCM encrypted" part?It's just a string right? or am I meant to encrypt a specific key?
Answer
since you use vercel you can just use skew protection https://nextjs.org/docs/messages/failed-to-find-server-action#:~:text=If%20you%20are%20deploying%20your%20Next.js%20application%20to%20Vercel%2C%20you%20can%20use%20the%20feature%20Skew%20Protection%20to%20ensure%20assets%20and%20functions%20from%20the%20previous%20version%20are%20still%20available%2C%20even%20after%20a%20new%20version%20is%20deployed.
Eulophid waspOP
Thanks @joulev but we're not currently on a Pro plan so can't enable skew protection.
although i suggest you read this thread in its entirety https://github.com/vercel/next.js/issues/75541
Eulophid waspOP
Thanks - that's really useful 🙂