-
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
"An unexpected error has occurred" on replicated server #3299
Comments
Turns out I needed to also override |
@sethsamuel , I met the same issue here. But What to do when process a rolling update. The new pods and old pods have different BUILD_IDS. |
Without sticky requests I think it's impossible to avoid 500s during a rolling update. It would help if next fell back to server side rendering on mismatched build ids, rather than 500ing, but not sure how hard that would be to implement. |
The only way I found is use CDN to cache static files. CDN service like cloudflare knows how to handle two version of the same file.This approach is not perfect, but can reduce many 500 errors. |
Expected Behavior
I should be able to run a nextjs app on multiple server replicas without errors occurring.
Current Behavior
Trying to run next 4.1.4 in a kubernetes cluster and about half of the requests to the server result in "An unexpected error has occurred." If the request is made client-side, the only error in the console is
500 - Internal Server Error. undefined
. There is no server log with more error details.This does not appear to be happening with a 3.x app run in a similar context.
Steps to Reproduce (for bugs)
Context
I've already implemented the build-stats hack here #2978 (comment) to have consistent build ids across the replicas. That resolved that set of errors but now stuck with undebuggable errors.
ETA: This appears to still be build id related. The error that's thrown has
buildIdMismatched: true
even through both replicas have identical.next/build-stats.json
files.Your Environment
The text was updated successfully, but these errors were encountered: