lilydjwg / luoxu

A Telegram userbot to index Chinese and Japanese group contents.
GNU General Public License v3.0
251 stars 24 forks source link

无法运行luoxu #10

Closed chanceyans closed 9 months ago

chanceyans commented 9 months ago

pacman -S opencc 1.1.7 在 venv里 pip 安装环境 postgresql 16.1 pgroonga 3.1.6-3 执行 python -m luoxu 报错如下

Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/home/chanceyan/pyluoxu/luoxu/luoxu/__main__.py", line 202, in <module>
    run_until_sigint(indexer.run())
  File "/home/chanceyan/pyluoxu/luoxu/luoxu/util.py", line 27, in run_until_sigint
    loop.run_until_complete(fu)
  File "/usr/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/home/chanceyan/pyluoxu/luoxu/luoxu/__main__.py", line 74, in run
    await db.setup()
  File "/home/chanceyan/pyluoxu/luoxu/luoxu/db.py", line 32, in setup
    self.pool = await asyncpg.create_pool(self.address)
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/chanceyan/pyluoxu/lib/python3.11/site-packages/asyncpg/pool.py", line 403, in _async__init__
    await self._initialize()
  File "/home/chanceyan/pyluoxu/lib/python3.11/site-packages/asyncpg/pool.py", line 430, in _initialize
    await first_ch.connect()
  File "/home/chanceyan/pyluoxu/lib/python3.11/site-packages/asyncpg/pool.py", line 128, in connect
    self._con = await self._pool._get_new_connection()
                ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/chanceyan/pyluoxu/lib/python3.11/site-packages/asyncpg/pool.py", line 502, in _get_new_connection
    con = await connection.connect(
          ^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/chanceyan/pyluoxu/lib/python3.11/site-packages/asyncpg/connection.py", line 2329, in connect
    return await connect_utils._connect(
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/chanceyan/pyluoxu/lib/python3.11/site-packages/asyncpg/connect_utils.py", line 1017, in _connect
    raise last_error or exceptions.TargetServerAttributeNotMatched(
  File "/home/chanceyan/pyluoxu/lib/python3.11/site-packages/asyncpg/connect_utils.py", line 991, in _connect
    conn = await _connect_addr(
           ^^^^^^^^^^^^^^^^^^^^
  File "/home/chanceyan/pyluoxu/lib/python3.11/site-packages/asyncpg/connect_utils.py", line 828, in _connect_addr
    return await __connect_addr(params, True, *args)
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/chanceyan/pyluoxu/lib/python3.11/site-packages/asyncpg/connect_utils.py", line 873, in __connect_addr
    tr, pr = await connector
             ^^^^^^^^^^^^^^^
  File "/home/chanceyan/pyluoxu/lib/python3.11/site-packages/asyncpg/connect_utils.py", line 744, in _create_ssl_connection
    tr, pr = await loop.create_connection(
             ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/python3.11/asyncio/base_events.py", line 1093, in create_connection
    raise OSError('Multiple exceptions: {}'.format(
OSError: Multiple exceptions: [Errno 111] Connect call failed ('::1', 5432, 0, 0), [Errno 111] Connect call failed ('127.0.0.1', 5432)
chanceyans commented 9 months ago

上面忘记 start posgresql.service 了

❯ python -m luoxu
[I 01-18 10:07:47.202 mtprotosender:228] Connecting to 149.154.175.58:443/TcpFull...
[I 01-18 10:07:47.202 mtprotosender:279] Connection to 149.154.175.58:443/TcpFull complete!
[I 01-18 10:07:49.612 __main__:182] init_group: '#archlinux-cn'
Traceback (most recent call last):
  File "<frozen runpy>", line 198, in _run_module_as_main
  File "<frozen runpy>", line 88, in _run_code
  File "/home/chanceyan/pyluoxu/luoxu/luoxu/__main__.py", line 202, in <module>
    run_until_sigint(indexer.run())
  File "/home/chanceyan/pyluoxu/luoxu/luoxu/util.py", line 27, in run_until_sigint
    loop.run_until_complete(fu)
  File "/usr/lib/python3.11/asyncio/base_events.py", line 653, in run_until_complete
    return future.result()
           ^^^^^^^^^^^^^^^
  File "/home/chanceyan/pyluoxu/luoxu/luoxu/__main__.py", line 128, in run
    await self.run_on_connected(client, db, group_entities)
  File "/home/chanceyan/pyluoxu/luoxu/luoxu/__main__.py", line 148, in run_on_connected
    ginfo = await self.init_group(group)
            ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/chanceyan/pyluoxu/luoxu/luoxu/__main__.py", line 182, in init_group
    logger.info('init_group: %r', group.title)
                                  ^^^^^^^^^^^
AttributeError: 'User' object has no attribute 'title'
[E 01-18 10:07:49.661 base_events:1771] Task was destroyed but it is pending!
    task: <Task pending name='Task-17' coro=<UpdateMethods._update_loop() running at /home/chanceyan/pyluoxu/lib/python3.11/site-packages/telethon/client/updates.py:452> wait_for=<Future pending cb=[Task.task_wakeup()]>>
[E 01-18 10:07:49.661 base_events:1771] Task was destroyed but it is pending!
    task: <Task pending name='Task-18' coro=<UpdateMethods._keepalive_loop() running at /home/chanceyan/pyluoxu/lib/python3.11/site-packages/telethon/client/updates.py:486> wait_for=<Future pending cb=[Task.task_wakeup()]>>
sys:1: RuntimeWarning: coroutine 'GroupHistoryIndexer.run' was never awaited
[E 01-18 10:07:49.661 base_events:1771] Task was destroyed but it is pending!
    task: <Task pending name='Task-15' coro=<MTProtoSender._send_loop() running at /home/chanceyan/pyluoxu/lib/python3.11/site-packages/telethon/network/mtprotosender.py:464> wait_for=<Future pending cb=[Task.task_wakeup()]>>
[E 01-18 10:07:49.661 base_events:1771] Task was destroyed but it is pending!
    task: <Task pending name='Task-16' coro=<MTProtoSender._recv_loop() running at /home/chanceyan/pyluoxu/lib/python3.11/site-packages/telethon/network/mtprotosender.py:507> wait_for=<Future pending cb=[Task.task_wakeup()]>>
[E 01-18 10:07:49.661 base_events:1771] Task was destroyed but it is pending!
    task: <Task pending name='Task-23' coro=<Queue.get() running at /usr/lib/python3.11/asyncio/queues.py:158> wait_for=<Future pending cb=[Task.task_wakeup()]> cb=[_release_waiter(<Future pendi...ask_wakeup()]>)() at /usr/lib/python3.11/asyncio/tasks.py:431]>
Exception ignored in: <function StreamWriter.__del__ at 0x758312b0af20>
Traceback (most recent call last):
  File "/usr/lib/python3.11/asyncio/streams.py", line 395, in __del__
  File "/usr/lib/python3.11/asyncio/streams.py", line 343, in close
  File "/usr/lib/python3.11/asyncio/selector_events.py", line 860, in close
  File "/usr/lib/python3.11/asyncio/base_events.py", line 761, in call_soon
  File "/usr/lib/python3.11/asyncio/base_events.py", line 519, in _check_closed
RuntimeError: Event loop is closed
[E 01-18 10:07:49.661 base_events:1771] Task was destroyed but it is pending!
    task: <Task pending name='Task-13' coro=<Connection._send_loop() running at /home/chanceyan/pyluoxu/lib/python3.11/site-packages/telethon/network/connection/connection.py:316> wait_for=<Future pending cb=[Task.task_wakeup()]>>
[E 01-18 10:07:49.661 base_events:1771] Task was destroyed but it is pending!
    task: <Task pending name='Task-14' coro=<Connection._recv_loop() running at /home/chanceyan/pyluoxu/lib/python3.11/site-packages/telethon/network/connection/connection.py:335> wait_for=<Future pending cb=[Task.task_wakeup()]>>
[E 01-18 10:07:49.661 mtprotosender:523] Unhandled error while receiving data
    Traceback (most recent call last):
      File "/usr/lib/python3.11/asyncio/queues.py", line 158, in get
        await getter
    GeneratorExit

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "/home/chanceyan/pyluoxu/lib/python3.11/site-packages/telethon/network/mtprotosender.py", line 507, in _recv_loop
        body = await self._connection.recv()
               ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/home/chanceyan/pyluoxu/lib/python3.11/site-packages/telethon/network/connection/connection.py", line 302, in recv
        result, err = await self._recv_queue.get()
                      ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/usr/lib/python3.11/asyncio/queues.py", line 160, in get
        getter.cancel()  # Just in case getter is not done yet.
        ^^^^^^^^^^^^^^^
      File "/usr/lib/python3.11/asyncio/base_events.py", line 761, in call_soon
        self._check_closed()
      File "/usr/lib/python3.11/asyncio/base_events.py", line 519, in _check_closed
        raise RuntimeError('Event loop is closed')
    RuntimeError: Event loop is closed
Exception ignored in: <coroutine object Queue.get at 0x758311207220>
Traceback (most recent call last):
  File "/usr/lib/python3.11/asyncio/queues.py", line 160, in get
  File "/usr/lib/python3.11/asyncio/base_events.py", line 761, in call_soon
  File "/usr/lib/python3.11/asyncio/base_events.py", line 519, in _check_closed
RuntimeError: Event loop is closed
[E 01-18 10:07:49.664 connection:324] Unexpected exception in the send loop
    Traceback (most recent call last):
      File "/usr/lib/python3.11/asyncio/queues.py", line 158, in get
        await getter
    GeneratorExit

    During handling of the above exception, another exception occurred:

    Traceback (most recent call last):
      File "/home/chanceyan/pyluoxu/lib/python3.11/site-packages/telethon/network/connection/connection.py", line 316, in _send_loop
        self._send(await self._send_queue.get())
                   ^^^^^^^^^^^^^^^^^^^^^^^^^^^^
      File "/usr/lib/python3.11/asyncio/queues.py", line 160, in get
        getter.cancel()  # Just in case getter is not done yet.
        ^^^^^^^^^^^^^^^
      File "/usr/lib/python3.11/asyncio/base_events.py", line 761, in call_soon
        self._check_closed()
      File "/usr/lib/python3.11/asyncio/base_events.py", line 519, in _check_closed
        raise RuntimeError('Event loop is closed')
    RuntimeError: Event loop is closed
Exception ignored in: <coroutine object Connection._send_loop at 0x758311206b20>
RuntimeError: coroutine ignored GeneratorExit
lilydjwg commented 9 months ago

不要尝试索引私聊。

chanceyans commented 9 months ago

解决了,感谢