@Artemider

Запустил код middleware антифлуд(на сайте аиограм) и вылезла ошибка. В чем проблема?

Ошибка
Task exception was never retrieved
future: <Task finished name='Task-8' coro=<Dispatcher._process_polling_updates() done, defined at D:\Програмирование\Python\lib\site-packages\aiogram\dispatcher\dispatcher.py:407> exception=ConnectionError('Error 22 connecting to localhost:6379. 22.')>
Traceback (most recent call last):
  File "D:\Програмирование\Python\lib\site-packages\aiogram\dispatcher\filters\builtin.py", line 554, in check
    state = self.ctx_state.get()
LookupError: <ContextVar name='user_state' at 0x00000086D28F69D0>

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "D:\Програмирование\Python\lib\site-packages\aiogram\dispatcher\dispatcher.py", line 415, in _process_polling_updates
    for responses in itertools.chain.from_iterable(await self.process_updates(updates, fast)):
  File "D:\Програмирование\Python\lib\site-packages\aiogram\dispatcher\dispatcher.py", line 235, in process_updates
    return await asyncio.gather(*tasks)
  File "D:\Програмирование\Python\lib\site-packages\aiogram\dispatcher\handler.py", line 116, in notify
    response = await handler_obj.handler(*args, **partial_data)
  File "D:\Програмирование\Python\lib\site-packages\aiogram\dispatcher\dispatcher.py", line 256, in process_update
    return await self.message_handlers.notify(update.message)
  File "D:\Програмирование\Python\lib\site-packages\aiogram\dispatcher\handler.py", line 107, in notify
    data.update(await check_filters(handler_obj.filters, args))
  File "D:\Програмирование\Python\lib\site-packages\aiogram\dispatcher\filters\filters.py", line 72, in check_filters
    f = await execute_filter(filter_, args)
  File "D:\Програмирование\Python\lib\site-packages\aiogram\dispatcher\filters\filters.py", line 56, in execute_filter
    return await filter_.filter(*args, **filter_.kwargs)
  File "D:\Програмирование\Python\lib\site-packages\aiogram\dispatcher\filters\filters.py", line 161, in __call__
    return await self.check(*args)
  File "D:\Програмирование\Python\lib\site-packages\aiogram\dispatcher\filters\builtin.py", line 559, in check
    state = await self.dispatcher.storage.get_state(chat=chat, user=user)
  File "D:\Програмирование\Python\lib\site-packages\aioredis\connection.py", line 1416, in get_connection
    await connection.connect()
  File "D:\Програмирование\Python\lib\site-packages\aioredis\connection.py", line 698, in connect
    raise ConnectionError(self._error_message(e))
aioredis.exceptions.ConnectionError: Error 22 connecting to localhost:6379. 22.
  • Вопрос задан
  • 259 просмотров
Решения вопроса 1
@q2digger
никого не трогаю, починяю примус
Судя по ошибке не может подключиться к редису.
aioredis.exceptions.ConnectionError: Error 22 connecting to localhost:6379
Ответ написан
Комментировать
Пригласить эксперта
Ваш ответ на вопрос

Войдите, чтобы написать ответ

Войти через центр авторизации
Похожие вопросы