Бот построен на Telegram Bot API template, with aiogram, sqlalcermy + alembic.
Например: Если ответчаешь боту 3 и более фото, то рандомно появляется
SAWarning: transaction already deassociated from connection
util.warn("transaction already deassociated from connection")
2022-12-16 18:08:12.715 | ERROR | utils.misc.save_execute:wrapper:12 - This session is in 'prepared' state; no further SQL can be emitted within this transaction.
2022-12-16 18:08:12.716 | ERROR | utils.misc.save_execute:save_commit:22 - 'NoneType' object has no attribute 'dispatch'
2022-12-16 18:08:12.720 | ERROR | utils.misc.save_execute:save_commit:22 - This transaction is closed
2022-12-16 18:08:12.721 | ERROR | utils.misc.save_execute:wrapper:12 - 'NoneType' object has no attribute 'twophase'
Пробовал использовать SQLlite и PostgresSQL. Проблема одинакова.
Ловлю так
@dp.message_handler(IsReplyFilter(True), content_types=["photo", "location", "text", "video"])