-
Notifications
You must be signed in to change notification settings - Fork 27k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Error: Failed to find Server Action "84c...c2". This request might be from an older or newer deployment. Original error: Cannot read properties of undefined (reading 'workers') #70229
Comments
@72L Thank you for submitting an issue! Will be flagging this to the team again to take a look. |
Currently running into the same issue, tried a few things but still occurs periodically in our self hosted docker nextjs server on ec2 with kubernetes. |
same issue. hosting on vercel. my users often have app opened for a long time in browser. after deploys they get this error and it is super inconvenient. running next-15-rc2. |
here's an example. I really am baffled on what to do now...
|
For the moment, I am no longer using server actions. I'm just using fetch on client side to api route handlers. |
Can it be related to https://nextjs.org/blog/next-15-rc2#enhanced-security-for-server-actions ?
I started having problems after I updated to some canary version. I also found this: https://nextjs.org/blog/security-nextjs-server-components-actions#closures
So I guess if I set NEXT_SERVER_ACTIONS_ENCRYPTION_KEY to something stable, it might help |
Also, this: https://vercel.com/blog/version-skew-protection |
I've added Encryption_key and enabled skew protection, but still get these errors (on most important route!):
|
For now, I moved away from using server action in this particular case, which is a bummer. Since for me it is a recording of long-form audio in browser, I cannot afford to lose it due to "cannot find server action". And it happened all the time. I've tried various things, but my expertise are not enough to figure it out. Really waiting for someone from the team to maybe point in right direction. |
@huozhi sorry for ping, but maybe you can shed a little light? |
Verified the reproduction is working well in local and deployment on vercel, if it's not working on heroku it's likely a platform issue that not owned by Next.js. If you're seeing any issue with vercel deployment, please file a new issue with reproduction, thanks |
I DO have issue with vercel deployment in every canary version since at least 171. however, it's hard to reproduce since it seems to be related to long-time use cases.
For now, I've opted out of server actions in this use case, and I couldn't find workaround. Not sure how reproduction can be provided, since it takes hours and production setup to actually have that. We have 1000+ users and only a subset get this error, but a substantial subset: dozens of issues per day. Isn't that something that might be very important? I mean, if server actions security mechanism is not stable in long-running sessions (and there are lots of cases when apps are constantly open without reloading for days), that is important, no? As I said before, enabling skew protection and setting encryption key did not have effect. I am ready to collaborate on experiments, and even test out in production with our users and give access to our logs and so on. |
We have similar reports here: #69756 (comment), talking about canary builds of 15.0.0, and only in prod. I had this error on 15.0.1 stable as well. Sadly, it business-critical and we cannot allow to continue experiments on our users. But I really would like to be able to make sure everything works. |
I’m also becoming worried that version skew is causing “server action not found” errors in production because of the recently introduced “randomized/unguessable” server action IDs it seems like creating new deployments is causing an uptick in users encountering this issue, which leads me to believe that maybe the IDs changing between builds are to blame, as users who loaded a previous deployment can no longer access server actions after a new deployment, because all of the action IDs have changed Under the “old” model where we created API routes with explicit names, this was never the case |
Running into the same issue. Happening between deployments (self hosted). Is there a way to use "Next 14 style" server Ids in Next 15? |
I've been able to reproduce this issue as well. It seems like new server action IDs are always generated when there is no build cache. You can verify it locally:
Especially with self-hosting this is problematic because the more frequently you deploy new releases the more likely your users will have trouble with server actions. Probably we could cache the In my opinion, there should be a configuration to opt-out of this ID rotation. Something like this: /** @type {import('next').NextConfig} */
module.exports = {
experimental: {
serverActions: {
encryptedActionIds: false, // default: true
},
},
} With the option set to |
Link to the code that reproduces this issue
https://github.com/72L/failed-to-find-server-action
To Reproduce
heroku git:remote -a [your-app]
andgit push heroku main
git push heroku main
Current vs. Expected behavior
I would expect the outcome of step 2 to be the same as the outcome of step 6.
Provide environment information
Operating System: Platform: darwin Arch: arm64 Version: Darwin Kernel Version 23.4.0: Fri Mar 15 00:12:41 PDT 2024; root:xnu-10063.101.17~1/RELEASE_ARM64_T8103 Available memory (MB): 16384 Available CPU cores: 8 Binaries: Node: 18.20.2 npm: 10.5.0 Yarn: 1.22.19 pnpm: 6.29.0 Relevant Packages: next: 14.2.12 // Latest available version is detected (14.2.12). eslint-config-next: 14.2.12 react: 18.3.1 react-dom: 18.3.1 typescript: 5.6.2 Next.js Config: output: N/A
Which area(s) are affected? (Select all that apply)
Not sure
Which stage(s) are affected? (Select all that apply)
Other (Deployed)
Additional context
It does work on Vercel, but not Heroku. I've tried some ideas from #58431 but none of them solved this issue.
The text was updated successfully, but these errors were encountered: