!etqgAEaQcsBuGJpEvE:matrix.org

Fedora Apps

210 Members
Please register to speak - https://da.gd/register | Fedora Infrastructure applications | https://apps.fedoraproject.org - bodhi, fas, mirrormanager, pagure etc11 Servers

Load older messages


SenderMessageTime
1 Aug 2024
@abompard:fedora.imAurélien Bhaving both a sync and async db connection is a path to madness. We tried that on FMN and had to go back05:43:52
@t0xic0der:fedora.imAkashdeep DharWe did that on CentOS/Duffy and I was "this" close to losing my will to live.05:44:19
@abompard:fedora.imAurélien Byep.05:44:31
@t0xic0der:fedora.imAkashdeep DharCool - I was halfway through with the service endpoint so - I will push the incomplete code and pause stuff for now.05:45:13
@t0xic0der:fedora.imAkashdeep DharStuff = Porting to Flask-OpenAPI305:45:22
@abompard:fedora.imAurélien Byeah05:45:28
@t0xic0der:fedora.imAkashdeep Dhar Aurélien B: Do you want some more time to think it through or should I begin with the FastAPI port? 05:45:42
@abompard:fedora.imAurélien BNah, go ahead, I'll find a way eventually05:45:59
@t0xic0der:fedora.imAkashdeep DharAnything works - I will get back to Forgejo ARC then05:46:06
@t0xic0der:fedora.imAkashdeep DharOk then - starting with the port05:46:14
@abompard:fedora.imAurélien BCool05:46:19
@abompard:fedora.imAurélien BLet's do sync endpoints for now05:46:52
@t0xic0der:fedora.imAkashdeep DharWorks05:47:09
@t0xic0der:fedora.imAkashdeep DharOne endpoint per PR05:47:17
@abompard:fedora.imAurélien Byeah05:47:22
@t0xic0der:fedora.imAkashdeep DharBecause one endpoint also means their request model and their response model and ...05:47:37
@abompard:fedora.imAurélien Byep!05:47:44
@t0xic0der:fedora.imAkashdeep DharAlso let us focus on the tests once we are done with ALL the endpoints05:48:41
@t0xic0der:fedora.imAkashdeep DharShould keep us from slowing down more than we already are05:48:56
@abompard:fedora.imAurélien Byeah, priority is still the main message endpoint05:52:02
@t0xic0der:fedora.imAkashdeep Dhar Mehmet Baran Geylani: Draft https://github.com/fedora-infra/webhook-to-fedora-messaging/pull/57 08:11:26
@t0xic0der:fedora.imAkashdeep Dhar Aurélien B: Are you around? I have a question regarding the creation of an object using sqlalchemy_helpers. 11:52:17
@abompard:fedora.imAurélien Byes12:13:05
@abompard:fedora.imAurélien Bif you're still around12:13:11
@t0xic0der:fedora.imAkashdeep DharI am 12:14:44
@t0xic0der:fedora.imAkashdeep DharWanna jump on a call ?12:14:54
@abompard:fedora.imAurélien Bsure12:15:10
@pcreech:matrix.orgpcreechREMINDER: Fedora Infrastructure meeting in 10 minutes in https://matrix.to/#/#meeting-3:fedoraproject.org. Please check the agenda at https://board.net/p/fedora-infra15:50:15
2 Aug 2024
@t0xic0der:fedora.imAkashdeep Dhar

The database session handling (or the way I am doing it) seems flawed.

[W2FM] [2024-08-02 10:33:51 +0530] [ERROR] Exception in ASGI application
Traceback (most recent call last):
  File "/home/archdesk/Projects/webhook-to-fedora-messaging/venv/lib/python3.12/site-packages/uvicorn/protocols/http/httptools_impl.py", line 399, in run_asgi
    result = await app(  # type: ignore[func-returns-value]
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/archdesk/Projects/webhook-to-fedora-messaging/venv/lib/python3.12/site-packages/uvicorn/middleware/proxy_headers.py", line 70, in __call__
    return await self.app(scope, receive, send)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/archdesk/Projects/webhook-to-fedora-messaging/venv/lib/python3.12/site-packages/fastapi/applications.py", line 1054, in __call__
    await super().__call__(scope, receive, send)
  File "/home/archdesk/Projects/webhook-to-fedora-messaging/venv/lib/python3.12/site-packages/starlette/applications.py", line 123, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/home/archdesk/Projects/webhook-to-fedora-messaging/venv/lib/python3.12/site-packages/starlette/middleware/errors.py", line 186, in __call__
    raise exc
  File "/home/archdesk/Projects/webhook-to-fedora-messaging/venv/lib/python3.12/site-packages/starlette/middleware/errors.py", line 164, in __call__
    await self.app(scope, receive, _send)
  File "/home/archdesk/Projects/webhook-to-fedora-messaging/venv/lib/python3.12/site-packages/starlette/middleware/exceptions.py", line 65, in __call__
    await wrap_app_handling_exceptions(self.app, conn)(scope, receive, send)
  File "/home/archdesk/Projects/webhook-to-fedora-messaging/venv/lib/python3.12/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app
    raise exc
  File "/home/archdesk/Projects/webhook-to-fedora-messaging/venv/lib/python3.12/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
    await app(scope, receive, sender)
  File "/home/archdesk/Projects/webhook-to-fedora-messaging/venv/lib/python3.12/site-packages/starlette/routing.py", line 756, in __call__
    await self.middleware_stack(scope, receive, send)
  File "/home/archdesk/Projects/webhook-to-fedora-messaging/venv/lib/python3.12/site-packages/starlette/routing.py", line 776, in app
    await route.handle(scope, receive, send)
  File "/home/archdesk/Projects/webhook-to-fedora-messaging/venv/lib/python3.12/site-packages/starlette/routing.py", line 297, in handle
    await self.app(scope, receive, send)
  File "/home/archdesk/Projects/webhook-to-fedora-messaging/venv/lib/python3.12/site-packages/starlette/routing.py", line 77, in app
    await wrap_app_handling_exceptions(app, request)(scope, receive, send)
  File "/home/archdesk/Projects/webhook-to-fedora-messaging/venv/lib/python3.12/site-packages/starlette/_exception_handler.py", line 64, in wrapped_app
    raise exc
  File "/home/archdesk/Projects/webhook-to-fedora-messaging/venv/lib/python3.12/site-packages/starlette/_exception_handler.py", line 53, in wrapped_app
    await app(scope, receive, sender)
  File "/home/archdesk/Projects/webhook-to-fedora-messaging/venv/lib/python3.12/site-packages/starlette/routing.py", line 72, in app
    response = await func(request)
               ^^^^^^^^^^^^^^^^^^^
  File "/home/archdesk/Projects/webhook-to-fedora-messaging/venv/lib/python3.12/site-packages/fastapi/routing.py", line 278, in app
    raw_response = await run_endpoint_function(
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/archdesk/Projects/webhook-to-fedora-messaging/venv/lib/python3.12/site-packages/fastapi/routing.py", line 193, in run_endpoint_function
    return await run_in_threadpool(dependant.call, **values)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/archdesk/Projects/webhook-to-fedora-messaging/venv/lib/python3.12/site-packages/starlette/concurrency.py", line 42, in run_in_threadpool
    return await anyio.to_thread.run_sync(func, *args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/archdesk/Projects/webhook-to-fedora-messaging/venv/lib/python3.12/site-packages/anyio/to_thread.py", line 56, in run_sync
    return await get_async_backend().run_sync_in_worker_thread(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/archdesk/Projects/webhook-to-fedora-messaging/venv/lib/python3.12/site-packages/anyio/_backends/_asyncio.py", line 2177, in run_sync_in_worker_thread
    return await future
           ^^^^^^^^^^^^
  File "/home/archdesk/Projects/webhook-to-fedora-messaging/venv/lib/python3.12/site-packages/anyio/_backends/_asyncio.py", line 859, in run
    result = context.run(func, *args)
             ^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/archdesk/Projects/webhook-to-fedora-messaging/webhook_to_fedora_messaging/endpoints/user.py", line 46, in create_user
    session.flush()
  File "/home/archdesk/Projects/webhook-to-fedora-messaging/venv/lib/python3.12/site-packages/sqlalchemy/orm/session.py", line 4341, in flush
    self._flush(objects)
  File "/home/archdesk/Projects/webhook-to-fedora-messaging/venv/lib/python3.12/site-packages/sqlalchemy/orm/session.py", line 4433, in _flush
    flush_context.transaction = transaction = self._autobegin_t()._begin()
                                              ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "<string>", line 2, in _begin
  File "/home/archdesk/Projects/webhook-to-fedora-messaging/venv/lib/python3.12/site-packages/sqlalchemy/orm/state_changes.py", line 103, in _go
    self._raise_for_prerequisite_state(fn.__name__, current_state)
  File "/home/archdesk/Projects/webhook-to-fedora-messaging/venv/lib/python3.12/site-packages/sqlalchemy/orm/session.py", line 973, in _raise_for_prerequisite_state
    raise sa_exc.PendingRollbackError(
sqlalchemy.exc.PendingRollbackError: This Session's transaction has been rolled back due to a previous exception during flush. To begin a new transaction with this Session, first issue Session.rollback(). Original exception was: (psycopg2.errors.UniqueViolation) duplicate key value violates unique constraint "uq_users_username"
DETAIL:  Key (username)=(string) already exists.

[SQL: INSERT INTO users (username, is_admin, uuid, creation_date) VALUES (%(username)s, %(is_admin)s, %(uuid)s, %(creation_date)s) RETURNING users.id]
[parameters: {'username': 'string', 'is_admin': False, 'uuid': '2108d717', 'creation_date': datetime.datetime(2024, 8, 2, 5, 3, 41, 509271)}]
(Background on this error at: https://sqlalche.me/e/20/gkpj) (Background on this error at: https://sqlalche.me/e/20/7s2a)
05:05:14
@t0xic0der:fedora.imAkashdeep Dhar The session never seems to go out of context and therefore the commit never runs https://github.com/fedora-infra/webhook-to-fedora-messaging/pull/57/files#diff-9c106b8467d263eac1d993640eb14efa31031b69af39dca637a20b754515467aR28-R29 05:06:24

Show newer messages


Back to Room ListRoom Version: 5