formbricks icon indicating copy to clipboard operation
formbricks copied to clipboard

[BUG] CORS Failed

Open kmohsenk opened this issue 1 year ago • 9 comments

Issue Summary

I installed Formbricks Docker from your documents and can access the login page and create a survey. But when I tried to fill out the survey it showed me the following:

Your feedback is stuck :( The servers cannot be reached at the moment. Please retry now or try again later.

I checked the Network of the browser that mentioned: "COR Failed".

My docker logs:

WARN[0000] /root/formbricks-quickstart/docker-compose.yml: the attribute version is obsolete, it will be ignored, please remove it to avoid potential confusion postgres-1 | postgres-1 | PostgreSQL Database directory appears to contain a database; Skipping initialization postgres-1 | postgres-1 | 2024-09-21 12:57:39.953 UTC [1] LOG: starting PostgreSQL 15.8 on x86_64-pc-linux-musl, compiled by gcc (Alpine 13.2.1_git20240309) 13.2.1 20240309, 64-bit postgres-1 | 2024-09-21 12:57:39.954 UTC [1] LOG: listening on IPv4 address "0.0.0.0", port 5432 postgres-1 | 2024-09-21 12:57:39.954 UTC [1] LOG: listening on IPv6 address "::", port 5432 postgres-1 | 2024-09-21 12:57:39.966 UTC [1] LOG: listening on Unix socket "/var/run/postgresql/.s.PGSQL.5432" postgres-1 | 2024-09-21 12:57:39.983 UTC [29] LOG: database system was shut down at 2024-09-21 12:57:29 UTC postgres-1 | 2024-09-21 12:57:40.014 UTC [1] LOG: database system is ready to accept connections postgres-1 | 2024-09-21 12:57:43.882 UTC [33] LOG: could not receive data from client: Connection reset by peer formbricks-1 | formbricks-1 | > @formbricks/[email protected] db:migrate:deploy formbricks-1 | > env DATABASE_URL="${MIGRATE_DATABASE_URL:-$DATABASE_URL}" prisma migrate deploy formbricks-1 | formbricks-1 | Prisma schema loaded from schema.prisma formbricks-1 | Datasource "db": PostgreSQL database "formbricks", schema "public" at "postgres:5432" formbricks-1 | formbricks-1 | 92 migrations found in prisma/migrations formbricks-1 | formbricks-1 | formbricks-1 | No pending migrations to apply. formbricks-1 | npm notice formbricks-1 | npm notice New patch version of npm available! 10.8.2 -> 10.8.3 formbricks-1 | npm notice Changelog: https://github.com/npm/cli/releases/tag/v10.8.3 formbricks-1 | npm notice To update run: npm install -g [email protected] formbricks-1 | npm notice formbricks-1 | ▲ Next.js 14.2.5 formbricks-1 | - Local: http://localhost:3000 formbricks-1 | - Network: http://0.0.0.0:3000 formbricks-1 | formbricks-1 | ✓ Starting... formbricks-1 | ✓ Ready in 182ms formbricks-1 | Falling back to LRU handler because Redis client is not available. postgres-1 | 2024-09-21 13:02:40.039 UTC [27] LOG: checkpoint starting: time postgres-1 | 2024-09-21 13:02:40.083 UTC [27] LOG: checkpoint complete: wrote 3 buffers (0.0%); 0 WAL file(s) added, 0 removed, 0 recycled; write=0.007 s, sync=0.018 s, total=0.045 s; sync files=2, longest=0.017 s, average=0.009 s; distance=0 kB, estimate=0 kB

I tried several times and install docker aging but result is the same.

Steps to Reproduce

  1. install Docker-compose
  2. create a survey
  3. try to fill

Expected behavior

Apply the Survey

Other information

No response

Screenshots

No response

Environment

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

Desktop (please complete the following information)

- OS Server: ubuntu 22.04
- Node: official Formbricks Docker
- npm: official Formbricks Docker

kmohsenk avatar Sep 21 '24 13:09 kmohsenk

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. 😊

github-actions[bot] avatar Sep 21 '24 13:09 github-actions[bot]

@kmohsenk Do you have more information about the CORS failed error from the network tab? Do you see more details there?

There seems to be an issue that the frontend cannot send the response to the backend correctly. Is the WEBAPP_URL environment variable set correctly and can the server be accessed by the browser or is there any firewall rule that might be an issue here?

mattinannt avatar Sep 21 '24 13:09 mattinannt

@kmohsenk Do you have more information about the CORS failed error from the network tab? Do you see more details there?

There seems to be an issue that the frontend cannot send the response to the backend correctly. Is the WEBAPP_URL environment variable set correctly and can the server be accessed by the browser or is there any firewall rule that might be an issue here?

yes. I change the WEBAPP_URL and NEXTAUTH_URL after installing the docker and rerunning docker:

WEBAPP_URL: "http://192.168.1.246"

# Required for next-auth. Should be the same as WEBAPP_URL
NEXTAUTH_URL: "http://192.168.1.246"

I attached the image of the console. image

and this is the consol tab: image

kmohsenk avatar Sep 22 '24 05:09 kmohsenk

/assign

vivek-gorantla2005 avatar Oct 11 '24 00:10 vivek-gorantla2005

/assign

pratik123-coder avatar Oct 11 '24 03:10 pratik123-coder

/assign

shindebhavika avatar Oct 11 '24 06:10 shindebhavika

/assign

devlpr-nitish avatar Oct 11 '24 11:10 devlpr-nitish

/assign

I03Ishika avatar Oct 21 '24 07:10 I03Ishika

This issue is not part of oss.gg hackathon. Please pick a different one or start with a side quest

oss-gg[bot] avatar Oct 21 '24 07:10 oss-gg[bot]

@kmohsenk sorry for not getting back on this. Were you able to find the cause of the issue?

mattinannt avatar Nov 11 '24 06:11 mattinannt