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

Garmin Connect Internal Server error - Assertion Error? #54

Open
Gandalf-the-Blue opened this issue Nov 26, 2024 · 2 comments
Open

Garmin Connect Internal Server error - Assertion Error? #54

Gandalf-the-Blue opened this issue Nov 26, 2024 · 2 comments

Comments

@Gandalf-the-Blue
Copy link

Hi, I've attached the logs below but there's some kind of Internal Server Error coming up when I'm trying to reconnect my Garmin Connect. Is this on the Garmin side, or Endurain side of things?

endurain_backend  | 2024-11-26T14:01:40.630841078Z INFO:     192.168.1.170:43000 - "POST /api/v1/garminconnect/link HTTP/1.1" 500 Internal Server Error
endurain_backend  | 2024-11-26T14:01:40.631812293Z ERROR:    Exception in ASGI application
endurain_backend  | 2024-11-26T14:01:40.631820095Z Traceback (most recent call last):
endurain_backend  | 2024-11-26T14:01:40.631821565Z   File "/usr/local/lib/python3.12/site-packages/uvicorn/protocols/http/h11_impl.py", line 406, in run_asgi
endurain_backend  | 2024-11-26T14:01:40.631822943Z     result = await app(  # type: ignore[func-returns-value]
endurain_backend  | 2024-11-26T14:01:40.631823999Z              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
endurain_backend  | 2024-11-26T14:01:40.631825020Z   File "/usr/local/lib/python3.12/site-packages/uvicorn/middleware/proxy_headers.py", line 60, in __call__
endurain_backend  | 2024-11-26T14:01:40.631826155Z     return await self.app(scope, receive, send)
endurain_backend  | 2024-11-26T14:01:40.631827151Z            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
endurain_backend  | 2024-11-26T14:01:40.631828148Z   File "/usr/local/lib/python3.12/site-packages/fastapi/applications.py", line 1054, in __call__
endurain_backend  | 2024-11-26T14:01:40.631829272Z     await super().__call__(scope, receive, send)
endurain_backend  | 2024-11-26T14:01:40.631830449Z   File "/usr/local/lib/python3.12/site-packages/starlette/applications.py", line 113, in __call__
endurain_backend  | 2024-11-26T14:01:40.631831526Z     await self.middleware_stack(scope, receive, send)
endurain_backend  | 2024-11-26T14:01:40.631832529Z   File "/usr/local/lib/python3.12/site-packages/starlette/middleware/errors.py", line 187, in __call__
endurain_backend  | 2024-11-26T14:01:40.631833622Z     raise exc
endurain_backend  | 2024-11-26T14:01:40.631842817Z   File "/usr/local/lib/python3.12/site-packages/starlette/middleware/errors.py", line 165, in __call__
endurain_backend  | 2024-11-26T14:01:40.631843759Z     await self.app(scope, receive, _send)
endurain_backend  | 2024-11-26T14:01:40.631844522Z   File "/usr/local/lib/python3.12/site-packages/opentelemetry/instrumentation/asgi/__init__.py", line 743, in __call__
endurain_backend  | 2024-11-26T14:01:40.631845395Z     await self.app(scope, otel_receive, otel_send)
endurain_backend  | 2024-11-26T14:01:40.631846157Z   File "/usr/local/lib/python3.12/site-packages/starlette/middleware/cors.py", line 93, in __call__
endurain_backend  | 2024-11-26T14:01:40.631847007Z     await self.simple_response(scope, receive, send, request_headers=headers)
endurain_backend  | 2024-11-26T14:01:40.631847813Z   File "/usr/local/lib/python3.12/site-packages/starlette/middleware/cors.py", line 144, in simple_response
endurain_backend  | 2024-11-26T14:01:40.631848682Z     await self.app(scope, receive, send)
endurain_backend  | 2024-11-26T14:01:40.631849444Z   File "/usr/local/lib/python3.12/site-packages/starlette/middleware/exceptions.py", line 62, in __call__
endurain_backend  | 2024-11-26T14:01:40.631850286Z     await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
endurain_backend  | 2024-11-26T14:01:40.631851061Z   File "/usr/local/lib/python3.12/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
endurain_backend  | 2024-11-26T14:01:40.631851911Z     raise exc
endurain_backend  | 2024-11-26T14:01:40.631852617Z   File "/usr/local/lib/python3.12/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app
endurain_backend  | 2024-11-26T14:01:40.631853456Z     await app(scope, receive, sender)
endurain_backend  | 2024-11-26T14:01:40.631854465Z   File "/usr/local/lib/python3.12/site-packages/starlette/routing.py", line 715, in __call__
endurain_backend  | 2024-11-26T14:01:40.631855385Z     await self.middleware_stack(scope, receive, send)
endurain_backend  | 2024-11-26T14:01:40.631856166Z   File "/usr/local/lib/python3.12/site-packages/starlette/routing.py", line 735, in app
endurain_backend  | 2024-11-26T14:01:40.631857036Z     await route.handle(scope, receive, send)
endurain_backend  | 2024-11-26T14:01:40.631857807Z   File "/usr/local/lib/python3.12/site-packages/starlette/routing.py", line 288, in handle
endurain_backend  | 2024-11-26T14:01:40.631858663Z     await self.app(scope, receive, send)
endurain_backend  | 2024-11-26T14:01:40.631859406Z   File "/usr/local/lib/python3.12/site-packages/starlette/routing.py", line 76, in app
endurain_backend  | 2024-11-26T14:01:40.631860271Z     await wrap_app_handling_exceptions(app, request)(scope, receive, send)
endurain_backend  | 2024-11-26T14:01:40.631861074Z   File "/usr/local/lib/python3.12/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
endurain_backend  | 2024-11-26T14:01:40.631861915Z     raise exc
endurain_backend  | 2024-11-26T14:01:40.631862611Z   File "/usr/local/lib/python3.12/site-packages/starlette/_exception_handler.py", line 42, in wrapped_app
endurain_backend  | 2024-11-26T14:01:40.631863462Z     await app(scope, receive, sender)
endurain_backend  | 2024-11-26T14:01:40.631864208Z   File "/usr/local/lib/python3.12/site-packages/starlette/routing.py", line 73, in app
endurain_backend  | 2024-11-26T14:01:40.631865075Z     response = await f(request)
endurain_backend  | 2024-11-26T14:01:40.631867010Z                ^^^^^^^^^^^^^^^^
endurain_backend  | 2024-11-26T14:01:40.631867836Z   File "/usr/local/lib/python3.12/site-packages/fastapi/routing.py", line 301, in app
endurain_backend  | 2024-11-26T14:01:40.631868672Z     raw_response = await run_endpoint_function(
endurain_backend  | 2024-11-26T14:01:40.631869448Z                    ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
endurain_backend  | 2024-11-26T14:01:40.631870242Z   File "/usr/local/lib/python3.12/site-packages/fastapi/routing.py", line 212, in run_endpoint_function
endurain_backend  | 2024-11-26T14:01:40.631871162Z     return await dependant.call(**values)
endurain_backend  | 2024-11-26T14:01:40.631871903Z            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
endurain_backend  | 2024-11-26T14:01:40.631872665Z   File "/app/garmin/router.py", line 46, in garminconnect_link
endurain_backend  | 2024-11-26T14:01:40.631873492Z     await garmin_utils.link_garminconnect(
endurain_backend  | 2024-11-26T14:01:40.631874241Z   File "/app/garmin/utils.py", line 98, in link_garminconnect
endurain_backend  | 2024-11-26T14:01:40.631875191Z     garmin = await asyncio.to_thread(blocking_login)
endurain_backend  | 2024-11-26T14:01:40.631875964Z              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
endurain_backend  | 2024-11-26T14:01:40.631876941Z   File "/usr/local/lib/python3.12/asyncio/threads.py", line 25, in to_thread
endurain_backend  | 2024-11-26T14:01:40.631877780Z     return await loop.run_in_executor(None, func_call)
endurain_backend  | 2024-11-26T14:01:40.631878563Z            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
endurain_backend  | 2024-11-26T14:01:40.631879368Z   File "/usr/local/lib/python3.12/concurrent/futures/thread.py", line 58, in run
endurain_backend  | 2024-11-26T14:01:40.631880214Z     result = self.fn(*self.args, **self.kwargs)
endurain_backend  | 2024-11-26T14:01:40.631880965Z              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
endurain_backend  | 2024-11-26T14:01:40.631883869Z   File "/app/garmin/utils.py", line 87, in blocking_login
endurain_backend  | 2024-11-26T14:01:40.631884707Z     garmin.login()
endurain_backend  | 2024-11-26T14:01:40.631885587Z   File "/usr/local/lib/python3.12/site-packages/garminconnect/__init__.py", line 212, in login
endurain_backend  | 2024-11-26T14:01:40.631886475Z     self.display_name = self.garth.profile["displayName"]
endurain_backend  | 2024-11-26T14:01:40.631887312Z                         ^^^^^^^^^^^^^^^^^^
endurain_backend  | 2024-11-26T14:01:40.631888093Z   File "/usr/local/lib/python3.12/site-packages/garth/http.py", line 104, in profile
endurain_backend  | 2024-11-26T14:01:40.631888937Z     assert isinstance(self._profile, dict)
endurain_backend  | 2024-11-26T14:01:40.631889689Z            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
endurain_backend  | 2024-11-26T14:01:40.631890460Z AssertionError
@joaovitoriasilva
Copy link
Owner

joaovitoriasilva commented Nov 26, 2024

I am having the same issue. What is raising the exception is Garth, a library that python-garminconnect uses. I will keep you posted.

Yep, confirmed it is on Garth side. Issue is open here

@joaovitoriasilva
Copy link
Owner

Hello. Doing pip install --upgrade garminconnect in the backend container shell will fix the issue for now.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants