mountainpenguin / pyrt

python rtorrent webUI
GNU General Public License v3.0
34 stars 11 forks source link

When starting I get an error #45

Closed rjalexa closed 8 years ago

rjalexa commented 8 years ago

bob@rpi-b:~/pyrt-master$ ./pyrt start pyRT rtorrent webUI v1.0.0 Copyright (C) 2012 mountainpenguin This program comes with ABSOLUTELY NO WARRANTY This is free software, and you are welcome to redistribute it under certain conditions See LICENCE for details

Traceback (most recent call last): File "./pyrt", line 224, in start(args.noupdate) File "./pyrt", line 104, in start if _searchPID(): File "./pyrt", line 50, in _searchPID if p.uids().real != os.getuid(): TypeError: 'user' object is not callable

mountainpenguin commented 8 years ago

Hi,

Sorry for the late response, I believe this may be caused by a (very) out of date version of psutil. I'm currently using version 4.3.0 without this issue.

You should be able to check your psutil version with this command: python -c "import psutil; print(psutil.__version__)"

You can upgrade using pip quite easily if this is indeed causing the problem.

rjalexa commented 8 years ago

You are totally right ! :-)

bob@rpi-b:~$ python -c "import psutil; print(psutil.version)" 0.5.0

:-(

This is on a Rasberry (arm architecture) box

Now used pip to upgrade and:

bob@rpi-b:~$ python -c "import psutil; print(psutil.version)" 4.3.0

rjalexa commented 8 years ago

Still have further trouble though:

bob@rpi-b:~/pyrt-master$ ./pyrt start
pyRT rtorrent webUI v1.0.0
Copyright (C) 2012 mountainpenguin
This program comes with ABSOLUTELY NO WARRANTY
This is free software, and you are welcome to redistribute it under certain conditions
See LICENCE for details

Not a git repository
Loading pyRT configuration from /home/bob/pyrt-master/config/.pyrtrc
Starting daemon with log file pyrt.log

Just our of curio what does the "Not a git repo" means ?

bob@rpi-b:~/pyrt-master$ cat *log
[I 160823 16:17:07 server:850] Starting webserver on http://192.168.174.9:8000 with PID 15272
Traceback (most recent call last):
  File "./pyrt", line 224, in <module>
    start(args.noupdate)
  File "./pyrt", line 125, in start
    serv.main(c)
  File "/home/bob/pyrt-master/modules/server.py", line 854, in main
    s_rss = tornado.netutil.bind_unix_socket(".sockets/rss.interface")
  File "/usr/lib/python2.7/dist-packages/tornado/netutil.py", line 298, in bind_unix_socket
    sock.bind(file)
  File "/usr/lib/python2.7/socket.py", line 224, in meth
    return getattr(self._sock,name)(*args)
socket.error: [Errno 2] No such file or directory
bob@rpi-b:~/pyrt-master$ ls -l /tmp
total 4
-rw-rw-rw- 1 www-data www-data 1125 Aug 22 17:16 errors.log
drwx------ 3 bob      bob        60 Aug 23 16:11 pip-mJRouY-uninstall
srw-rw-rw- 1 root     root        0 Aug 22 17:12 rtorrent.dtach
srwxrwxrwx 1 root     www-data    0 Aug 22 17:12 rtorrent.sock

and the loaded config file contains:

{
    ## the *full* path to the rtorrent socket file
    ## this is defined in .rtorrent.rc as scgi_local
    ## REQUIRED
    "rtorrent_socket" : "/tmp/rtorrent.sock",
mountainpenguin commented 8 years ago

Running on a rPi is pretty cool, how does rTorrent hold up performance-wise on one?

It seems to be having a problem with the RSS socket rather than the rTorrent socket though, which is strange. Does the .sockets directory exist in the pyrt directory?

Not a git repository means that the .git directory doesn't exist in the current directory, which is also strange.

Did you perhaps mv * the contents after cloning the repository? This might explain a missing .sockets directory, as well as Not a git repository, since mv wildcards don't include hidden files.

rjalexa commented 8 years ago

Our knowledge/intelligence differential is too wide with you a genius and me a moron :-)

Yes I had downloaded the git repo on a Mac, zipped it and sent it to my RPi via SSH and lost hidden files int he process :-)

So now PyRT starts, after the password it took quite a long time and then got a spinning "crown" and a message saying to click here for a newer version (this just after cloning git on the RPi ??)

Now waiting to see what happens.

Wow .. a bit slow in building the page but very nice thereafter:

http://imgur.com/a/TIX2D

rtorrent on the RPi works well and never blinked with around 800 seeding torrents. I used rutorrent until now but from times to times the file socket communication between rutorrent and rtorrent breaks without myself never finding out why and how to fix (just randomly after a few shutdowns and reboots it resumes but unpredictably so).

Thanks for all of the support !!!!

screen shot 2016-08-23 at 19 27 16

rjalexa commented 8 years ago

Seems that pyrt and python and a bit "heavy" for the poor RPi (which is also running a nginx+rtorrent+rutorrent instance concurrently) :-) but slowness aside it is very predictable (quite the opposite of the rutorrent instance which is very responsive but a bit unreliable).

screen shot 2016-08-23 at 19 31 32

mountainpenguin commented 8 years ago

Yeah, I imagine that it wouldn't run too speedily on a rPi, especially with almost 800 torrents.

If I had time I might try to optimise/rewrite the thing, but as you may have noticed from my commit history, I haven't had much time to dedicate to this for quite some time now unfortunately.

I imagine that if rutorrent has trouble with the file socket that pyrt might have trouble in the future too though.

The newer version thing is me experimenting with HTML5 cache manifests, back when they were shiny and new, not sure how I would avoid it saying that the first time it loads up, though it would probably be possible. I believe that cache manifests are going to be removed in the future (probably since they're so annoying to work with!), but it does still increase page load times after the first time I hope.

Glad you got it up and running though!