Deadwood-ai / deadwood-api

Main FastAPI application for the deadwood backend
GNU General Public License v3.0
0 stars 0 forks source link

AuthUnknownError during upload of orthophoto #50

Open cmosig opened 2 months ago

cmosig commented 2 months ago
api-1      | INFO:     10.77.0.1:59756 - "POST /datasets HTTP/1.1" 500 Internal Server Error
api-1      | ERROR:    Exception in ASGI application
api-1      | Traceback (most recent call last):
api-1      |   File "/usr/local/lib/python3.12/site-packages/gotrue/_sync/gotrue_base_api.py", line 118, in _request
api-1      |     response.raise_for_status()
api-1      |   File "/usr/local/lib/python3.12/site-packages/httpx/_models.py", line 761, in raise_for_status
api-1      |     raise HTTPStatusError(message, request=request, response=self)
api-1      | httpx.HTTPStatusError: Server error '500 Internal Server Error' for url 'https://ijuphmnaebfdzsfrnsrn.supabase.co/auth/v1/user'
api-1      | For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/500
api-1      | 
api-1      | During handling of the above exception, another exception occurred:
api-1      | 
api-1      | Traceback (most recent call last):
api-1      |   File "/usr/local/lib/python3.12/site-packages/uvicorn/protocols/http/httptools_impl.py", line 401, in run_asgi
api-1      |     result = await app(  # type: ignore[func-returns-value]
api-1      |              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
api-1      |   File "/usr/local/lib/python3.12/site-packages/uvicorn/middleware/proxy_headers.py", line 70, in __call__
api-1      |     return await self.app(scope, receive, send)
api-1      |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
api-1      |   File "/usr/local/lib/python3.12/site-packages/fastapi/applications.py", line 1054, in __call__
api-1      |     await super().__call__(scope, receive, send)
api-1      |   File "/usr/local/lib/python3.12/site-packages/starlette/applications.py", line 123, in __call__
api-1      |     await self.middleware_stack(scope, receive, send)
api-1      |   File "/usr/local/lib/python3.12/site-packages/starlette/middleware/errors.py", line 186, in __call__
api-1      |     raise exc
api-1      |   File "/usr/local/lib/python3.12/site-packages/starlette/middleware/errors.py", line 164, in __call__
api-1      |     await self.app(scope, receive, _send)
api-1      |   File "/usr/local/lib/python3.12/site-packages/starlette/middleware/cors.py", line 85, in __call__
api-1      |     await self.app(scope, receive, send)
api-1      |   File "/usr/local/lib/python3.12/site-packages/starlette/middleware/exceptions.py", line 65, in __call__
api-1      |     await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
api-1      |   File "/usr/local/lib/python3.12/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app
api-1      |     raise exc
api-1      |   File "/usr/local/lib/python3.12/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
api-1      |     await app(scope, receive, sender)
api-1      |   File "/usr/local/lib/python3.12/site-packages/starlette/routing.py", line 754, in __call__
api-1      |     await self.middleware_stack(scope, receive, send)
api-1      |   File "/usr/local/lib/python3.12/site-packages/starlette/routing.py", line 774, in app
api-1      |     await route.handle(scope, receive, send)
api-1      |   File "/usr/local/lib/python3.12/site-packages/starlette/routing.py", line 295, in handle
api-1      |     await self.app(scope, receive, send)
api-1      |   File "/usr/local/lib/python3.12/site-packages/starlette/routing.py", line 77, in app
api-1      |     await wrap_app_handling_exceptions(app, request)(scope, receive, send)
api-1      |   File "/usr/local/lib/python3.12/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app
api-1      |     raise exc
api-1      |   File "/usr/local/lib/python3.12/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
api-1      |     await app(scope, receive, sender)
api-1      |   File "/usr/local/lib/python3.12/site-packages/starlette/routing.py", line 74, in app
api-1      |     response = await f(request)
api-1      |                ^^^^^^^^^^^^^^^^
api-1      |   File "/usr/local/lib/python3.12/site-packages/fastapi/routing.py", line 278, in app
api-1      |     raw_response = await run_endpoint_function(
api-1      |                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
api-1      |   File "/usr/local/lib/python3.12/site-packages/fastapi/routing.py", line 191, in run_endpoint_function
api-1      |     return await dependant.call(**values)
api-1      |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
api-1      |   File "/app/src/routers/upload.py", line 80, in upload_geotiff
api-1      |     user = verify_token(token)
api-1      |            ^^^^^^^^^^^^^^^^^^^
api-1      |   File "/app/src/supabase.py", line 50, in verify_token
api-1      |     response = client.auth.get_user(jwt)
api-1      |                ^^^^^^^^^^^^^^^^^^^^^^^^^
api-1      |   File "/usr/local/lib/python3.12/site-packages/gotrue/_sync/gotrue_client.py", line 580, in get_user
api-1      |     return self._request("GET", "user", jwt=jwt, xform=parse_user_response)
api-1      |            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
api-1      |   File "/usr/local/lib/python3.12/site-packages/gotrue/_sync/gotrue_base_api.py", line 123, in _request
api-1      |     raise handle_exception(e)
api-1      | gotrue.errors.AuthUnknownError: Server error '500 Internal Server Error' for url 'https://ijuphmnaebfdzsfrnsrn.supabase.co/auth/v1/user'
api-1      | For more information check: https://developer.mozilla.org/en-US/docs/Web/HTTP/Status/500

Not sure what is causing this. Happened during POST of /datasets with quebec_2021-05-28-sbl-cloutier-z2-rgb.tif, but my gut feeling tells me this is unrelated to the image.

cmosig commented 2 months ago

Simply trying again works for now....

cmosig commented 2 months ago

Exact same issue with "BCI_50ha_2023_03_28_global.tif", but again, I don't think its related to the image. Restarting works

mmaelicke commented 2 months ago

Falls ich das richtig verstehe, ist das ein Fehler der supabase lib, weil der server bei der Authentifizierung nicht geantwortet hat. Mehr Infos finde ich nicht. Das liegt komplett auf der supabase Seite.

Das kann passieren, üblicherweise würde man den unbekannte HTTP Fehler abfangen und nach einem kurzen cooldown (zb 10s) bis zu max. ca 5 Mal den request nochmal absetzen.

Die docs von supabase geben leider nicht mehr her...

cmosig commented 2 months ago

Hmm komisch... Vorher kam der Fehler ja nicht