quivr
quivr copied to clipboard
[Issue] Creating Brain results in CORS Error
Hi,
fresh install with Apple M1
Any Ideas?
Logs:
backend | INFO: Will watch for changes in these directories: ['/code']
backend | INFO: Uvicorn running on http://0.0.0.0:5050 (Press CTRL+C to quit)
backend | INFO: Started reloader process [7] using StatReload
web | - info Loaded env from /app/.env
backend | INFO: Started server process [9]
backend | INFO: Waiting for application startup.
backend | [INFO] Using already downloaded file pandoc-3.1.5-1-arm64.deb
backend | 2023-07-10 08:34:58,652:INFO - Using already downloaded file pandoc-3.1.5-1-arm64.deb
backend | [INFO] Unpacking pandoc-3.1.5-1-arm64.deb to tempfolder...
backend | 2023-07-10 08:34:58,653:INFO - Unpacking pandoc-3.1.5-1-arm64.deb to tempfolder...
backend | [INFO] Copying pandoc to /root/bin ...
backend | 2023-07-10 08:35:00,832:INFO - Copying pandoc to /root/bin ...
backend | [INFO] Making /root/bin/pandoc executeable...
backend | 2023-07-10 08:35:00,903:INFO - Making /root/bin/pandoc executeable...
backend | [INFO] Copying copyright to /root/bin ...
backend | 2023-07-10 08:35:00,903:INFO - Copying copyright to /root/bin ...
backend | INFO: Application startup complete.
backend | INFO: 172.19.0.1:61434 - "GET /brains/ HTTP/1.1" 500 Internal Server Error
backend | ERROR: Exception in ASGI application
backend | Traceback (most recent call last):
backend | File "/usr/local/lib/python3.11/site-packages/uvicorn/protocols/http/h11_impl.py", line 428, in run_asgi
backend | result = await app( # type: ignore[func-returns-value]
backend | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
backend | File "/usr/local/lib/python3.11/site-packages/uvicorn/middleware/proxy_headers.py", line 78, in __call__
backend | return await self.app(scope, receive, send)
backend | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
backend | File "/usr/local/lib/python3.11/site-packages/fastapi/applications.py", line 276, in __call__
backend | await super().__call__(scope, receive, send)
backend | File "/usr/local/lib/python3.11/site-packages/starlette/applications.py", line 122, in __call__
backend | await self.middleware_stack(scope, receive, send)
backend | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 184, in __call__
backend | raise exc
backend | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 162, in __call__
backend | await self.app(scope, receive, _send)
backend | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/cors.py", line 91, in __call__
backend | await self.simple_response(scope, receive, send, request_headers=headers)
backend | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/cors.py", line 146, in simple_response
backend | await self.app(scope, receive, send)
backend | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 79, in __call__
backend | raise exc
backend | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 68, in __call__
backend | await self.app(scope, receive, sender)
backend | File "/usr/local/lib/python3.11/site-packages/fastapi/middleware/asyncexitstack.py", line 21, in __call__
backend | raise e
backend | File "/usr/local/lib/python3.11/site-packages/fastapi/middleware/asyncexitstack.py", line 18, in __call__
backend | await self.app(scope, receive, send)
backend | File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 718, in __call__
backend | await route.handle(scope, receive, send)
backend | File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 276, in handle
backend | await self.app(scope, receive, send)
backend | File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 66, in app
backend | response = await func(request)
backend | ^^^^^^^^^^^^^^^^^^^
backend | File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 237, in app
backend | raw_response = await run_endpoint_function(
backend | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
backend | File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 163, in run_endpoint_function
backend | return await dependant.call(**values)
backend | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
backend | File "/code/routes/brain_routes.py", line 40, in brain_endpoint
backend | brains = brain.get_user_brains(current_user.id)
backend | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
backend | File "/code/models/brains.py", line 55, in get_user_brains
backend | .execute()
backend | ^^^^^^^^^
backend | File "/usr/local/lib/python3.11/site-packages/postgrest/_sync/request_builder.py", line 68, in execute
backend | raise APIError(r.json())
backend | postgrest.exceptions.APIError: {'code': 'PGRST200', 'details': "Searched for a foreign key relationship between 'brains_users' and 'brains' in the schema 'public', but no matches were found.", 'hint': None, 'message': "Could not find a relationship between 'brains_users' and 'brains' in the schema cache"}
backend | INFO: 172.19.0.1:61436 - "GET /brains/default/ HTTP/1.1" 500 Internal Server Error
backend | ERROR: Exception in ASGI application
backend | Traceback (most recent call last):
backend | File "/usr/local/lib/python3.11/site-packages/uvicorn/protocols/http/h11_impl.py", line 428, in run_asgi
backend | result = await app( # type: ignore[func-returns-value]
backend | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
backend | File "/usr/local/lib/python3.11/site-packages/uvicorn/middleware/proxy_headers.py", line 78, in __call__
backend | return await self.app(scope, receive, send)
backend | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
backend | File "/usr/local/lib/python3.11/site-packages/fastapi/applications.py", line 276, in __call__
backend | await super().__call__(scope, receive, send)
backend | File "/usr/local/lib/python3.11/site-packages/starlette/applications.py", line 122, in __call__
backend | await self.middleware_stack(scope, receive, send)
backend | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 184, in __call__
backend | raise exc
backend | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 162, in __call__
backend | await self.app(scope, receive, _send)
backend | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/cors.py", line 91, in __call__
backend | await self.simple_response(scope, receive, send, request_headers=headers)
backend | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/cors.py", line 146, in simple_response
backend | await self.app(scope, receive, send)
backend | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 79, in __call__
backend | raise exc
backend | File "/usr/local/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 68, in __call__
backend | await self.app(scope, receive, sender)
backend | File "/usr/local/lib/python3.11/site-packages/fastapi/middleware/asyncexitstack.py", line 21, in __call__
backend | raise e
backend | File "/usr/local/lib/python3.11/site-packages/fastapi/middleware/asyncexitstack.py", line 18, in __call__
backend | await self.app(scope, receive, send)
backend | File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 718, in __call__
backend | await route.handle(scope, receive, send)
backend | File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 276, in handle
backend | await self.app(scope, receive, send)
backend | File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 66, in app
backend | response = await func(request)
backend | ^^^^^^^^^^^^^^^^^^^
backend | File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 237, in app
backend | raw_response = await run_endpoint_function(
backend | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
backend | File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 163, in run_endpoint_function
backend | return await dependant.call(**values)
backend | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
backend | File "/code/routes/brain_routes.py", line 58, in get_default_brain_endpoint
backend | default_brain = get_default_user_brain(current_user)
backend | ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
backend | File "/code/models/brains.py", line 248, in get_default_user_brain
backend | .execute()
backend | ^^^^^^^^^
backend | File "/usr/local/lib/python3.11/site-packages/postgrest/_sync/request_builder.py", line 68, in execute
backend | raise APIError(r.json())
backend | postgrest.exceptions.APIError: {'code': '42P01', 'details': None, 'hint': None, 'message': 'relation "public.brains_users" does not exist'}
Regards
Same error with Intel Chip.
Duplicate of https://github.com/StanGirard/quivr/issues/559#issue-1794860745?
It means the backend doesn't work. You probably forgot to run the migrations ;)
I get stuck running the migration.sh script at the point in the attached screen shot. It will not allow me to select any option.
I tried to run the migration manually (by simply copying the https://github.com/StanGirard/quivr/blob/main/scripts/tables.sql script into a "New Query" in Supa and it executed without issue. However, I still have the same problem as listed here by other with creating a 'brain' and with chatting.
any progress here? https://www.youtube.com/watch?v=rFEbz93G9U8 soon i will test manually, not using helper script if any put a PR for solve this pls share....
I tried manually, still did not work.
@ziptron do u use steps like in video?
Yes, tried it twice.
Ok, then i will wait pls hurry up for solve this issue is an issue for installation, then will be ensure a good effort for solve it
El lun, 10 jul 2023 a las 12:30, ziptron @.***>) escribió:
Yes, tried it twice.
— Reply to this email directly, view it on GitHub https://github.com/StanGirard/quivr/issues/581#issuecomment-1629406526, or unsubscribe https://github.com/notifications/unsubscribe-auth/AADIWFDRT7YUXURPZFYS3UTXPQ32HANCNFSM6AAAAAA2EGHE2M . You are receiving this because you commented.Message ID: @.***>
So I solved this issue for myself.
I had two problems.
The biggest issue was that the backend was not running. I fixed this using (https://github.com/StanGirard/quivr/issues/556) The next issue was Firefox. I still have issue running this in firefox, but I got it to run it Edge browser.
The issue for me was accessing via 0.0.0.0:3000 instead of localhost:3000
The issue for me was accessing via 0.0.0.0:3000 instead of localhost:3000
in chrome is possible do that?
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.