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

bug(api): All connection attempts failed - backend API breakage #878

Open
andrewrisse opened this issue Aug 5, 2024 · 0 comments
Open
Labels
api possible-bug 🐛 Something may not be working

Comments

@andrewrisse
Copy link
Contributor

andrewrisse commented Aug 5, 2024

Environment

Device and OS: Playwright tests using Chromium hitting API deployed on LF-04
App/package versions: LeapfrogAI API V9.0 and 10.0

Steps to reproduce

  1. Run UI playwright tests (increase workers to 4 in playwright.config.ts) to see this bug quicker. If using 1 worker, the API is more stable and it can take many tries to re-create.

Expected result

Tests pass

Actual Result

Tests begin to fail suddenly once backend breaks and gives this error:

│ httpx.ConnectError: All connection attempts failed                                                                                                                                                                                         │
│                                                                                                                                                                                                                                            │
│ During handling of the above exception, another exception occurred:                                                                                                                                                                        │
│                                                                                                                                                                                                                                            │
│ Traceback (most recent call last):                                                                                                                                                                                                         │
│   File "/home/nonroot/.local/lib/python3.11/site-packages/leapfrogai_api/routers/supabase_session.py", line 60, in init_supabase_client                                                                                                    │
│     await client.auth.set_session(                                                                                                                                                                                                         │
│   File "/home/nonroot/.local/lib/python3.11/site-packages/gotrue/_async/gotrue_client.py", line 601, in set_session                                                                                                                        │
│     response = await self.get_user(access_token)                                                                                                                                                                                           │
│                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                                                                                                                                                                                           │
│   File "/home/nonroot/.local/lib/python3.11/site-packages/gotrue/_async/gotrue_client.py", line 547, in get_user                                                                                                                           │
│     return await self._request("GET", "user", jwt=jwt, xform=parse_user_response)                                                                                                                                                          │
│            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^                                                                                                                                                          │
│   File "/home/nonroot/.local/lib/python3.11/site-packages/gotrue/_async/gotrue_base_api.py", line 118, in _request                                                                                                                         │
│     raise handle_exception(e)                                                                                                                                                                                                              │
│ gotrue.errors.AuthRetryableError: All connection attempts failed

The tests will not pass until you restart the api-deployment pod as well as both supabase-kong pods.

It also appears to be triggered by Playwright E2E tests that interruupt active message streams (by clicking the pause button or reloading the page). This is not always the case, but the issue did seem to happen more when those tests were the first to start failing.

Visual Proof (screenshots, videos, text, etc)

Severity/Priority

Major - causes catastrophic failure of backend requiring reboot of multiple services

Additional Context

@andrewrisse andrewrisse added the possible-bug 🐛 Something may not be working label Aug 5, 2024
@nywilken nywilken added the api label Oct 10, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
api possible-bug 🐛 Something may not be working
Projects
None yet
Development

No branches or pull requests

2 participants