Created At: 2026-11-18T06:21:40Z Completed At: 2026-11-18T06:21:43Z Command exited with code 1. Command output: Traceback (most recent call last): File "/root/telegram-saas/.venv/lib/python3.12/site-packages/sqlalchemy/dialects/postgresql/asyncpg.py", line 620, in _prepare_and_execute self._rows = deque(await prepared_stmt.fetch(*parameters)) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/telegram-saas/.venv/lib/python3.12/site-packages/asyncpg/prepared_stmt.py", line 177, in fetch data = await self.__bind_execute(args, 0, timeout) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/telegram-saas/.venv/lib/python3.12/site-packages/asyncpg/prepared_stmt.py", line 268, in __bind_execute data, status, _ = await self.__do_execute( ^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/telegram-saas/.venv/lib/python3.12/site-packages/asyncpg/prepared_stmt.py", line 257, in __do_execute return await executor(protocol) ^^^^^^^^^^^^^^^^^^^^^^^^ File "asyncpg/protocol/protocol.pyx", line 197, in bind_execute asyncpg.exceptions.ForeignKeyViolationError: insert or update on table "bot_message_versions" violates foreign key constraint "bot_message_versions_template_id_fkey" DETAIL: Key (template_id)=(f6ef96db-9db9-4b62-9816-98e8f0adf7eb) is not present in table "bot_message_templates". The above exception was the direct cause of the following exception: Traceback (most recent call last): File "/root/telegram-saas/.venv/lib/python3.12/site-packages/sqlalchemy/engine/base.py", line 1977, in _exec_single_context self.dialect.do_execute( File "/root/telegram-saas/.venv/lib/python3.12/site-packages/sqlalchemy/engine/default.py", line 1192, in do_execute cursor.execute(statement, parameters) File "/root/telegram-saas/.venv/lib/python3.12/site-packages/sqlalchemy/dialects/postgresql/asyncpg.py", line 671, in execute await_(self._prepare_and_execute(operation, parameters)) File "/root/telegram-saas/.venv/lib/python3.12/site-packages/sqlalchemy/util/concurrency.py", line 171, in await_ return current.parent.switch(awaitable) # type: ignore[no-any-return] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/telegram-saas/.venv/lib/python3.12/site-packages/sqlalchemy/util/concurrency.py", line 209, in greenlet_spawn value = await result ^^^^^^^^^^^^ File "/root/telegram-saas/.venv/lib/python3.12/site-packages/sqlalchemy/dialects/postgresql/asyncpg.py", line 633, in _prepare_and_execute self._handle_exception(error) File "/root/telegram-saas/.venv/lib/python3.12/site-packages/sqlalchemy/dialects/postgresql/asyncpg.py", line 583, in _handle_exception self._adapt_connection._handle_exception(error) File "/root/telegram-saas/.venv/lib/python3.12/site-packages/sqlalchemy/dialects/postgresql/asyncpg.py", line 862, in _handle_exception super()._handle_exception(error) File "/root/telegram-saas/.venv/lib/python3.12/site-packages/sqlalchemy/connectors/asyncio.py", line 412, in _handle_exception self._handle_exception_no_connection(self.dbapi, error) File "/root/telegram-saas/.venv/lib/python3.12/site-packages/sqlalchemy/dialects/postgresql/asyncpg.py", line 855, in _handle_exception_no_connection raise translated_error from error sqlalchemy.dialects.postgresql.asyncpg.AsyncAdapt_asyncpg_dbapi.ForeignKeyViolationError: insert or update on table "bot_message_versions" violates foreign key constraint "bot_message_versions_template_id_fkey" The above exception was the direct cause of the following exception: Traceback (most recent call last): File "", line 27, in File "/usr/lib/python3.12/asyncio/runners.py", line 194, in run return runner.run(main) ^^^^^^^^^^^^^^^^ File "/usr/lib/python3.12/asyncio/runners.py", line 118, in run return self._loop.run_until_complete(task) ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/usr/lib/python3.12/asyncio/base_events.py", line 687, in run_until_complete return future.result() ^^^^^^^^^^^^^^^ File "", line 23, in test File "/root/telegram-saas/.venv/lib/python3.12/site-packages/sqlalchemy/ext/asyncio/session.py", line 1031, in flush await greenlet_spawn(self.sync_session.flush, objects=objects) File "/root/telegram-saas/.venv/lib/python3.12/site-packages/sqlalchemy/util/concurrency.py", line 216, in greenlet_spawn result = context.switch(value) ^^^^^^^^^^^^^^^^^^^^^ File "/root/telegram-saas/.venv/lib/python3.12/site-packages/sqlalchemy/orm/session.py", line 4626, in flush self._flush(objects) File "", line 2, in _flush File "/root/telegram-saas/.venv/lib/python3.12/site-packages/sqlalchemy/util/deprecations.py", line 281, in warned return fn(*args, **kwargs) # type: ignore[no-any-return] ^^^^^^^^^^^^^^^^^^^ File "/root/telegram-saas/.venv/lib/python3.12/site-packages/sqlalchemy/orm/session.py", line 4769, in _flush with util.safe_reraise(): File "/root/telegram-saas/.venv/lib/python3.12/site-packages/sqlalchemy/util/langhelpers.py", line 166, in __exit__ raise exc_value.with_traceback(exc_tb) File "/root/telegram-saas/.venv/lib/python3.12/site-packages/sqlalchemy/orm/session.py", line 4730, in _flush flush_context.execute() File "/root/telegram-saas/.venv/lib/python3.12/site-packages/sqlalchemy/orm/unitofwork.py", line 467, in execute rec.execute(self) File "/root/telegram-saas/.venv/lib/python3.12/site-packages/sqlalchemy/orm/unitofwork.py", line 643, in execute util.preloaded.orm_persistence._save_obj( File "/root/telegram-saas/.venv/lib/python3.12/site-packages/sqlalchemy/orm/persistence.py", line 92, in _save_obj _emit_insert_statements( File "/root/telegram-saas/.venv/lib/python3.12/site-packages/sqlalchemy/orm/persistence.py", line 1250, in _emit_insert_statements result = connection.execute( ^^^^^^^^^^^^^^^^^^^ File "/root/telegram-saas/.venv/lib/python3.12/site-packages/sqlalchemy/engine/base.py", line 1494, in execute return meth( ^^^^^ File "/root/telegram-saas/.venv/lib/python3.12/site-packages/sqlalchemy/sql/elements.py", line 534, in _execute_on_connection return connection._execute_clauseelement( ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/telegram-saas/.venv/lib/python3.12/site-packages/sqlalchemy/engine/base.py", line 1714, in _execute_clauseelement ret = self._execute_context( ^^^^^^^^^^^^^^^^^^^^^^ File "/root/telegram-saas/.venv/lib/python3.12/site-packages/sqlalchemy/engine/base.py", line 1868, in _execute_context return self._exec_single_context( ^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/telegram-saas/.venv/lib/python3.12/site-packages/sqlalchemy/engine/base.py", line 1996, in _exec_single_context self._handle_dbapi_exception( File "/root/telegram-saas/.venv/lib/python3.12/site-packages/sqlalchemy/engine/base.py", line 2351, in _handle_dbapi_exception raise sqlalchemy_exception.with_traceback(exc_info[2]) from e File "/root/telegram-saas/.venv/lib/python3.12/site-packages/sqlalchemy/engine/base.py", line 1977, in _exec_single_context self.dialect.do_execute( File "/root/telegram-saas/.venv/lib/python3.12/site-packages/sqlalchemy/engine/default.py", line 1192, in do_execute cursor.execute(statement, parameters) File "/root/telegram-saas/.venv/lib/python3.12/site-packages/sqlalchemy/dialects/postgresql/asyncpg.py", line 671, in execute await_(self._prepare_and_execute(operation, parameters)) File "/root/telegram-saas/.venv/lib/python3.12/site-packages/sqlalchemy/util/concurrency.py", line 171, in await_ return current.parent.switch(awaitable) # type: ignore[no-any-return] ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ File "/root/telegram-saas/.venv/lib/python3.12/site-packages/sqlalchemy/util/concurrency.py", line 209, in greenlet_spawn value = await result ^^^^^^^^^^^^ File "/root/telegram-saas/.venv/lib/python3.12/site-packages/sqlalchemy/dialects/postgresql/asyncpg.py", line 633, in _prepare_and_execute self._handle_exception(error) File "/root/telegram-saas/.venv/lib/python3.12/site-packages/sqlalchemy/dialects/postgresql/asyncpg.py", line 583, in _handle_exception self._adapt_connection._handle_exception(error) File "/root/telegram-saas/.venv/lib/python3.12/site-packages/sqlalchemy/dialects/postgresql/asyncpg.py", line 862, in _handle_exception super()._handle_exception(error) File "/root/telegram-saas/.venv/lib/python3.12/site-packages/sqlalchemy/connectors/asyncio.py", line 412, in _handle_exception self._handle_exception_no_connection(self.dbapi, error) File "/root/telegram-saas/.venv/lib/python3.12/site-packages/sqlalchemy/dialects/postgresql/asyncpg.py", line 855, in _handle_exception_no_connection raise translated_error from error sqlalchemy.exc.IntegrityError: (sqlalchemy.dialects.postgresql.asyncpg.ForeignKeyViolationError) insert or update on table "bot_message_versions" violates foreign key constraint "bot_message_versions_template_id_fkey" [SQL: INSERT INTO bot_message_versions (id, template_id, version, snapshot_json, updated_by, created_at) VALUES ($1::UUID, $2::UUID, $3::INTEGER, $4::JSONB, $5::UUID, $6::TIMESTAMP WITH TIME ZONE)] [parameters: (UUID('3e747461-34b7-45d4-879a-b6cdbd01ea64'), UUID('f6ef96db-9db9-4b62-9816-98e8f0adf7eb'), 1, '{"message_text": "🙏 Welcome 👑 🔥"}', None, datetime.datetime(2026, 11, 18, 6, 21, 43, 385508, tzinfo=datetime.timezone.utc))] (Background on this error at: https://sqlalche.me/e/21/gkpj)