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

can not creat brain #2149

Closed
BabaSarf opened this issue Feb 6, 2024 · 2 comments
Closed

can not creat brain #2149

BabaSarf opened this issue Feb 6, 2024 · 2 comments
Labels
area: backend Related to backend functionality or under the /backend directory bug Something isn't working Stale type: dependencies

Comments

@BabaSarf
Copy link

BabaSarf commented Feb 6, 2024

What happened?

can not create brain ad I get can not fitch data when try to safe

Relevant log output

log from browser Access to XMLHttpRequest at 'https://api.aipartners.org.nz/onboarding' from origin 'https://aipartners.org.nz' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource.
8774-155ab00fff3430d5.js:6 
        
        
       GET https://api.aipartners.org.nz/onboarding net::ERR_FAILED 500 (Internal Server Error
log from docker 
Traceback (most recent call last):
backend-core  |   File "/usr/local/lib/python3.11/site-packages/uvicorn/protocols/http/h11_impl.py", line 428, in run_asgi
backend-core  |     result = await app(  # type: ignore[func-returns-value]
backend-core  |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
backend-core  |   File "/usr/local/lib/python3.11/site-packages/uvicorn/middleware/proxy_headers.py", line 78, in __call__
backend-core  |     return await self.app(scope, receive, send)
backend-core  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
backend-core  |   File "/usr/local/lib/python3.11/site-packages/fastapi/applications.py", line 276, in __call__
backend-core  |     await super().__call__(scope, receive, send)
backend-core  |   File "/usr/local/lib/python3.11/site-packages/starlette/applications.py", line 122, in __call__
backend-core  |     await self.middleware_stack(scope, receive, send)
backend-core  |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 184, in __call__
backend-core  |     raise exc
backend-core  |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/errors.py", line 162, in __call__
backend-core  |     await self.app(scope, receive, _send)
backend-core  |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/cors.py", line 91, in __call__
backend-core  |     await self.simple_response(scope, receive, send, request_headers=headers)
backend-core  |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/cors.py", line 146, in simple_response
backend-core  |     await self.app(scope, receive, send)
backend-core  |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 79, in __call__
backend-core  |     raise exc
backend-core  |   File "/usr/local/lib/python3.11/site-packages/starlette/middleware/exceptions.py", line 68, in __call__
backend-core  |     await self.app(scope, receive, sender)
backend-core  |   File "/usr/local/lib/python3.11/site-packages/fastapi/middleware/asyncexitstack.py", line 21, in __call__
backend-core  |     raise e
backend-core  |   File "/usr/local/lib/python3.11/site-packages/fastapi/middleware/asyncexitstack.py", line 18, in __call__
backend-core  |     await self.app(scope, receive, send)
backend-core  |   File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 718, in __call__
backend-core  |     await route.handle(scope, receive, send)
backend-core  |   File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 276, in handle
backend-core  |     await self.app(scope, receive, send)
backend-core  |   File "/usr/local/lib/python3.11/site-packages/starlette/routing.py", line 66, in app
backend-core  |     response = await func(request)
backend-core  |                ^^^^^^^^^^^^^^^^^^^
backend-core  |   File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 237, in app
backend-core  |     raw_response = await run_endpoint_function(
backend-core  |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
backend-core  |   File "/usr/local/lib/python3.11/site-packages/fastapi/routing.py", line 163, in run_endpoint_function
backend-core  |     return await dependant.call(**values)
backend-core  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
backend-core  |   File "/code/modules/onboarding/controller/onboarding_routes.py", line 28, in get_user_onboarding_handler
backend-core  |     return onboardingService.get_user_onboarding(current_user.id)
backend-core  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
backend-core  |   File "/code/modules/onboarding/service/onboarding_service.py", line 30, in get_user_onboarding
backend-core  |     return self.repository.get_user_onboarding(user_id)
backend-core  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
backend-core  |   File "/code/modules/onboarding/repository/onboardings.py", line 29, in get_user_onboarding
backend-core  |     .execute()
backend-core  |      ^^^^^^^^^
backend-core  |   File "/usr/local/lib/python3.11/site-packages/postgrest/_sync/request_builder.py", line 57, in execute
backend-core  |     r = self.session.request(
backend-core  |         ^^^^^^^^^^^^^^^^^^^^^
backend-core  |   File "/usr/local/lib/python3.11/site-packages/httpx/_client.py", line 814, in request
backend-core  |     return self.send(request, auth=auth, follow_redirects=follow_redirects)
backend-core  |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
backend-core  |   File "/usr/local/lib/python3.11/site-packages/httpx/_client.py", line 901, in send
backend-core  |     response = self._send_handling_auth(
backend-core  |                ^^^^^^^^^^^^^^^^^^^^^^^^^
backend-core  |   File "/usr/local/lib/python3.11/site-packages/httpx/_client.py", line 929, in _send_handling_auth
backend-core  |     response = self._send_handling_redirects(
backend-core  |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
backend-core  |   File "/usr/local/lib/python3.11/site-packages/httpx/_client.py", line 966, in _send_handling_redirects
backend-core  |     response = self._send_single_request(request)
backend-core  |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
backend-core  |   File "/usr/local/lib/python3.11/site-packages/httpx/_client.py", line 1002, in _send_single_request
backend-core  |     response = transport.handle_request(request)
backend-core  |                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
backend-core  |   File "/usr/local/lib/python3.11/site-packages/httpx/_transports/default.py", line 217, in handle_request
backend-core  |     with map_httpcore_exceptions():
backend-core  |   File "/usr/local/lib/python3.11/contextlib.py", line 155, in __exit__
backend-core  |     self.gen.throw(typ, value, traceback)
backend-core  |   File "/usr/local/lib/python3.11/site-packages/httpx/_transports/default.py", line 77, in map_httpcore_exceptions
backend-core  |     raise mapped_exc(message) from exc
backend-core  | httpx.ConnectError: [Errno 111] Connection refused
backend-core  | INFO:     127.0.0.1:51864 - "GET /healthz HTTP/1.1" 200 OK
backend-core  | INFO:     127.0.0.1:47154 - "GET /healthz HTTP/1.1" 200 OK

Twitter / LinkedIn details

No response

@BabaSarf BabaSarf added the bug Something isn't working label Feb 6, 2024
Copy link

dosubot bot commented Feb 6, 2024

🤖

Hey @BabaSarf, great to see you back! Hope you're doing well.

Based on the logs you've provided, it seems like there are a couple of issues at play here.

The first issue is related to the Cross-Origin Resource Sharing (CORS) policy. This is a security feature that restricts web applications from making requests to a different domain than the one the web application came from. The error message Access to XMLHttpRequest at 'https://api.aipartners.org.nz/onboarding' from origin 'https://aipartners.org.nz' has been blocked by CORS policy: No 'Access-Control-Allow-Origin' header is present on the requested resource. indicates that the server at https://api.aipartners.org.nz/onboarding is not configured to accept requests from https://aipartners.org.nz. This is typically resolved by updating the server's configuration to include the origin in its 'Access-Control-Allow-Origin' header.

The second issue is related to a connection refusal, as indicated by the error message httpx.ConnectError: [Errno 111] Connection refused. This error typically occurs when the server is not accepting connections on the specified port. This could be due to the server being down, a network issue, or the server being overloaded with requests.

Without more specific information or logs, it's hard to pinpoint the exact cause of these errors. You may need to check the server configuration, network settings, and server load.

As for the Quivr application, there are a few places in the code where these issues could potentially arise. For instance, in the create_new_brain function, there is a check for the maximum number of brains a user can have. If the user has reached this limit, the function raises an HTTPException with status code 429. This could be the reason why you are unable to create a new brain. You can find this in the brain_routes.py file.

There are also several places in the code where authorization is checked. If the user does not have the necessary permissions, an HTTPException is raised. This could be causing the "Connection refused" error.

I hope this helps! If you have any more information or logs that could help diagnose the issue, please provide them.

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.

@dosubot dosubot bot added area: backend Related to backend functionality or under the /backend directory type: dependencies labels Feb 6, 2024
Copy link
Contributor

github-actions bot commented May 6, 2024

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.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
area: backend Related to backend functionality or under the /backend directory bug Something isn't working Stale type: dependencies
Projects
None yet
Development

No branches or pull requests

1 participant