Skip to content

emfind 2.1.38, rTorrent 0.15.5. Ошибка выполнения "emfind rebuild-cache" при emfind.files_from_client = true #79

@omgiafs

Description

@omgiafs

Environment:

  • Debian 13
  • Python 3.13 venv
  • emonoda 2.1.38
  • rTorrent 0.15.5
  • ruTorrent v5.2.10

Ошибки

  1. Утилита emfind, установленная из исходников, заработала только после закомментирования строки self.__server.network.xmlrpc.size_limit

  2. При emfind.files_from_client = true (содержимое торрент-файла из клиента), утилита падает с ошибкой.

Подробности

При emfind.files_from_client = false (содержимое торрент-файла из торрента)

(emonoda) 17:43:07  [~]
user@server $ emfind rebuild-cache
# I: Client rtorrent is ready
# I: Fetching all hashes from client ...
# I: Validating the cache ...
# I: 100.0% [████████████████████] 268/268 :: Loaded 268 torrents from /var/opt/docker/rtorrent-rutorrent/data/rtorrent/.session/*.torrent
# I: 100.0% [████████████████████] 268/268 :: Added 268 new hashes from client
# I: Writing the cache to /home/user/.cache/emfind.pk ...

При emfind.files_from_client = true (содержимое торрент-файла из клиента)

(emonoda) 17:50:55  [~]
user@server $ emfind rebuild-cache
# I: Client rtorrent is ready
# I: Fetching all hashes from client ...
# I: Validating the cache ...
# I: 100.0% [████████████████████] 268/268 :: Loaded 268 torrents from /var/opt/docker/rtorrent-rutorrent/data/rtorrent/.session/*.torrent
Traceback (most recent call last):
  File "/home/user/venv/emonoda/bin/emfind", line 33, in <module>
    sys.exit(load_entry_point('emonoda==2.1.38', 'console_scripts', 'emfind')())
             ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^
  File "/home/user/venv/emonoda/lib/python3.13/site-packages/emonoda/apps/__init__.py", line 161, in wrap
    method()
    ~~~~~~^^
  File "/home/user/venv/emonoda/lib/python3.13/site-packages/emonoda/apps/emfind.py", line 274, in main
    get_cache(True)
    ~~~~~~~~~^^^^^^
  File "/home/user/venv/emonoda/lib/python3.13/site-packages/emonoda/apps/emfind.py", line 263, in get_cache
    return datacache.get_cache(
           ~~~~~~~~~~~~~~~~~~~^
        cache_path=config.emfind.cache_file,
        ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
    ...<5 lines>...
        log=log_stderr,
        ^^^^^^^^^^^^^^^
    )
    ^
  File "/home/user/venv/emonoda/lib/python3.13/site-packages/emonoda/helpers/datacache.py", line 57, in get_cache
    if _update(cache, client, files_from_client, torrents_dir_path, name_filter, log):
       ~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/user/venv/emonoda/lib/python3.13/site-packages/emonoda/helpers/datacache.py", line 135, in _update
    files=(client.get_files(torrent) if files_from_client else torrent.get_files()),
           ~~~~~~~~~~~~~~~~^^^^^^^^^
  File "/home/user/venv/emonoda/lib/python3.13/site-packages/emonoda/plugins/clients/__init__.py", line 46, in wrap
    return method(self, torrent_hash, *args, **kwargs)
  File "/home/user/venv/emonoda/lib/python3.13/site-packages/emonoda/plugins/clients/rtorrent.py", line 49, in wrap
    return method(self, *args, **kwargs)
  File "/home/user/venv/emonoda/lib/python3.13/site-packages/emonoda/plugins/clients/rtorrent.py", line 187, in get_files
    (base_file_name, is_multi_file, count, first_file_size) = tuple(mc())  # type: ignore
                                                              ~~~~~^^^^^^
  File "/usr/lib/python3.13/xmlrpc/client.py", line 828, in __getitem__
    raise Fault(item['faultCode'], item['faultString'])
xmlrpc.client.Fault: <Fault -500: 'Target of wrong type to command.'>

В моём случае сначала ошибка возникает во время вызова mc.f.size_bytes(torrent_hash, 0)

Возможно это связано с тем, что написано в документации к командам rTorrent в блоке "Important":

All d.* commands take an info hash as the first argument when called over the XML-RPC API, to uniquely identify the target object. ‘Target’ is the term used for that 1st parameter in error messages and so on.

d.name = `‹hash› ≫ string ‹name›

When called within configuration methods or in a Ctrl-X prompt, the target is implicit. It is explicit and must be provided for all XMLRPC calls, with very few exceptions like the xmlrpc-c built-ins.
Also note that rtxmlrpc has some magic that adds this to any command ending in .multicall or .multicall.filtered, from the time this change was introduced. d.multicall2 came later and thus needs an explicit target, and it is a bit of a mess. Changing this to be consistent is a breaking change, and might happen sometime in the future.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions