pyrosimple icon indicating copy to clipboard operation
pyrosimple copied to clipboard

pyrotorque not starting

Open Aqualie opened this issue 1 year ago • 7 comments

Similiar to https://github.com/kannibalox/pyrosimple/issues/41 After building with the latest pyrosimple@latest GIT I can no longer get pyrotorque to start.

rtorrent [ ~/.pyrosimple ]$ pyrotorque --debug --adopt-stale-pid-file
DEBUG:pyrosimple.scripts.pyrotorque.RtorrentQueueManager:Options: adopt_stale_pid_file=True, dry_run=False, log_file=None, log_level=10, no_fork=False, pid_file=None, print_completion=None, restart=False, run_once=None, status=False, stop=False, url=None
DEBUG:pyrosimple.config:Configuration file '/opt/rtorrent/.config/pyrosimple/config.py' not found.
ERROR:pyrosimple.scripts.pyrotorque.RtorrentQueueManager:Cannot lock pidfile: failed to create ~/.pyrosimple/run/pyrotorque.pid
INFO:pyrosimple.scripts.pyrotorque.RtorrentQueueManager:Total time: 0.334 seconds.
rtorrent [ ~ ]$ id
uid=1001(rtorrent) gid=1002(rtorrent) groups=1002(rtorrent)
rtorrent [ ~ ]$ ls -lna  | grep pyrosimple
drwxr-xr-x 1 1001 1002   4096 Jan 19 17:44 .pyrosimple
rtorrent [ ~ ]$ ls -lna .pyrosimple/ | grep run
drwxr-xr-x 1 1001 1002 4096 Jan 19 19:52 run
rtorrent [ ~ ]$ touch  ~/.pyrosimple/run/pyrotorque.pid
rtorrent [ ~ ]$ ls -lha ~/.pyrosimple/run/
total 12K
drwxr-xr-x 1 rtorrent rtorrent 4.0K Jan 19 19:59 .
drwxr-xr-x 1 rtorrent rtorrent 4.0K Jan 19 17:44 ..
-rw-r--r-- 1 rtorrent rtorrent    0 Jan 19 19:59 pyrotorque.pid

This was working fine before I updated to the latest git hash not sure what the problem is as you can see the permissions and user ID is fine/correct.

Aqualie avatar Jan 19 '25 19:01 Aqualie

Hm, that's very strange, that code hasn't changed in a while, and I'm unable to reproduce it locally. If you remove the empty file manually, does it throw the same error?

kannibalox avatar Jan 20 '25 05:01 kannibalox

Yes the example was just to show that I can manually create the PID file as the same user so not sure what the problem is.

Aqualie avatar Jan 21 '25 17:01 Aqualie

Turns out I was too focused on the locking library, the issue ended up being that the config file wasn't expanding ~ properly anymore, should be fixed now.

kannibalox avatar Jan 22 '25 21:01 kannibalox

I tested this again and still getting the same error.

Aqualie avatar Jan 31 '25 00:01 Aqualie

Hm, I just double checked and the latest code should definitely fix the specific issue I mentioned, can you confirm for me that you are indeed setting a custom PID file in config.toml?

$ grep TORQUE._settings ~/.config/pyrosimple/config.toml -A 2
[TORQUE._settings]
pid_file = "~/.pyrosimple/run/pyrotorque.pid"
$ git checkout 42627cb719f5055f2c4b34409bcfff04fffe64ba
$ poetry run pyrotorque --adopt-stale-pid-file -v 
ERROR:pyrosimple.scripts.pyrotorque.RtorrentQueueManager:Cannot lock pidfile: failed to create ~/.pyrosimple/run/pyrotorque.pid
$ git checkout main
$ poetry run pyrotorque --adopt-stale-pid-file -v
INFO:pyrosimple.scripts.pyrotorque.RtorrentQueueManager:Writing pid to /home/kannibalox/.pyrosimple/run/pyrotorque.pid and detaching process...
INFO:pyrosimple.scripts.pyrotorque.RtorrentQueueManager:Logging stderr/stdout to '/dev/null'

kannibalox avatar Feb 01 '25 15:02 kannibalox

OK I see two problems here:

  1. I don't have this pid_file setting in my configuration so I added it
  2. There's no new version of pyrosimple so I dropped the pip install pyrosimple[torque] and just kept the pip install using git+https:// not sure what the problem will be w/o having also torque

Aqualie avatar Feb 02 '25 01:02 Aqualie

Can we publish a new build w/ the fix so I can test it out?

Aqualie avatar Feb 13 '25 20:02 Aqualie