Guest User

Untitled

a guest
Sep 5th, 2022
10
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 8.86 KB | None | 0 0
  1. Invalidate connection <sqlalchemy.dialects.postgresql.asyncpg.AsyncAdapt_asyncpg_connection object at 0x000001FE9C0E8C40> (reason: Error:<class 'asyncpg.exceptions.ConnectionDoesNotExistError'>: connection was closed in the middle of operation)
  2. Task exception was never retrieved
  3. future: <Task finished name='Task-4' coro=<calculate_score() done, defined at C:\Users\moowi\Documents\GitHub\bpl-backend\app\poe\calculate_score.py:866> exception=DBAPIError("(sqlalchemy.dialects.postgresql.asyncpg.Error) <class 'asyncpg.exceptions.ConnectionDoesNotExistError'>: connection was closed in the middle of operation")>
  4. Traceback (most recent call last):
  5. File "C:\Users\moowi\Documents\GitHub\bpl-backend\.venv\lib\site-packages\sqlalchemy\dialects\postgresql\asyncpg.py", line 388, in _prepare_and_execute
  6. prepared_stmt, attributes = await adapt_connection._prepare(
  7. File "C:\Users\moowi\Documents\GitHub\bpl-backend\.venv\lib\site-packages\sqlalchemy\dialects\postgresql\asyncpg.py", line 630, in _prepare
  8. prepared_stmt = await self._connection.prepare(operation)
  9. File "C:\Users\moowi\Documents\GitHub\bpl-backend\.venv\lib\site-packages\asyncpg\connection.py", line 548, in prepare
  10. return await self._prepare(
  11. File "C:\Users\moowi\Documents\GitHub\bpl-backend\.venv\lib\site-packages\asyncpg\connection.py", line 564, in _prepare
  12. stmt = await self._get_statement(
  13. File "C:\Users\moowi\Documents\GitHub\bpl-backend\.venv\lib\site-packages\asyncpg\connection.py", line 408, in _get_statement
  14. types, intro_stmt = await self._introspect_types(
  15. File "C:\Users\moowi\Documents\GitHub\bpl-backend\.venv\lib\site-packages\asyncpg\connection.py", line 454, in _introspect_types
  16. return await self.__execute(
  17. File "C:\Users\moowi\Documents\GitHub\bpl-backend\.venv\lib\site-packages\asyncpg\connection.py", line 1664, in __execute
  18. return await self._do_execute(
  19. File "C:\Users\moowi\Documents\GitHub\bpl-backend\.venv\lib\site-packages\asyncpg\connection.py", line 1711, in _do_execute
  20. result = await executor(stmt, None)
  21. File "asyncpg\protocol\protocol.pyx", line 201, in bind_execute
  22. asyncpg.exceptions.ConnectionDoesNotExistError: connection was closed in the middle of operation
  23.  
  24. The above exception was the direct cause of the following exception:
  25.  
  26. Traceback (most recent call last):
  27. File "C:\Users\moowi\Documents\GitHub\bpl-backend\.venv\lib\site-packages\sqlalchemy\engine\base.py", line 1771, in _execute_context
  28. self.dialect.do_execute(
  29. File "C:\Users\moowi\Documents\GitHub\bpl-backend\.venv\lib\site-packages\sqlalchemy\engine\default.py", line 717, in do_execute
  30. cursor.execute(statement, parameters)
  31. File "C:\Users\moowi\Documents\GitHub\bpl-backend\.venv\lib\site-packages\sqlalchemy\dialects\postgresql\asyncpg.py", line 449, in execute
  32. self._adapt_connection.await_(
  33. File "C:\Users\moowi\Documents\GitHub\bpl-backend\.venv\lib\site-packages\sqlalchemy\util\_concurrency_py3k.py", line 69, in await_only
  34. return current.driver.switch(awaitable)
  35. File "C:\Users\moowi\Documents\GitHub\bpl-backend\.venv\lib\site-packages\sqlalchemy\util\_concurrency_py3k.py", line 122, in greenlet_spawn
  36. value = await result
  37. File "C:\Users\moowi\Documents\GitHub\bpl-backend\.venv\lib\site-packages\sqlalchemy\dialects\postgresql\asyncpg.py", line 424, in _prepare_and_execute
  38. self._handle_exception(error)
  39. File "C:\Users\moowi\Documents\GitHub\bpl-backend\.venv\lib\site-packages\sqlalchemy\dialects\postgresql\asyncpg.py", line 358, in _handle_exception
  40. self._adapt_connection._handle_exception(error)
  41. File "C:\Users\moowi\Documents\GitHub\bpl-backend\.venv\lib\site-packages\sqlalchemy\dialects\postgresql\asyncpg.py", line 652, in _handle_exception
  42. raise translated_error from error
  43. sqlalchemy.dialects.postgresql.asyncpg.AsyncAdapt_asyncpg_dbapi.Error: <class 'asyncpg.exceptions.ConnectionDoesNotExistError'>: connection was closed in the middle of operation
  44.  
  45. The above exception was the direct cause of the following exception:
  46.  
  47. Traceback (most recent call last):
  48. File "C:\Users\moowi\Documents\GitHub\bpl-backend\app\poe\calculate_score.py", line 871, in calculate_score
  49. lead_info = await fetch_lead_info(conn)
  50. File "C:\Users\moowi\Documents\GitHub\bpl-backend\app\poe\calculate_score.py", line 215, in fetch_lead_info
  51. event_id = (await get_current_event(db)).id
  52. File "C:\Users\moowi\Documents\GitHub\bpl-backend\app\crud\event.py", line 43, in get_current_event
  53. event = (await db.execute(event_query)).scalar()
  54. File "C:\Users\moowi\Documents\GitHub\bpl-backend\.venv\lib\site-packages\sqlalchemy\ext\asyncio\session.py", line 143, in execute
  55. return await greenlet_spawn(
  56. File "C:\Users\moowi\Documents\GitHub\bpl-backend\.venv\lib\site-packages\sqlalchemy\util\_concurrency_py3k.py", line 129, in greenlet_spawn
  57. result = context.switch(value)
  58. File "C:\Users\moowi\Documents\GitHub\bpl-backend\.venv\lib\site-packages\sqlalchemy\orm\session.py", line 1692, in execute
  59. result = compile_state_cls.orm_setup_cursor_result(
  60. File "C:\Users\moowi\Documents\GitHub\bpl-backend\.venv\lib\site-packages\sqlalchemy\orm\context.py", line 327, in orm_setup_cursor_result
  61. return loading.instances(result, querycontext)
  62. File "C:\Users\moowi\Documents\GitHub\bpl-backend\.venv\lib\site-packages\sqlalchemy\orm\loading.py", line 169, in instances
  63. _prebuffered = list(chunks(None))
  64. File "C:\Users\moowi\Documents\GitHub\bpl-backend\.venv\lib\site-packages\sqlalchemy\orm\loading.py", line 158, in chunks
  65. post_load.invoke(context, path)
  66. File "C:\Users\moowi\Documents\GitHub\bpl-backend\.venv\lib\site-packages\sqlalchemy\orm\loading.py", line 1329, in invoke
  67. loader(context, path, states, self.load_keys, *arg, **kw)
  68. File "C:\Users\moowi\Documents\GitHub\bpl-backend\.venv\lib\site-packages\sqlalchemy\orm\strategies.py", line 2997, in _load_for_path
  69. self._load_via_parent(our_states, query_info, q, context)
  70. File "C:\Users\moowi\Documents\GitHub\bpl-backend\.venv\lib\site-packages\sqlalchemy\orm\strategies.py", line 3060, in _load_via_parent
  71. context.session.execute(
  72. File "C:\Users\moowi\Documents\GitHub\bpl-backend\.venv\lib\site-packages\sqlalchemy\orm\session.py", line 1689, in execute
  73. result = conn._execute_20(statement, params or {}, execution_options)
  74. File "C:\Users\moowi\Documents\GitHub\bpl-backend\.venv\lib\site-packages\sqlalchemy\engine\base.py", line 1583, in _execute_20
  75. return meth(self, args_10style, kwargs_10style, execution_options)
  76. File "C:\Users\moowi\Documents\GitHub\bpl-backend\.venv\lib\site-packages\sqlalchemy\sql\elements.py", line 323, in _execute_on_connection
  77. return connection._execute_clauseelement(
  78. File "C:\Users\moowi\Documents\GitHub\bpl-backend\.venv\lib\site-packages\sqlalchemy\engine\base.py", line 1452, in _execute_clauseelement
  79. ret = self._execute_context(
  80. File "C:\Users\moowi\Documents\GitHub\bpl-backend\.venv\lib\site-packages\sqlalchemy\engine\base.py", line 1814, in _execute_context
  81. self._handle_dbapi_exception(
  82. File "C:\Users\moowi\Documents\GitHub\bpl-backend\.venv\lib\site-packages\sqlalchemy\engine\base.py", line 1995, in _handle_dbapi_exception
  83. util.raise_(
  84. File "C:\Users\moowi\Documents\GitHub\bpl-backend\.venv\lib\site-packages\sqlalchemy\util\compat.py", line 207, in raise_
  85. raise exception
  86. File "C:\Users\moowi\Documents\GitHub\bpl-backend\.venv\lib\site-packages\sqlalchemy\engine\base.py", line 1771, in _execute_context
  87. self.dialect.do_execute(
  88. File "C:\Users\moowi\Documents\GitHub\bpl-backend\.venv\lib\site-packages\sqlalchemy\engine\default.py", line 717, in do_execute
  89. cursor.execute(statement, parameters)
  90. File "C:\Users\moowi\Documents\GitHub\bpl-backend\.venv\lib\site-packages\sqlalchemy\dialects\postgresql\asyncpg.py", line 449, in execute
  91. self._adapt_connection.await_(
  92. File "C:\Users\moowi\Documents\GitHub\bpl-backend\.venv\lib\site-packages\sqlalchemy\util\_concurrency_py3k.py", line 69, in await_only
  93. return current.driver.switch(awaitable)
  94. File "C:\Users\moowi\Documents\GitHub\bpl-backend\.venv\lib\site-packages\sqlalchemy\util\_concurrency_py3k.py", line 122, in greenlet_spawn
  95. value = await result
  96. File "C:\Users\moowi\Documents\GitHub\bpl-backend\.venv\lib\site-packages\sqlalchemy\dialects\postgresql\asyncpg.py", line 424, in _prepare_and_execute
  97. self._handle_exception(error)
  98. File "C:\Users\moowi\Documents\GitHub\bpl-backend\.venv\lib\site-packages\sqlalchemy\dialects\postgresql\asyncpg.py", line 358, in _handle_exception
  99. self._adapt_connection._handle_exception(error)
  100. File "C:\Users\moowi\Documents\GitHub\bpl-backend\.venv\lib\site-packages\sqlalchemy\dialects\postgresql\asyncpg.py", line 652, in _handle_exception
  101. raise translated_error from error
  102. sqlalchemy.exc.DBAPIError: (sqlalchemy.dialects.postgresql.asyncpg.Error) <class 'asyncpg.exceptions.ConnectionDoesNotExistError'>: connection was closed in the middle of operation
Add Comment
Please, Sign In to add comment