-
-
Notifications
You must be signed in to change notification settings - Fork 3.3k
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]: CORS header 'Access-Control-Allow-Origin' missing #1280
Comments
🤖 Hello, The "CORS header 'Access-Control-Allow-Origin' missing" error you're encountering is likely due to the origin 'http://somehost:3000' not being included in the list of allowed origins in the CORS middleware configuration of Quivr. To resolve this issue, you need to add 'http://somehost:3000' to the list of allowed origins in your cors.py file. Here's how you can do it: from fastapi.middleware.cors import CORSMiddleware
origins = [
"http://localhost",
"http://localhost:3000",
"http://localhost:3001",
"https://quivr.app",
"https://www.quivr.app",
"http://quivr.app",
"http://www.quivr.app",
"http://somehost:3000", # Add this line
"*",
]
def add_cors_middleware(app):
app.add_middleware(
CORSMiddleware,
allow_origins=origins,
allow_credentials=True,
allow_methods=["*"],
allow_headers=["*"],
) After making this change, your application should allow requests from 'http://somehost:3000', and you should no longer see the CORS error. This solution is based on the current CORS middleware configuration in the Quivr codebase, which allows requests from the following origins:
It also allows all methods and headers, and credentials are allowed as well. Please let me know if this resolves your issue or if you need further assistance. Best regards. Sources
This response is meant to be useful and save you time. It is not meant to be a precise solution, but rather a starting point for your own research. Help me be more useful! Please leave a 👍 if this is helpful and 👎 if it is irrelevant. If you want to continue the conversation, start your reply with @dosu-bot. |
I did it, but I still got "9530-bd297a4f57801ca6.js:1 |
Struggling with the same issue.
|
I got the same issue too, and I already set the web domain in |
Yeah same here i'm not sure the cors.py is taken into consideration |
For reference, first encountered this issue using 0.0.81 #fa3412b7 on OSX 13.5.1. v0.0.81 introduced CORS issues and failure to retrieve chat responses/brains config data. v0.0.82 is the same but with excessive backend API calls and rapid UI refreshes in Brains config screens. Same issues are observed in HEAD (> v0.0.88, #f13f08c5). Have not tested tagged releases between 0.0.82 and 0.0.88 but assuming issue persists through them. |
Checkout the |
Possibly but I also found that 0.0.81 introduced a backend error caused by the last_update property of the BrainEntity not being set.
I edited So, it seems like backend errors in code are also triggering the CORS errors. As a side note I noticed other errors in the backend log after doing this so I wouldn't recommend it as a fix. |
I can confirm this. Had backend errors with file uploads and CORS issue appeared again. |
Hi here 👋🏽, Are you still facing this ? If yes, do you have an error on back side ? Thanks |
Hey, I get the same error when trying to send a prompt. Usually it ends up being recorded in Supabase, but I get an empty assistant answer. Here's the error:
How should I check If there is any backend error? |
Yes, it seems there are still CORS issues around. Here some logs from the backend:
PS: Using the Traefik integration for a deployment on a server, and added the configured FRONTEND URL in cors.py |
So, it seems that the CORS issue was a side effect of the last migrations that didn't run properly... After running the migration manually in Supabase, the CORS issue on the FrontEnd disappeared! (At least for me) |
Thanks for your contributions, we'll be closing this issue as it has gone stale. Feel free to reopen if you'd like to continue the discussion. |
I'm still facing this issue. |
check error message in your backend logs, it is probably due to some DB issues, like the one I had (see previous messages) |
oh, the same error....
|
What happened?
If I want to go to http://somehost:3000/user I got an eternal spinner and the web console printed me this error "CORS header 'Access-Control-Allow-Origin' missing". I tried it with localhost and with another computer and with firefox and chromium. Meanwhile the chat works.
Relevant log output
Twitter / LinkedIn details
No response
The text was updated successfully, but these errors were encountered: