Replies: 16 comments 27 replies
|
Also. the action name is "x" not a random id like other issues. and I can't replicate this in dev envrionment or manually triggering action on production. This just happens randomly at some point. I am self hosting on a vps with docker |
|
Yep, just got this as well. Application went down with timeouts (no crash, just infinite loading) accompanied by a spam of that log. Running on 15.1.9. Here's our full log: |
|
https://nextjs.org/docs/messages/failed-to-find-server-action works for next 16.1.1 |
|
The same issue occurs in version 14.2.35. The server doesn't crash, but CPU usage spikes to 100%. |
|
If you're getting spammed with this error message on an app that is accessible externally, it's likely attackers looking for app deployments that are still vulnerable to the recent For OP, I'm not sure about the "original error" part, or why your server subsequently crashes - did you upgrade to a safe version of next? |
|
I have been getting these error logs in production as well. The confusing part is that I'm not using server actions at all in my codebase. I've already reviewed the documentation here: https://nextjs.org/docs/messages/failed-to-find-server-action, but I can't wrap my head around why I'm seeing this error. |
|
any solution for this? Error: Failed to find Server Action "x". This request might be from an older or newer deployment. |
|
Same here This happening only in prod (coolify), i guess. |
|
Been having this error for the past month as well. Recently massively increased, I assume from attackers trying to test react2shell exploit. Still, extremely annoying to not have a way of dealing with this error. At the very least I wish they would change it to a warning, which it seems to have previously been. |
|
Maybe it's not a discussion anymore but really an issue? I think so! |
|
Same issue here. Next 14.2.20". The server doesn't crash but creates noisy logs "Error: Failed to find Server Action "x". This request might be from an older or newer deployment. Original error: Cannot read properties of undefined (reading 'workers')". Server CleverCloud. |
|
Having the same issue with Next 15.0.7 deployed with Azure Web App Service, and I don't even use Server Actions or any API routes except a healthcheck route that always returns an OK response. This log shows up constantly when viewing the log stream on Azure, but the website works normally. Seems like it's just attackers trying to spam the react2shell exploit. Would be nice if there is a way to just ignore these logs. |
|
Is there a solution to this? Our app is now broken in production (running in a normal docker multi-replica cluster). It is serving wrong data too. I noticed that components no longer get cached on the remote redis cache we use , only functions are cached. It places components (pages and layouts) on disk, in the @icyJoseph Could you please chime in, this is a bit of a crisis for us. Thank you very much for the help! PS: I did follow this https://nextjs.org/docs/messages/failed-to-find-server-action , so that env is in the containers. |
|
We are getting thousands of these log messages on our severs each day, @icyJoseph . They are clogging up the servers, making debugging difficult and eventually leading to crashes. Could you please let us know if it is OK and safe to block all requests where Next-Action header value is "x", or is shorter than for instance 10 characters (since the server actions should be long-form hashes)? UPDATE: FIX As noted above, we noticed bots probing our Next.js app by sending POST requests with short or garbage next-action header values, like These hit the server, get processed by Next.js, and return errors, wasting resources and polluting logs. The below fix seems to work so far. The fix has two layers:
In case useful to others, below is a summary. Layer 1: Cloud Firewall The cloud firewall only exposes HTTP/HTTPS on the reverse proxy, as such the application servers are not directly reachable from the internet. The application servers expose their app port (e.g. 3000) only on the private network. Layer 2: Reverse Proxy: Block Malformed Server Actions Valid Next.js server action IDs are hash-based (40+ hex characters). Bot probes are almost always very short strings. Thus, we block them at the reverse proxy before they reach the app. Caddy example: This rule:
Result
So far so good, let's see how it plays out. |
|
Based on the thread, there are two separate causes for this error — it helps to identify which one you're hitting: Cause 1: Bots probing for the
|
| Error shows | Cause | Fix |
|---|---|---|
"x", "test", short strings |
Bot probing react2shell | Block at reverse proxy |
| Long hex hashes, multiple containers | Mismatched encryption keys | Set NEXT_SERVER_ACTIONS_ENCRYPTION_KEY at build + runtime |
| Random, affects all actions | Key set only at runtime | Re-set key at build time too |
Uh oh!
There was an error while loading. Please reload this page.
Summary
in production I keep getting
"[Error: Failed to find Server Action "x". This request might be from an older or newer deployment. Original error: Cannot read properties of undefined (reading 'workers')]"
which then completely destorys backend of the app then users can't even login or logout or perform any other actions.
when i rebuild the project and it passes the ci/cd and deploys it for some time works without problems then in couple of hors this happens randomly. I haven't been able to find anything related to this as well. anyone have any idea how to solve this?
Additional information
Example
No response
All reactions