Replies: 1 comment · 6 replies
-
If I'm not mistaken, using Fly.io, you can attach your PostgreSQL cluster to your app (ref: https://fly.io/docs/postgres/managing/attach-detach/). By doing so, Fly will automatically set the When this variable is set, Fief will use it instead of the separate Try this and tell us how it goes! |
Beta Was this translation helpful? Give feedback.
All reactions
-
Would you be able to share the full Another thing: are you sure the SSL error has to do with the DB? It could come from other external connections, like Redis. Would be valuable if you could post the full stack trace as text. |
Beta Was this translation helpful? Give feedback.
All reactions
-
The full database url: And the full stack trace: ╭─────────────────────────────── Traceback (most recent call last) ────────────────────────────────╮
│ /usr/local/lib/python3.11/site-packages/fief/cli.py:356 in run_server │
│ │
│ 353 │ │ ) │
│ 354 │ │ │
│ 355 │ │ try: │
│ ❱ 356 │ │ │ loop.run_until_complete(create_main_fief_workspace()) │
│ 357 │ │ │ typer.echo("Main Fief workspace created") │
│ 358 │ │ except MainWorkspaceAlreadyExists: │
│ 359 │ │ │ typer.echo("Main Fief workspace already exists") │
│ │
│ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
│ │ create_main_fief_workspace = <function create_main_fief_workspace at 0x7f7d1658d1c0> │ │
│ │ create_main_user = True │ │
│ │ create_main_workspace = True │ │
│ │ host = '0.0.0.0' │ │
│ │ loop = <_UnixSelectorEventLoop running=False closed=False debug=False> │ │
│ │ MainWorkspaceAlreadyExists = <class │ │
│ │ 'fief.services.main_workspace.MainWorkspaceAlreadyExists'> │ │
│ │ migrate = True │ │
│ │ port = 8000 │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
│ │
│ /usr/local/lib/python3.11/asyncio/base_events.py:653 in run_until_complete │
│ │
│ 650 │ │ if not future.done(): │
│ 651 │ │ │ raise RuntimeError('Event loop stopped before Future completed.') │
│ 652 │ │ │
│ ❱ 653 │ │ return future.result() │
│ 654 │ │
│ 655 │ def stop(self): │
│ 656 │ │ """Stop running the event loop. │
│ │
│ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
│ │ future = <Task finished name='Task-1' coro=<create_main_fief_workspace() done, defined at │ │
│ │ /usr/local/lib/python3.11/site-packages/fief/services/main_workspace.py:71> │ │
│ │ exception=ConnectionResetError()> │ │
│ │ new_task = True │ │
│ │ self = <_UnixSelectorEventLoop running=False closed=False debug=False> │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
│ │
│ /usr/local/lib/python3.11/site-packages/fief/services/main_workspace.py:80 in │
│ create_main_fief_workspace │
│ │
│ 77 │ async with main_async_session_maker() as session: │
│ 78 │ │ workspace_repository = WorkspaceRepository(session) │
│ 79 │ │ workspace_user_repository = WorkspaceUserRepository(session) │
│ ❱ 80 │ │ workspace = await workspace_repository.get_main() │
│ 81 │ │ │
│ 82 │ │ if workspace is not None: │
│ 83 │ │ │ raise MainWorkspaceAlreadyExists() │
│ │
│ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
│ │ main_async_session_maker = async_sessionmaker(class_='AsyncSession', │ │
│ │ bind=<sqlalchemy.ext.asyncio.engine.AsyncEngine object at │ │
│ │ 0x7f7d179fa700>, autoflush=True, expire_on_commit=False) │ │
│ │ session = <sqlalchemy.ext.asyncio.session.AsyncSession object at │ │
│ │ 0x7f7d17dfd210> │ │
│ │ workspace_engine_manager = <fief.db.workspace.WorkspaceEngineManager object at │ │
│ │ 0x7f7d167e5a90> │ │
│ │ workspace_repository = <fief.repositories.workspace.WorkspaceRepository object at │ │
│ │ 0x7f7d165921d0> │ │
│ │ workspace_user_repository = <fief.repositories.workspace_user.WorkspaceUserRepository object │ │
│ │ at 0x7f7d16592250> │ │
│ │ WorkspaceCreation = <class 'fief.services.workspace_creation.WorkspaceCreation'> │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
│ │
│ /usr/local/lib/python3.11/site-packages/fief/repositories/workspace.py:29 in get_main │
│ │
│ 26 │ │ return await self.get_one_or_none(statement) │
│ 27 │ │
│ 28 │ async def get_main(self) -> Workspace | None: │
│ ❱ 29 │ │ return await self.get_by_domain(settings.fief_domain) │
│ 30 │ │
│ 31 │ async def get_available_subdomain(self, name: str) -> str: │
│ 32 │ │ slug = slugify(name) │
│ │
│ ╭───────────────────────────────────── locals ──────────────────────────────────────╮ │
│ │ self = <fief.repositories.workspace.WorkspaceRepository object at 0x7f7d165921d0> │ │
│ ╰───────────────────────────────────────────────────────────────────────────────────╯ │
│ │
│ /usr/local/lib/python3.11/site-packages/fief/repositories/workspace.py:26 in get_by_domain │
│ │
│ 23 │ │
│ 24 │ async def get_by_domain(self, domain: str) -> Workspace | None: │
│ 25 │ │ statement = select(Workspace).where(Workspace.domain == domain) │
│ ❱ 26 │ │ return await self.get_one_or_none(statement) │
│ 27 │ │
│ 28 │ async def get_main(self) -> Workspace | None: │
│ 29 │ │ return await self.get_by_domain(settings.fief_domain) │
│ │
│ ╭──────────────────────────────────────── locals ────────────────────────────────────────╮ │
│ │ domain = 'test-deploy-fief.fly.dev' │ │
│ │ self = <fief.repositories.workspace.WorkspaceRepository object at 0x7f7d165921d0> │ │
│ │ statement = <sqlalchemy.sql.selectable.Select object at 0x7f7d169e3f10> │ │
│ ╰────────────────────────────────────────────────────────────────────────────────────────╯ │
│ │
│ /usr/local/lib/python3.11/site-packages/fief/repositories/base.py:132 in get_one_or_none │
│ │
│ 129 │ │ return await self.list(select(self.model)) │
│ 130 │ │
│ 131 │ async def get_one_or_none(self, statement: Select) -> M | None: │
│ ❱ 132 │ │ result = await self._execute_query(statement) │
│ 133 │ │ return result.scalar() │
│ 134 │ │
│ 135 │ async def create(self, object: M) -> M: │
│ │
│ ╭──────────────────────────────────────── locals ────────────────────────────────────────╮ │
│ │ self = <fief.repositories.workspace.WorkspaceRepository object at 0x7f7d165921d0> │ │
│ │ statement = <sqlalchemy.sql.selectable.Select object at 0x7f7d169e3f10> │ │
│ ╰────────────────────────────────────────────────────────────────────────────────────────╯ │
│ │
│ /usr/local/lib/python3.11/site-packages/fief/repositories/base.py:165 in _execute_query │
│ │
│ 162 │ │ return result.scalar_one() │
│ 163 │ │
│ 164 │ async def _execute_query(self, statement: Select) -> Result: │
│ ❱ 165 │ │ return await self.session.execute(statement) │
│ 166 │ │
│ 167 │ async def _execute_statement(self, statement: Executable) -> Result: │
│ 168 │ │ result = await self.session.execute(statement) │
│ │
│ ╭──────────────────────────────────────── locals ────────────────────────────────────────╮ │
│ │ self = <fief.repositories.workspace.WorkspaceRepository object at 0x7f7d165921d0> │ │
│ │ statement = <sqlalchemy.sql.selectable.Select object at 0x7f7d169e3f10> │ │
│ ╰────────────────────────────────────────────────────────────────────────────────────────╯ │
│ │
│ /usr/local/lib/python3.11/site-packages/sqlalchemy/ext/asyncio/session.py:313 in execute │
│ │
│ 310 │ │ else: │
│ 311 │ │ │ execution_options = _EXECUTE_OPTIONS │
│ 312 │ │ │
│ ❱ 313 │ │ result = await greenlet_spawn( │
│ 314 │ │ │ self.sync_session.execute, │
│ 315 │ │ │ statement, │
│ 316 │ │ │ params=params, │
│ │
│ ╭────────────────────────────────────────── locals ──────────────────────────────────────────╮ │
│ │ bind_arguments = None │ │
│ │ execution_options = immutabledict({'prebuffer_rows': True}) │ │
│ │ kw = {} │ │
│ │ params = None │ │
│ │ self = <sqlalchemy.ext.asyncio.session.AsyncSession object at 0x7f7d17dfd210> │ │
│ │ statement = <sqlalchemy.sql.selectable.Select object at 0x7f7d169e3f10> │ │
│ ╰────────────────────────────────────────────────────────────────────────────────────────────╯ │
│ │
│ /usr/local/lib/python3.11/site-packages/sqlalchemy/util/_concurrency_py3k.py:165 in │
│ greenlet_spawn │
│ │
│ 162 │ │ │ │ # this allows an exception to be raised within │
│ 163 │ │ │ │ # the moderated greenlet so that it can continue │
│ 164 │ │ │ │ # its expected flow. │
│ ❱ 165 │ │ │ │ result = context.throw(*sys.exc_info()) │
│ 166 │ │ │ else: │
│ 167 │ │ │ │ result = context.switch(value) │
│ 168 │ finally: │
│ │
│ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
│ │ _require_await = False │ │
│ │ args = (<sqlalchemy.sql.selectable.Select object at 0x7f7d169e3f10>,) │ │
│ │ context = <_AsyncIoGreenlet object at 0x7f7d16592280 (otid=0x7f7d1c145d70) dead> │ │
│ │ fn = <bound method Session.execute of <sqlalchemy.orm.session.Session object at │ │
│ │ 0x7f7d168a5ed0>> │ │
│ │ kwargs = { │ │
│ │ │ 'params': None, │ │
│ │ │ 'execution_options': immutabledict({'prebuffer_rows': True}), │ │
│ │ │ 'bind_arguments': None │ │
│ │ } │ │
│ │ result = <coroutine object connect at 0x7f7d166712f0> │ │
│ │ switch_occurred = True │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
│ │
│ /usr/local/lib/python3.11/site-packages/sqlalchemy/orm/session.py:2229 in execute │
│ │
│ 2226 │ │ │
│ 2227 │ │ │
│ 2228 │ │ """ │
│ ❱ 2229 │ │ return self._execute_internal( │
│ 2230 │ │ │ statement, │
│ 2231 │ │ │ params, │
│ 2232 │ │ │ execution_options=execution_options, │
│ │
│ ╭────────────────────────────────────── locals ───────────────────────────────────────╮ │
│ │ _add_event = None │ │
│ │ _parent_execute_state = None │ │
│ │ bind_arguments = None │ │
│ │ execution_options = immutabledict({'prebuffer_rows': True}) │ │
│ │ params = None │ │
│ │ self = <sqlalchemy.orm.session.Session object at 0x7f7d168a5ed0> │ │
│ │ statement = <sqlalchemy.sql.selectable.Select object at 0x7f7d169e3f10> │ │
│ ╰─────────────────────────────────────────────────────────────────────────────────────╯ │
│ │
│ /usr/local/lib/python3.11/site-packages/sqlalchemy/orm/session.py:2114 in _execute_internal │
│ │
│ 2111 │ │ │
│ 2112 │ │ bind = self.get_bind(**bind_arguments) │
│ 2113 │ │ │
│ ❱ 2114 │ │ conn = self._connection_for_bind(bind) │
│ 2115 │ │ │
│ 2116 │ │ if _scalar_result and not compile_state_cls: │
│ 2117 │ │ │ if TYPE_CHECKING: │
│ │
│ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
│ │ _add_event = None │ │
│ │ _parent_execute_state = None │ │
│ │ _scalar_result = False │ │
│ │ bind = Engine(postgresql+asyncpg://test_deploy_fief:***@test-deploy-fief-d… │ │
│ │ bind_arguments = { │ │
│ │ │ 'clause': <sqlalchemy.sql.selectable.Select object at │ │
│ │ 0x7f7d169e3f10>, │ │
│ │ │ 'mapper': <Mapper at 0x7f7d17dfccd0; Workspace> │ │
│ │ } │ │
│ │ compile_state_cls = <class 'sqlalchemy.orm.context.ORMSelectCompileState'> │ │
│ │ events_todo = <sqlalchemy.event.attr._EmptyListener object at 0x7f7d167e4e00> │ │
│ │ execution_options = immutabledict({'prebuffer_rows': True, │ │
│ │ '_result_disable_adapt_to_context': True}) │ │
│ │ params = None │ │
│ │ self = <sqlalchemy.orm.session.Session object at 0x7f7d168a5ed0> │ │
│ │ statement = <sqlalchemy.sql.selectable.Select object at 0x7f7d169e3f10> │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
│ │
│ /usr/local/lib/python3.11/site-packages/sqlalchemy/orm/session.py:1981 in _connection_for_bind │
│ │
│ 1978 │ │ trans = self._transaction │
│ 1979 │ │ if trans is None: │
│ 1980 │ │ │ trans = self._autobegin_t() │
│ ❱ 1981 │ │ return trans._connection_for_bind(engine, execution_options) │
│ 1982 │ │
│ 1983 │ @overload │
│ 1984 │ def _execute_internal( │
│ │
│ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
│ │ engine = Engine(postgresql+asyncpg://test_deploy_fief:***@test-deploy-fief-db.fl… │ │
│ │ execution_options = None │ │
│ │ kw = {} │ │
│ │ self = <sqlalchemy.orm.session.Session object at 0x7f7d168a5ed0> │ │
│ │ trans = <sqlalchemy.orm.session.SessionTransaction object at 0x7f7d17c18c80> │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
│ in _connection_for_bind │
│ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
│ │ bind = Engine(postgresql+asyncpg://test_deploy_fief:***@test-deploy-fief-db.fl… │ │
│ │ execution_options = None │ │
│ │ self = <sqlalchemy.orm.session.SessionTransaction object at 0x7f7d17c18c80> │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
│ │
│ /usr/local/lib/python3.11/site-packages/sqlalchemy/orm/state_changes.py:137 in _go │
│ │
│ 134 │ │ │ self._current_fn = fn │
│ 135 │ │ │ self._next_state = _StateChangeStates.CHANGE_IN_PROGRESS │
│ 136 │ │ │ try: │
│ ❱ 137 │ │ │ │ ret_value = fn(self, *arg, **kw) │
│ 138 │ │ │ except: │
│ 139 │ │ │ │ raise │
│ 140 │ │ │ else: │
│ │
│ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
│ │ arg = ( │ │
│ │ │ │ │
│ │ Engine(postgresql+asyncpg://test_deploy_fief:***@test-deplo… │ │
│ │ │ None │ │
│ │ ) │ │
│ │ current_state = <SessionTransactionState.ACTIVE: 1> │ │
│ │ existing_fn = None │ │
│ │ expect_state = <SessionTransactionState.ACTIVE: 1> │ │
│ │ expect_state_change = False │ │
│ │ fn = <function SessionTransaction._connection_for_bind at │ │
│ │ 0x7f7d1961fd80> │ │
│ │ has_prerequisite_states = True │ │
│ │ kw = {} │ │
│ │ moves_to = <_StateChangeStates.NO_CHANGE: 2> │ │
│ │ next_state = <_StateChangeStates.ANY: 1> │ │
│ │ prerequisite_state_collection = (<SessionTransactionState.ACTIVE: 1>,) │ │
│ │ self = <sqlalchemy.orm.session.SessionTransaction object at │ │
│ │ 0x7f7d17c18c80> │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
│ │
│ /usr/local/lib/python3.11/site-packages/sqlalchemy/orm/session.py:1108 in _connection_for_bind │
│ │
│ 1105 │ │ │ │ │ │ "given Connection's Engine" │
│ 1106 │ │ │ │ │ ) │
│ 1107 │ │ │ else: │
│ ❱ 1108 │ │ │ │ conn = bind.connect() │
│ 1109 │ │ │ │ local_connect = True │
│ 1110 │ │ │
│ 1111 │ │ try: │
│ │
│ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
│ │ bind = Engine(postgresql+asyncpg://test_deploy_fief:***@test-deploy-fief-db.fl… │ │
│ │ execution_options = None │ │
│ │ local_connect = False │ │
│ │ self = <sqlalchemy.orm.session.SessionTransaction object at 0x7f7d17c18c80> │ │
│ │ should_commit = True │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
│ │
│ /usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py:3251 in connect │
│ │
│ 3248 │ │ │
│ 3249 │ │ """ │
│ 3250 │ │ │
│ ❱ 3251 │ │ return self._connection_cls(self) │
│ 3252 │ │
│ 3253 │ def raw_connection(self) -> PoolProxiedConnection: │
│ 3254 │ │ """Return a "raw" DBAPI connection from the connection pool. │
│ │
│ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
│ │ self = Engine(postgresql+asyncpg://test_deploy_fief:***@test-deploy-fief-db.flycast:5432/te… │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
│ │
│ /usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py:145 in __init__ │
│ │
│ 142 │ │ │
│ 143 │ │ if connection is None: │
│ 144 │ │ │ try: │
│ ❱ 145 │ │ │ │ self._dbapi_connection = engine.raw_connection() │
│ 146 │ │ │ except dialect.loaded_dbapi.Error as err: │
│ 147 │ │ │ │ Connection._handle_dbapi_exception_noconnection( │
│ 148 │ │ │ │ │ err, dialect, engine │
│ │
│ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
│ │ _allow_autobegin = True │ │
│ │ _allow_revalidate = True │ │
│ │ _has_events = None │ │
│ │ connection = None │ │
│ │ dialect = <sqlalchemy.dialects.postgresql.asyncpg.PGDialect_asyncpg object at │ │
│ │ 0x7f7d16591610> │ │
│ │ engine = Engine(postgresql+asyncpg://test_deploy_fief:***@test-deploy-fief-db.fl… │ │
│ │ self = <sqlalchemy.engine.base.Connection object at 0x7f7d16592a90> │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
│ │
│ /usr/local/lib/python3.11/site-packages/sqlalchemy/engine/base.py:3275 in raw_connection │
│ │
│ 3272 │ │ │ :ref:`dbapi_connections` │
│ 3273 │ │ │
│ 3274 │ │ """ │
│ ❱ 3275 │ │ return self.pool.connect() │
│ 3276 │
│ 3277 │
│ 3278 class OptionEngineMixin(log.Identified): │
│ │
│ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
│ │ self = Engine(postgresql+asyncpg://test_deploy_fief:***@test-deploy-fief-db.flycast:5432/te… │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
│ │
│ /usr/local/lib/python3.11/site-packages/sqlalchemy/pool/base.py:455 in connect │
│ │
│ 452 │ │ the pool. │
│ 453 │ │ │
│ 454 │ │ """ │
│ ❱ 455 │ │ return _ConnectionFairy._checkout(self) │
│ 456 │ │
│ 457 │ def _return_conn(self, record: ConnectionPoolEntry) -> None: │
│ 458 │ │ """Given a _ConnectionRecord, return it to the :class:`_pool.Pool`. │
│ │
│ ╭─────────────────────────────────── locals ───────────────────────────────────╮ │
│ │ self = <sqlalchemy.pool.impl.AsyncAdaptedQueuePool object at 0x7f7d16591c50> │ │
│ ╰──────────────────────────────────────────────────────────────────────────────╯ │
│ │
│ /usr/local/lib/python3.11/site-packages/sqlalchemy/pool/base.py:1271 in _checkout │
│ │
│ 1268 │ ) -> _ConnectionFairy: │
│ 1269 │ │ │
│ 1270 │ │ if not fairy: │
│ ❱ 1271 │ │ │ fairy = _ConnectionRecord.checkout(pool) │
│ 1272 │ │ │ │
│ 1273 │ │ │ if threadconns is not None: │
│ 1274 │ │ │ │ threadconns.current = weakref.ref(fairy) │
│ │
│ ╭────────────────────────────────────── locals ───────────────────────────────────────╮ │
│ │ cls = <class 'sqlalchemy.pool.base._ConnectionFairy'> │ │
│ │ fairy = None │ │
│ │ pool = <sqlalchemy.pool.impl.AsyncAdaptedQueuePool object at 0x7f7d16591c50> │ │
│ │ threadconns = None │ │
│ ╰─────────────────────────────────────────────────────────────────────────────────────╯ │
│ │
│ /usr/local/lib/python3.11/site-packages/sqlalchemy/pool/base.py:719 in checkout │
│ │
│ 716 │ │ if TYPE_CHECKING: │
│ 717 │ │ │ rec = cast(_ConnectionRecord, pool._do_get()) │
│ 718 │ │ else: │
│ ❱ 719 │ │ │ rec = pool._do_get() │
│ 720 │ │ │
│ 721 │ │ try: │
│ 722 │ │ │ dbapi_connection = rec.get_connection() │
│ │
│ ╭─────────────────────────────────── locals ───────────────────────────────────╮ │
│ │ cls = <class 'sqlalchemy.pool.base._ConnectionRecord'> │ │
│ │ pool = <sqlalchemy.pool.impl.AsyncAdaptedQueuePool object at 0x7f7d16591c50> │ │
│ ╰──────────────────────────────────────────────────────────────────────────────╯ │
│ │
│ /usr/local/lib/python3.11/site-packages/sqlalchemy/pool/impl.py:168 in _do_get │
│ │
│ 165 │ │ │ try: │
│ 166 │ │ │ │ return self._create_connection() │
│ 167 │ │ │ except: │
│ ❱ 168 │ │ │ │ with util.safe_reraise(): │
│ 169 │ │ │ │ │ self._dec_overflow() │
│ 170 │ │ │ │ raise │
│ 171 │ │ else: │
│ │
│ ╭─────────────────────────────────────── locals ───────────────────────────────────────╮ │
│ │ self = <sqlalchemy.pool.impl.AsyncAdaptedQueuePool object at 0x7f7d16591c50> │ │
│ │ use_overflow = True │ │
│ │ wait = False │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────╯ │
│ │
│ /usr/local/lib/python3.11/site-packages/sqlalchemy/util/langhelpers.py:147 in __exit__ │
│ │
│ 144 │ │ │ exc_type, exc_value, exc_tb = self._exc_info │
│ 145 │ │ │ assert exc_value is not None │
│ 146 │ │ │ self._exc_info = None # remove potential circular references │
│ ❱ 147 │ │ │ raise exc_value.with_traceback(exc_tb) │
│ 148 │ │ else: │
│ 149 │ │ │ self._exc_info = None # remove potential circular references │
│ 150 │ │ │ assert value is not None │
│ │
│ ╭──────────────────────────────────── locals ─────────────────────────────────────╮ │
│ │ exc_tb = <traceback object at 0x7f7d16593880> │ │
│ │ exc_type = <class 'ConnectionResetError'> │ │
│ │ exc_value = ConnectionResetError() │ │
│ │ self = <sqlalchemy.util.langhelpers.safe_reraise object at 0x7f7d167665c0> │ │
│ │ traceback = None │ │
│ │ type_ = None │ │
│ │ value = None │ │
│ ╰─────────────────────────────────────────────────────────────────────────────────╯ │
│ │
│ /usr/local/lib/python3.11/site-packages/sqlalchemy/pool/impl.py:166 in _do_get │
│ │
│ 163 │ │ │
│ 164 │ │ if self._inc_overflow(): │
│ 165 │ │ │ try: │
│ ❱ 166 │ │ │ │ return self._create_connection() │
│ 167 │ │ │ except: │
│ 168 │ │ │ │ with util.safe_reraise(): │
│ 169 │ │ │ │ │ self._dec_overflow() │
│ │
│ ╭─────────────────────────────────────── locals ───────────────────────────────────────╮ │
│ │ self = <sqlalchemy.pool.impl.AsyncAdaptedQueuePool object at 0x7f7d16591c50> │ │
│ │ use_overflow = True │ │
│ │ wait = False │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────╯ │
│ │
│ /usr/local/lib/python3.11/site-packages/sqlalchemy/pool/base.py:396 in _create_connection │
│ │
│ 393 │ def _create_connection(self) -> ConnectionPoolEntry: │
│ 394 │ │ """Called by subclasses to create a new ConnectionRecord.""" │
│ 395 │ │ │
│ ❱ 396 │ │ return _ConnectionRecord(self) │
│ 397 │ │
│ 398 │ def _invalidate( │
│ 399 │ │ self, │
│ │
│ ╭─────────────────────────────────── locals ───────────────────────────────────╮ │
│ │ self = <sqlalchemy.pool.impl.AsyncAdaptedQueuePool object at 0x7f7d16591c50> │ │
│ ╰──────────────────────────────────────────────────────────────────────────────╯ │
│ │
│ /usr/local/lib/python3.11/site-packages/sqlalchemy/pool/base.py:681 in __init__ │
│ │
│ 678 │ │ │
│ 679 │ │ self.__pool = pool │
│ 680 │ │ if connect: │
│ ❱ 681 │ │ │ self.__connect() │
│ 682 │ │ self.finalize_callback = deque() │
│ 683 │ │
│ 684 │ dbapi_connection: Optional[DBAPIConnection] │
│ │
│ ╭──────────────────────────────────── locals ─────────────────────────────────────╮ │
│ │ connect = True │ │
│ │ pool = <sqlalchemy.pool.impl.AsyncAdaptedQueuePool object at 0x7f7d16591c50> │ │
│ │ self = <sqlalchemy.pool.base._ConnectionRecord object at 0x7f7d166ddc50> │ │
│ ╰─────────────────────────────────────────────────────────────────────────────────╯ │
│ │
│ /usr/local/lib/python3.11/site-packages/sqlalchemy/pool/base.py:905 in __connect │
│ │
│ 902 │ │ │ pool.logger.debug("Created new connection %r", connection) │
│ 903 │ │ │ self.fresh = True │
│ 904 │ │ except BaseException as e: │
│ ❱ 905 │ │ │ with util.safe_reraise(): │
│ 906 │ │ │ │ pool.logger.debug("Error on connect(): %s", e) │
│ 907 │ │ else: │
│ 908 │ │ │ # in SQLAlchemy 1.4 the first_connect event is not used by │
│ │
│ ╭─────────────────────────────────── locals ───────────────────────────────────╮ │
│ │ pool = <sqlalchemy.pool.impl.AsyncAdaptedQueuePool object at 0x7f7d16591c50> │ │
│ │ self = <sqlalchemy.pool.base._ConnectionRecord object at 0x7f7d166ddc50> │ │
│ ╰──────────────────────────────────────────────────────────────────────────────╯ │
│ │
│ /usr/local/lib/python3.11/site-packages/sqlalchemy/util/langhelpers.py:147 in __exit__ │
│ │
│ 144 │ │ │ exc_type, exc_value, exc_tb = self._exc_info │
│ 145 │ │ │ assert exc_value is not None │
│ 146 │ │ │ self._exc_info = None # remove potential circular references │
│ ❱ 147 │ │ │ raise exc_value.with_traceback(exc_tb) │
│ 148 │ │ else: │
│ 149 │ │ │ self._exc_info = None # remove potential circular references │
│ 150 │ │ │ assert value is not None │
│ │
│ ╭──────────────────────────────────── locals ─────────────────────────────────────╮ │
│ │ exc_tb = <traceback object at 0x7f7d16593740> │ │
│ │ exc_type = <class 'ConnectionResetError'> │ │
│ │ exc_value = ConnectionResetError() │ │
│ │ self = <sqlalchemy.util.langhelpers.safe_reraise object at 0x7f7d16766590> │ │
│ │ traceback = None │ │
│ │ type_ = None │ │
│ │ value = None │ │
│ ╰─────────────────────────────────────────────────────────────────────────────────╯ │
│ │
│ /usr/local/lib/python3.11/site-packages/sqlalchemy/pool/base.py:901 in __connect │
│ │
│ 898 │ │ self.dbapi_connection = None │
│ 899 │ │ try: │
│ 900 │ │ │ self.starttime = time.time() │
│ ❱ 901 │ │ │ self.dbapi_connection = connection = pool._invoke_creator(self) │
│ 902 │ │ │ pool.logger.debug("Created new connection %r", connection) │
│ 903 │ │ │ self.fresh = True │
│ 904 │ │ except BaseException as e: │
│ │
│ ╭─────────────────────────────────── locals ───────────────────────────────────╮ │
│ │ pool = <sqlalchemy.pool.impl.AsyncAdaptedQueuePool object at 0x7f7d16591c50> │ │
│ │ self = <sqlalchemy.pool.base._ConnectionRecord object at 0x7f7d166ddc50> │ │
│ ╰──────────────────────────────────────────────────────────────────────────────╯ │
│ │
│ /usr/local/lib/python3.11/site-packages/sqlalchemy/engine/create.py:636 in connect │
│ │
│ 633 │ │ │ │ │ if connection is not None: │
│ 634 │ │ │ │ │ │ return connection │
│ 635 │ │ │ │
│ ❱ 636 │ │ │ return dialect.connect(*cargs, **cparams) │
│ 637 │ │ │
│ 638 │ │ creator = pop_kwarg("creator", connect) │
│ 639 │
│ │
│ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
│ │ cargs = [] │ │
│ │ connection_record = <sqlalchemy.pool.base._ConnectionRecord object at 0x7f7d166ddc50> │ │
│ │ cparams = { │ │
│ │ │ 'host': 'test-deploy-fief-db.flycast', │ │
│ │ │ 'database': 'DB' │ │
│ │ │ 'user': 'USER', │ │
│ │ │ 'password': 'PASSWORD', │ │
│ │ │ 'port': 5432 │ │
│ │ } │ │
│ │ dialect = <sqlalchemy.dialects.postgresql.asyncpg.PGDialect_asyncpg object at │ │
│ │ 0x7f7d16591610> │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
│ │
│ /usr/local/lib/python3.11/site-packages/sqlalchemy/engine/default.py:580 in connect │
│ │
│ 577 │ │
│ 578 │ def connect(self, *cargs, **cparams): │
│ 579 │ │ # inherits the docstring from interfaces.Dialect.connect │
│ ❱ 580 │ │ return self.loaded_dbapi.connect(*cargs, **cparams) │
│ 581 │ │
│ 582 │ def create_connect_args(self, url): │
│ 583 │ │ # inherits the docstring from interfaces.Dialect.create_connect_args │
│ │
│ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
│ │ cargs = () │ │
│ │ cparams = { │ │
│ │ │ 'host': 'test-deploy-fief-db.flycast', │ │
│ │ │ 'database': 'DB' │ │
│ │ │ 'user': 'USER', │ │
│ │ │ 'password': 'PASSWORD', │ │
│ │ │ 'port': 5432 │ │
│ │ } │ │
│ │ self = <sqlalchemy.dialects.postgresql.asyncpg.PGDialect_asyncpg object at │ │
│ │ 0x7f7d16591610> │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
│ │
│ /usr/local/lib/python3.11/site-packages/sqlalchemy/dialects/postgresql/asyncpg.py:821 in connect │
│ │
│ 818 │ │ else: │
│ 819 │ │ │ return AsyncAdapt_asyncpg_connection( │
│ 820 │ │ │ │ self, │
│ ❱ 821 │ │ │ │ await_only(self.asyncpg.connect(*arg, **kw)), │
│ 822 │ │ │ │ prepared_statement_cache_size=prepared_statement_cache_size, │
│ 823 │ │ │ ) │
│ 824 │
│ │
│ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
│ │ arg = () │ │
│ │ async_fallback = False │ │
│ │ kw = { │ │
│ │ │ 'host': 'test-deploy-fief-db.flycast', │ │
│ │ │ 'database': 'DB' │ │
│ │ │ 'user': 'USER', │ │
│ │ │ 'password': 'PASSWORD', │ │
│ │ │ 'port': 5432 │ │
│ │ } │ │
│ │ prepared_statement_cache_size = 100 │ │
│ │ self = <sqlalchemy.dialects.postgresql.asyncpg.AsyncAdapt_asyncpg_… │ │
│ │ object at 0x7f7d165915d0> │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
│ │
│ /usr/local/lib/python3.11/site-packages/sqlalchemy/util/_concurrency_py3k.py:102 in await_only │
│ │
│ 99 │ # a coroutine to run. Once the awaitable is done, the driver greenlet │
│ 100 │ # switches back to this greenlet with the result of awaitable that is │
│ 101 │ # then returned to the caller (or raised as error) │
│ ❱ 102 │ return current.driver.switch(awaitable) # type: ignore[no-any-return] │
│ 103 │
│ 104 │
│ 105 def await_fallback(awaitable: Awaitable[_T]) -> _T: │
│ │
│ ╭────────────────────────────────────── locals ──────────────────────────────────────╮ │
│ │ awaitable = <coroutine object connect at 0x7f7d166712f0> │ │
│ │ current = <_AsyncIoGreenlet object at 0x7f7d16592280 (otid=0x7f7d1c145d70) dead> │ │
│ ╰────────────────────────────────────────────────────────────────────────────────────╯ │
│ │
│ /usr/local/lib/python3.11/site-packages/sqlalchemy/util/_concurrency_py3k.py:160 in │
│ greenlet_spawn │
│ │
│ 157 │ │ │ try: │
│ 158 │ │ │ │ # wait for a coroutine from await_only and then return its │
│ 159 │ │ │ │ # result back to it. │
│ ❱ 160 │ │ │ │ value = await result │
│ 161 │ │ │ except BaseException: │
│ 162 │ │ │ │ # this allows an exception to be raised within │
│ 163 │ │ │ │ # the moderated greenlet so that it can continue │
│ │
│ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
│ │ _require_await = False │ │
│ │ args = (<sqlalchemy.sql.selectable.Select object at 0x7f7d169e3f10>,) │ │
│ │ context = <_AsyncIoGreenlet object at 0x7f7d16592280 (otid=0x7f7d1c145d70) dead> │ │
│ │ fn = <bound method Session.execute of <sqlalchemy.orm.session.Session object at │ │
│ │ 0x7f7d168a5ed0>> │ │
│ │ kwargs = { │ │
│ │ │ 'params': None, │ │
│ │ │ 'execution_options': immutabledict({'prebuffer_rows': True}), │ │
│ │ │ 'bind_arguments': None │ │
│ │ } │ │
│ │ result = <coroutine object connect at 0x7f7d166712f0> │ │
│ │ switch_occurred = True │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
│ │
│ /usr/local/lib/python3.11/site-packages/asyncpg/connection.py:2092 in connect │
│ │
│ 2089 │ if loop is None: │
│ 2090 │ │ loop = asyncio.get_event_loop() │
│ 2091 │ │
│ ❱ 2092 │ return await connect_utils._connect( │
│ 2093 │ │ loop=loop, │
│ 2094 │ │ timeout=timeout, │
│ 2095 │ │ connection_class=connection_class, │
│ │
│ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
│ │ command_timeout = None │ │
│ │ connection_class = <class 'asyncpg.connection.Connection'> │ │
│ │ database = 'test_deploy_fief' │ │
│ │ direct_tls = False │ │
│ │ dsn = None │ │
│ │ host = 'test-deploy-fief-db.flycast' │ │
│ │ loop = <_UnixSelectorEventLoop running=False closed=False │ │
│ │ debug=False> │ │
│ │ max_cacheable_statement_size = 15360 │ │
│ │ max_cached_statement_lifetime = 300 │ │
│ │ passfile = None │ │
│ │ password = 'PASSWORD' │ │
│ │ port = 5432 │ │
│ │ record_class = <class 'asyncpg.Record'> │ │
│ │ server_settings = None │ │
│ │ ssl = None │ │
│ │ statement_cache_size = 100 │ │
│ │ timeout = 60 │ │
│ │ user = 'test_deploy_fief' │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
│ │
│ /usr/local/lib/python3.11/site-packages/asyncpg/connect_utils.py:895 in _connect │
│ │
│ 892 │ │ finally: │
│ 893 │ │ │ timeout -= time.monotonic() - before │
│ 894 │ │
│ ❱ 895 │ raise last_error │
│ 896 │
│ 897 │
│ 898 async def _cancel(*, loop, addr, params: _ConnectionParameters, │
│ │
│ ╭────────────────────────────────────── locals ──────────────────────────────────────╮ │
│ │ addr = ('test-deploy-fief-db.flycast', 5432) │ │
│ │ addrs = [('test-deploy-fief-db.flycast', 5432)] │ │
│ │ before = 121.78378457 │ │
│ │ config = ConnectionConfiguration( │ │
│ │ │ command_timeout=None, │ │
│ │ │ statement_cache_size=100, │ │
│ │ │ max_cached_statement_lifetime=300, │ │
│ │ │ max_cacheable_statement_size=15360 │ │
│ │ ) │ │
│ │ connection_class = <class 'asyncpg.connection.Connection'> │ │
│ │ kwargs = { │ │
│ │ │ 'dsn': None, │ │
│ │ │ 'host': 'test-deploy-fief-db.flycast', │ │
│ │ │ 'port': 5432, │ │
│ │ │ 'user': 'USER', │ │
│ │ │ 'password': 'PASSWORD', │ │
│ │ │ 'passfile': None, │ │
│ │ │ 'ssl': None, │ │
│ │ │ 'direct_tls': False, │ │
│ │ │ 'database': 'DB' │ │
│ │ │ 'server_settings': None, │ │
│ │ │ ... +4 │ │
│ │ } │ │
│ │ last_error = ConnectionResetError() │ │
│ │ loop = <_UnixSelectorEventLoop running=False closed=False debug=False> │ │
│ │ params = ConnectionParameters( │ │
│ │ │ user: 'USER', │ │
│ │ │ password='PASSWORD', │ │
│ │ │ database: 'DB' │ │
│ │ │ ssl=<ssl.SSLContext object at 0x7f7d166f5910>, │ │
│ │ │ sslmode=<SSLMode.prefer: 2>, │ │
│ │ │ direct_tls=False, │ │
│ │ │ connect_timeout=60, │ │
│ │ │ server_settings=None │ │
│ │ ) │ │
│ │ record_class = <class 'asyncpg.Record'> │ │
│ │ timeout = 59.34170834999999 │ │
│ ╰────────────────────────────────────────────────────────────────────────────────────╯ │
│ │
│ /usr/local/lib/python3.11/site-packages/asyncpg/connect_utils.py:881 in _connect │
│ │
│ 878 │ for addr in addrs: │
│ 879 │ │ before = time.monotonic() │
│ 880 │ │ try: │
│ ❱ 881 │ │ │ return await _connect_addr( │
│ 882 │ │ │ │ addr=addr, │
│ 883 │ │ │ │ loop=loop, │
│ 884 │ │ │ │ timeout=timeout, │
│ │
│ ╭────────────────────────────────────── locals ──────────────────────────────────────╮ │
│ │ addr = ('test-deploy-fief-db.flycast', 5432) │ │
│ │ addrs = [('test-deploy-fief-db.flycast', 5432)] │ │
│ │ before = 121.78378457 │ │
│ │ config = ConnectionConfiguration( │ │
│ │ │ command_timeout=None, │ │
│ │ │ statement_cache_size=100, │ │
│ │ │ max_cached_statement_lifetime=300, │ │
│ │ │ max_cacheable_statement_size=15360 │ │
│ │ ) │ │
│ │ connection_class = <class 'asyncpg.connection.Connection'> │ │
│ │ kwargs = { │ │
│ │ │ 'dsn': None, │ │
│ │ │ 'host': 'test-deploy-fief-db.flycast', │ │
│ │ │ 'port': 5432, │ │
│ │ │ 'user': 'USER', │ │
│ │ │ 'password': 'PASSWORD', │ │
│ │ │ 'passfile': None, │ │
│ │ │ 'ssl': None, │ │
│ │ │ 'direct_tls': False, │ │
│ │ │ 'database': 'DB' │ │
│ │ │ 'server_settings': None, │ │
│ │ │ ... +4 │ │
│ │ } │ │
│ │ last_error = ConnectionResetError() │ │
│ │ loop = <_UnixSelectorEventLoop running=False closed=False debug=False> │ │
│ │ params = ConnectionParameters( │ │
│ │ │ user: 'USER', │ │
│ │ │ password='PASSWORD', │ │
│ │ │ database: 'DB' │ │
│ │ │ ssl=<ssl.SSLContext object at 0x7f7d166f5910>, │ │
│ │ │ sslmode=<SSLMode.prefer: 2>, │ │
│ │ │ direct_tls=False, │ │
│ │ │ connect_timeout=60, │ │
│ │ │ server_settings=None │ │
│ │ ) │ │
│ │ record_class = <class 'asyncpg.Record'> │ │
│ │ timeout = 59.34170834999999 │ │
│ ╰────────────────────────────────────────────────────────────────────────────────────╯ │
│ │
│ /usr/local/lib/python3.11/site-packages/asyncpg/connect_utils.py:773 in _connect_addr │
│ │
│ 770 │ # first attempt │
│ 771 │ before = time.monotonic() │
│ 772 │ try: │
│ ❱ 773 │ │ return await __connect_addr(params, timeout, True, *args) │
│ 774 │ except _RetryConnectSignal: │
│ 775 │ │ pass │
│ 776 │
│ │
│ ╭──────────────────────────────────────── locals ─────────────────────────────────────────╮ │
│ │ addr = ('test-deploy-fief-db.flycast', 5432) │ │
│ │ args = ( │ │
│ │ │ ('test-deploy-fief-db.flycast', 5432), │ │
│ │ │ <_UnixSelectorEventLoop running=False closed=False debug=False>, │ │
│ │ │ ConnectionConfiguration( │ │
│ │ │ │ command_timeout=None, │ │
│ │ │ │ statement_cache_size=100, │ │
│ │ │ │ max_cached_statement_lifetime=300, │ │
│ │ │ │ max_cacheable_statement_size=15360 │ │
│ │ │ ), │ │
│ │ │ <class 'asyncpg.connection.Connection'>, │ │
│ │ │ <class 'asyncpg.Record'>, │ │
│ │ │ ConnectionParameters( │ │
│ │ │ │ user: 'USER', │ │
│ │ │ │ password='PASSWORD', │ │
│ │ │ │ database: 'DB' │ │
│ │ │ │ ssl=<ssl.SSLContext object at 0x7f7d166f5910>, │ │
│ │ │ │ sslmode=<SSLMode.prefer: 2>, │ │
│ │ │ │ direct_tls=False, │ │
│ │ │ │ connect_timeout=60, │ │
│ │ │ │ server_settings=None │ │
│ │ │ ) │ │
│ │ ) │ │
│ │ before = 121.78379555 │ │
│ │ config = ConnectionConfiguration( │ │
│ │ │ command_timeout=None, │ │
│ │ │ statement_cache_size=100, │ │
│ │ │ max_cached_statement_lifetime=300, │ │
│ │ │ max_cacheable_statement_size=15360 │ │
│ │ ) │ │
│ │ connection_class = <class 'asyncpg.connection.Connection'> │ │
│ │ loop = <_UnixSelectorEventLoop running=False closed=False debug=False> │ │
│ │ params = ConnectionParameters( │ │
│ │ │ user: 'USER', │ │
│ │ │ password='PASSWORD', │ │
│ │ │ database: 'DB' │ │
│ │ │ ssl=<ssl.SSLContext object at 0x7f7d166f5910>, │ │
│ │ │ sslmode=<SSLMode.prefer: 2>, │ │
│ │ │ direct_tls=False, │ │
│ │ │ connect_timeout=60, │ │
│ │ │ server_settings=None │ │
│ │ ) │ │
│ │ params_input = ConnectionParameters( │ │
│ │ │ user: 'USER', │ │
│ │ │ password='PASSWORD', │ │
│ │ │ database: 'DB' │ │
│ │ │ ssl=<ssl.SSLContext object at 0x7f7d166f5910>, │ │
│ │ │ sslmode=<SSLMode.prefer: 2>, │ │
│ │ │ direct_tls=False, │ │
│ │ │ connect_timeout=60, │ │
│ │ │ server_settings=None │ │
│ │ ) │ │
│ │ params_retry = ConnectionParameters( │ │
│ │ │ user: 'USER', │ │
│ │ │ password='PASSWORD', │ │
│ │ │ database: 'DB' │ │
│ │ │ ssl=None, │ │
│ │ │ sslmode=<SSLMode.prefer: 2>, │ │
│ │ │ direct_tls=False, │ │
│ │ │ connect_timeout=60, │ │
│ │ │ server_settings=None │ │
│ │ ) │ │
│ │ record_class = <class 'asyncpg.Record'> │ │
│ │ timeout = 60 │ │
│ ╰─────────────────────────────────────────────────────────────────────────────────────────╯ │
│ │
│ /usr/local/lib/python3.11/site-packages/asyncpg/connect_utils.py:825 in __connect_addr │
│ │
│ 822 │ │
│ 823 │ connector = asyncio.ensure_future(connector) │
│ 824 │ before = time.monotonic() │
│ ❱ 825 │ tr, pr = await compat.wait_for(connector, timeout=timeout) │
│ 826 │ timeout -= time.monotonic() - before │
│ 827 │ │
│ 828 │ try: │
│ │
│ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
│ │ addr = ('test-deploy-fief-db.flycast', 5432) │ │
│ │ before = 121.78382123 │ │
│ │ config = ConnectionConfiguration( │ │
│ │ │ command_timeout=None, │ │
│ │ │ statement_cache_size=100, │ │
│ │ │ max_cached_statement_lifetime=300, │ │
│ │ │ max_cacheable_statement_size=15360 │ │
│ │ ) │ │
│ │ connected = <Future pending> │ │
│ │ connection_class = <class 'asyncpg.connection.Connection'> │ │
│ │ connector = <Task finished name='Task-2' coro=<_create_ssl_connection() done, defined │ │
│ │ at /usr/local/lib/python3.11/site-packages/asyncpg/connect_utils.py:681> │ │
│ │ exception=ConnectionResetError()> │ │
│ │ loop = <_UnixSelectorEventLoop running=False closed=False debug=False> │ │
│ │ params = ConnectionParameters( │ │
│ │ │ user: 'USER', │ │
│ │ │ password='PASSWORD', │ │
│ │ │ database: 'DB' │ │
│ │ │ ssl=<ssl.SSLContext object at 0x7f7d166f5910>, │ │
│ │ │ sslmode=<SSLMode.prefer: 2>, │ │
│ │ │ direct_tls=False, │ │
│ │ │ connect_timeout=60, │ │
│ │ │ server_settings=None │ │
│ │ ) │ │
│ │ params_input = ConnectionParameters( │ │
│ │ │ user: 'USER', │ │
│ │ │ password='PASSWORD', │ │
│ │ │ database: 'DB' │ │
│ │ │ ssl=<ssl.SSLContext object at 0x7f7d166f5910>, │ │
│ │ │ sslmode=<SSLMode.prefer: 2>, │ │
│ │ │ direct_tls=False, │ │
│ │ │ connect_timeout=60, │ │
│ │ │ server_settings=None │ │
│ │ ) │ │
│ │ proto_factory = <function __connect_addr.<locals>.<lambda> at 0x7f7d1658e340> │ │
│ │ record_class = <class 'asyncpg.Record'> │ │
│ │ retry = True │ │
│ │ timeout = 60 │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
│ │
│ /usr/local/lib/python3.11/site-packages/asyncpg/compat.py:56 in wait_for │
│ │
│ 53 │ fut = asyncio.ensure_future(fut) │
│ 54 │ │
│ 55 │ try: │
│ ❱ 56 │ │ return await asyncio.wait_for(fut, timeout) │
│ 57 │ except asyncio.CancelledError: │
│ 58 │ │ if fut.done(): │
│ 59 │ │ │ return fut.result() │
│ │
│ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
│ │ fut = <Task finished name='Task-2' coro=<_create_ssl_connection() done, defined at │ │
│ │ /usr/local/lib/python3.11/site-packages/asyncpg/connect_utils.py:681> │ │
│ │ exception=ConnectionResetError()> │ │
│ │ timeout = 60 │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
│ │
│ /usr/local/lib/python3.11/asyncio/tasks.py:479 in wait_for │
│ │
│ 476 │ │ │ │ raise │
│ 477 │ │ │
│ 478 │ │ if fut.done(): │
│ ❱ 479 │ │ │ return fut.result() │
│ 480 │ │ else: │
│ 481 │ │ │ fut.remove_done_callback(cb) │
│ 482 │ │ │ # We must ensure that the task is not running │
│ │
│ ╭─────────────────────────────────────────── locals ───────────────────────────────────────────╮ │
│ │ cb = functools.partial(<function _release_waiter at 0x7f7d1cf0f560>, <Future │ │
│ │ finished result=None>) │ │
│ │ fut = <Task finished name='Task-2' coro=<_create_ssl_connection() done, defined │ │
│ │ at /usr/local/lib/python3.11/site-packages/asyncpg/connect_utils.py:681> │ │
│ │ exception=ConnectionResetError()> │ │
│ │ loop = <_UnixSelectorEventLoop running=False closed=False debug=False> │ │
│ │ timeout = 60 │ │
│ │ timeout_handle = <TimerHandle cancelled when=181.783829251> │ │
│ │ waiter = <Future finished result=None> │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────────╯ │
│ │
│ /usr/local/lib/python3.11/site-packages/asyncpg/connect_utils.py:700 in _create_ssl_connection │
│ │
│ 697 │ if hasattr(loop, 'start_tls'): │
│ 698 │ │ if do_ssl_upgrade: │
│ 699 │ │ │ try: │
│ ❱ 700 │ │ │ │ new_tr = await loop.start_tls( │
│ 701 │ │ │ │ │ tr, pr, ssl_context, server_hostname=host) │
│ 702 │ │ │ except (Exception, asyncio.CancelledError): │
│ 703 │ │ │ │ tr.close() │
│ │
│ ╭────────────────────────────────────── locals ───────────────────────────────────────╮ │
│ │ do_ssl_upgrade = True │ │
│ │ host = 'test-deploy-fief-db.flycast' │ │
│ │ loop = <_UnixSelectorEventLoop running=False closed=False debug=False> │ │
│ │ port = 5432 │ │
│ │ pr = <asyncpg.connect_utils.TLSUpgradeProto object at 0x7f7d1670ced0> │ │
│ │ protocol_factory = <function __connect_addr.<locals>.<lambda> at 0x7f7d1658e340> │ │
│ │ ssl_context = <ssl.SSLContext object at 0x7f7d166f5910> │ │
│ │ ssl_is_advisory = True │ │
│ │ tr = <_SelectorSocketTransport closed fd=7> │ │
│ ╰─────────────────────────────────────────────────────────────────────────────────────╯ │
│ │
│ /usr/local/lib/python3.11/asyncio/base_events.py:1267 in start_tls │
│ │
│ 1264 │ │ resume_cb = self.call_soon(transport.resume_reading) │
│ 1265 │ │ │
│ 1266 │ │ try: │
│ ❱ 1267 │ │ │ await waiter │
│ 1268 │ │ except BaseException: │
│ 1269 │ │ │ transport.close() │
│ 1270 │ │ │ conmade_cb.cancel() │
│ │
│ ╭───────────────────────────────────────── locals ─────────────────────────────────────────╮ │
│ │ conmade_cb = <Handle cancelled> │ │
│ │ protocol = <asyncpg.connect_utils.TLSUpgradeProto object at 0x7f7d1670ced0> │ │
│ │ resume_cb = <Handle cancelled> │ │
│ │ self = <_UnixSelectorEventLoop running=False closed=False debug=False> │ │
│ │ server_hostname = 'test-deploy-fief-db.flycast' │ │
│ │ server_side = False │ │
│ │ ssl_handshake_timeout = None │ │
│ │ ssl_protocol = <asyncio.sslproto.SSLProtocol object at 0x7f7d16593050> │ │
│ │ ssl_shutdown_timeout = None │ │
│ │ sslcontext = <ssl.SSLContext object at 0x7f7d166f5910> │ │
│ │ transport = <_SelectorSocketTransport closed fd=7> │ │
│ │ waiter = <Future finished exception=ConnectionResetError()> │ │
│ ╰──────────────────────────────────────────────────────────────────────────────────────────╯ │
│ │
│ /usr/local/lib/python3.11/asyncio/sslproto.py:574 in _on_handshake_complete │
│ │
│ 571 │ │ │ if handshake_exc is None: │
│ 572 │ │ │ │ self._set_state(SSLProtocolState.WRAPPED) │
│ 573 │ │ │ else: │
│ ❱ 574 │ │ │ │ raise handshake_exc │
│ 575 │ │ │ │
│ 576 │ │ │ peercert = sslobj.getpeercert() │
│ 577 │ │ except Exception as exc: │
│ │
│ ╭──────────────────────────────── locals ─────────────────────────────────╮ │
│ │ handshake_exc = <class 'ConnectionResetError'> │ │
│ │ msg = 'SSL handshake failed' │ │
│ │ self = <asyncio.sslproto.SSLProtocol object at 0x7f7d16593050> │ │
│ │ sslobj = <ssl.SSLObject object at 0x7f7d1740ab10> │ │
│ ╰─────────────────────────────────────────────────────────────────────────╯ │
╰──────────────────────────────────────────────────────────────────────────────────────────────────╯
|
Beta Was this translation helpful? Give feedback.
All reactions
-
What's weird is that for some reasons, it switches to sslmode=prefer as we see here:
Can you set the following environment variables: DATABASE_TYPE=POSTGRESQL
DATABASE_SSL_MODE=disable (+ of course the |
Beta Was this translation helpful? Give feedback.
All reactions
-
Hello again, │ ╭───────────────────────────────────── locals ──────────────────────────────────────╮ │
│ │ addr = ('fief-db.flycast', 5432) │ │
│ │ addrs = [('fief-db.flycast', 5432)] │ │
│ │ before = 168.105208574 │ │
│ │ config = ConnectionConfiguration( │ │
│ │ │ command_timeout=None, │ │
│ │ │ statement_cache_size=100, │ │
│ │ │ max_cached_statement_lifetime=300, │ │
│ │ │ max_cacheable_statement_size=15360 │ │
│ │ ) │ │
│ │ connection_class = <class 'asyncpg.connection.Connection'> │ │
│ │ kwargs = { │ │
│ │ │ 'dsn': None, │ │
│ │ │ 'host': 'fief-db.flycast', │ │
│ │ │ 'port': 5432, │ │
│ │ │ 'user': 'user', │ │
│ │ │ 'password': 'pass', │ │
│ │ │ 'passfile': None, │ │
│ │ │ 'ssl': None, │ │
│ │ │ 'direct_tls': False, │ │
│ │ │ 'database': 'db', │ │
│ │ │ 'server_settings': None, │ │
│ │ │ ... +4 │ │
│ │ } │ │
│ │ last_error = ConnectionResetError() │ │
│ │ loop = <_UnixSelectorEventLoop running=False closed=True debug=False> │ │
│ │ params = ConnectionParameters( │ │
│ │ │ user='user', │ │
│ │ │ password='pass', │ │
│ │ │ database='db', │ │
│ │ │ ssl=<ssl.SSLContext object at 0x7fe5b66be7b0>, │ │
│ │ │ sslmode=<SSLMode.prefer: 2>, │ │
│ │ │ direct_tls=False, │ │
│ │ │ connect_timeout=60, │ │
│ │ │ server_settings=None │ │
│ │ ) │ │
│ │ record_class = <class 'asyncpg.Record'> │ │
│ │ timeout = 59.331111540999984 │ │
│ ╰───────────────────────────────────────────────────────────────────────────────────╯ |
Beta Was this translation helpful? Give feedback.
All reactions
-
That's strange. 💡 May it be possible that you actually created a workspace with BYOD? If so, the database parameters for the workspace are actually inside the DB, that would explain why changing the env vars has no effect. |
Beta Was this translation helpful? Give feedback.
-
Hello Everyone, I'm trying to deploy fief on Fly.io but I have some issues connecting to a postgresql db.
On fly.io I already have a postgresql running, so I just put the database type and Url in the environment and then start the deployment. The thing is, my fief-server doesn't start and I have the following error when I try to start it manually:
I tried to put DATABASE_SSL_MODE=disable in the env but didn't fix the problem.
When i take a look inside the db there are all the tables related to fief and all of them are empty.
Does anyone have an idea what my problem could be?
Thank you in advance.
Beta Was this translation helpful? Give feedback.
All reactions