Skip to content
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

[BUG] - Cannot use server actions at all within a proxied Docker environment due to Nextjs 14 upgrade #1594

Closed
1 of 2 tasks
therecluse26 opened this issue Nov 8, 2023 · 6 comments · Fixed by #1621
Closed
1 of 2 tasks
Labels
bug Something isn't working

Comments

@therecluse26
Copy link
Contributor

Issue Summary

This PR caused a regression that completely broke my ability to use the app in a dockerized production environment

I was able to get the app back up and running properly by reverting back to version 1.1.2 which is the last one before the Nextjs 14 upgrade

More info

Steps to Reproduce

  1. Installed the app's Docker container in a production environment behind Cloudflare (I believe this would also happen behind a typical reverse proxy setup)
  2. Successfully created an account
  3. Got stuck at onboarding step
  4. Examined logs and found the error --- x-forwarded-host and host headers do not match origin header from a forwarded Server Actions request. Aborting the action.

Expected behavior

App works normally and user doesn't get stuck at onboarding due to broken Server Actions.

Other information

This appears to be due to the Next 14 upgrade, and there appear to be some fixes coming soon in Nextjs, that will likely need to be integrated into this app.

Screenshots

No response

Environment

  • Formbricks Cloud (app.formbricks.com)
  • Self-hosted Formbricks

Desktop (please complete the following information)

Running on ControlPlane, a k8s-based hosting platform
@therecluse26 therecluse26 added the bug Something isn't working label Nov 8, 2023
Copy link
Contributor

github-actions bot commented Nov 8, 2023

Thank you for opening your first issue! 🙏❤️ One of our team members will review it and get back to you as soon as it possible. 😊

@mattinannt
Copy link
Member

@therecluse26 Do you remember which release you had reverting back to Formbricks 1.1.2?
We also reverted back from Next.js 14 in Formbricks after we faced problems with one integration; meaning that the latest Formbricks release 1.2.2 is also on Next.js 13.5.6.
Can you maybe try if the latest Formbricks release works for you and then we can investigate how we can reproduce and solve the issue when we upgrade to Next.js 14.

@therecluse26
Copy link
Contributor Author

therecluse26 commented Nov 8, 2023

@mattinannt Interesting. I was initially using the latest tag, but then rolled back to 1.1.2. I just set up a separate deployment for testing using the 1.2.2 tag explicitly and the original problem has returned, I can't get past the onboarding stage because of the same original error: "x-forwarded-host and host headers do not match origin header from a forwarded Server Actions request. Aborting the action."

@mattinannt
Copy link
Member

@therecluse26 Ok, so it seems to be a general problem. Do you have an idea, how to solve this?
ChatGPT also suggests to recheck your reverse proxy:

"Ensure that the reverse proxy is correctly configured to pass the necessary headers to the Next.js application.
In some cases, you may need to explicitly set or rewrite headers in the proxy configuration to ensure consistency."

@therecluse26
Copy link
Contributor Author

therecluse26 commented Nov 14, 2023

@mattinannt to me, the fact that rolling back to a previous version of Formbricks fixed the problem would indicate an issue somewhere in the application stack. It's odd that it doesn't seem to necessarily be Next 14 related, despite the above linked NextJs issue, but I'm wondering if there's another dependency starting in the 1.2.2 release that might be causing it.

@therecluse26
Copy link
Contributor Author

The issue persists in 1.3.0

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants