kannibalox / pyrosimple

An overhauled fork of the pyrocore tools for rTorrent
https://kannibalox.github.io/pyrosimple/
GNU General Public License v3.0
48 stars 5 forks source link

pyrotorque crashes #54

Closed alzheimerspenguin closed 11 months ago

alzheimerspenguin commented 11 months ago

Hi, Not really sure what I'm doing wrong here.

If relevant, my platform is 32 bit ARM so perhaps that is going to be no bueno.

➜  ~ pyrotorque --restart --fg --debug 
DEBUG:pyrosimple.scripts.pyrotorque.RtorrentQueueManager:Options: adopt_stale_pid_file=False, dry_run=False, log_file=None, log_level=10, no_fork=True, pid_file=None, print_completion=None, restart=True, run_once=None, status=False, stop=False, url=None
DEBUG:pyrosimple.config:Configuration file '/home/alzheimers/.config/pyrosimple/config.py' not found.
INFO:pyrosimple.scripts.pyrotorque.RtorrentQueueManager:No pid file '/run/user/1000/pyrotorque.pid'
/home/alzheimers/.local/pipx/venvs/pyrosimple/lib/python3.11/site-packages/tzlocal/unix.py:192: UserWarning: Can not find any timezone configuration, defaulting to UTC.
  warnings.warn("Can not find any timezone configuration, defaulting to UTC.")
2023-09-18 06:57:06,514 DEBUG pyrosimple.config: Loading rtorrent config from '/home/alzheimers/.rtorrent.rc'
2023-09-18 06:57:06,518 DEBUG pyrosimple.config: rtorrent.rc: network.scgi.open_local = /home/alzheimers/rpc.socket
2023-09-18 06:57:06,519 DEBUG pyrosimple.pyrotorque.jobs.tv: pyrosimple.job.base:tv created with config {'handler': 'pyrocore.job.watch:TreeWatch', 'schedule': {'minute': '*/1'}, 'check_unhandled': True, 'path': '/home/alzheimers/data/torrents/watch/tv', 'started': False, 'cmd_download_directory': 'd.directory.set=/home/alzheimers/data/torrents/tv', 'dry_run': False}
2023-09-18 06:57:06,520 DEBUG pyrosimple.util.rpc: method 'system.multicall', params ([{'methodName': 'system.client_version', 'params': []}, {'methodName': 'system.library_version', 'params': []}, {'methodName': 'system.time_usec', 'params': []}, {'methodName': 'session.name', 'params': []}, {'methodName': 'session.path', 'params': []}, {'methodName': 'system.cwd', 'params': []}],)
2023-09-18 06:57:06,523 DEBUG pyrosimple.util.rpc: method 'startup_time', params ()
2023-09-18 06:57:06,526 DEBUG pyrosimple.torrent.rtorrent.RtorrentEngine: RtorrentEngine connected to alarm:707 [rTorrent 0.13.8/0.9.8] via 'scgi+unix:///home/alzheimers/rpc.socket'
2023-09-18 06:57:06,531 DEBUG pyrosimple.util.rpc: method 'd.hash', params ('03A10CC1C3BA2235B017264693261C1E7FDB6B3C',)
2023-09-18 06:57:06,534  INFO pyrosimple.pyrotorque.jobs.tv: Hash 03A10CC1C3BA2235B017264693261C1E7FDB6B3C already found in client, skipping
2023-09-18 06:57:06,536 DEBUG pyrosimple.util.rpc: method 'd.hash', params ('97C055B0E73C1BC751B37267AFE12C54E2391CED',)
2023-09-18 06:57:06,538  INFO pyrosimple.pyrotorque.jobs.tv: Hash 97C055B0E73C1BC751B37267AFE12C54E2391CED already found in client, skipping
2023-09-18 06:57:06,550 DEBUG pyrosimple.pyrotorque.jobs.queue: pyrosimple.job.base:queue created with config {'handler': 'pyrocore.job.queue:QueueManager', 'schedule': {'minute': '*/1'}, 'start_at_once': 1, 'downloading': 'is_active=yes is_complete=no down>0', 'downloading_max': 1, 'dry_run': False}
2023-09-18 06:57:06,551  INFO pyrosimple.scripts.pyrotorque.RtorrentQueueManager: Shutting down scheduler...
2023-09-18 06:57:06,551  INFO pyrosimple.scripts.pyrotorque.RtorrentQueueManager: Total time: 0.586 seconds.
Traceback (most recent call last):
  File "/home/alzheimers/.local/bin/pyrotorque", line 8, in <module>
    sys.exit(run())
             ^^^^^
  File "/home/alzheimers/.local/pipx/venvs/pyrosimple/lib/python3.11/site-packages/pyrosimple/scripts/pyrotorque.py", line 349, in run
    RtorrentQueueManager().run()
  File "/home/alzheimers/.local/pipx/venvs/pyrosimple/lib/python3.11/site-packages/pyrosimple/scripts/base.py", line 178, in run
    self.mainloop()
  File "/home/alzheimers/.local/pipx/venvs/pyrosimple/lib/python3.11/site-packages/pyrosimple/scripts/pyrotorque.py", line 339, in mainloop
    self.add_jobs()
  File "/home/alzheimers/.local/pipx/venvs/pyrosimple/lib/python3.11/site-packages/pyrosimple/scripts/pyrotorque.py", line 144, in add_jobs
    self.classes[name] = params["__handler"](params)
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/home/alzheimers/.local/pipx/venvs/pyrosimple/lib/python3.11/site-packages/pyrosimple/job/queue.py", line 22, in __init__
    super().__init__(config)
  File "/home/alzheimers/.local/pipx/venvs/pyrosimple/lib/python3.11/site-packages/pyrosimple/job/base.py", line 57, in __init__
    query_tree = matching.QueryGrammar.parse(self.config["matcher"])
                                             ~~~~~~~~~~~^^^^^^^^^^^
KeyError: 'matcher'
[TORQUE]

[TORQUE.tv]
handler = "pyrocore.job.watch:TreeWatch"
schedule = "minute=*/1"
check_unhandled = true
path = "/home/alzheimers/data/torrents/watch/tv"
started = false
cmd_download_directory = "d.directory.set=/home/alzheimers/data/torrents/tv"

[TORQUE.queue]
handler         = "pyrocore.job.queue:QueueManager"
schedule        = "minute=*/1"
start_at_once   = 1
downloading     = "is_active=yes is_complete=no down>0"
downloading_max = 1
kannibalox commented 11 months ago

matcher is a required field for the QueueManager, e.g.

[TORQUE.queue]
handler         = "pyrocore.job.queue:QueueManager"
schedule        = "minute=*/1"
start_at_once   = 1
matcher         = "is_ignored=no is_open=no message=\"\" done=0"
downloading     = "is_active=yes is_complete=no down>0"
downloading_max = 1

That seems like a pretty sane default, I might add it directly to the code

alzheimerspenguin commented 11 months ago

It just werks! Thanks for keeping the dream alive, you're awesome.