[solved] socket file

somus1735

Member
May 25, 2018
833
0
16
Unfortunately I'm stuck with error message "Bad link to rTorrent. Check if it is really running. Check $scgi_port and $scgi_host settings in config.php and scgi_port in rTorrent configuration file."

Yes, rtorrent is running and restarted, I've had similar problem before and after I changed plugins.ini [rpc] part, Rutorrent miracuously started. Not this time, I'm out of ideas, so I'm asking for help.

For example only plugins _getdir, cpuload, diskspace and rss can be seen on rutorrent page, although all plugins are enabled.

My quess is that this has something to do with Arch Linux rolling release, something changed but what and how to debug this issue?

Code:
// configuration parameters

// for snoopy client
@define('HTTP_USER_AGENT', 'Mozilla/5.0 (Windows; U; Windows NT 5.1; pl; rv:1.9) Gecko/2008052906 Firefox/3.0', true);
@define('HTTP_TIME_OUT', 30, true); // in seconds
@define('HTTP_USE_GZIP', true, true);

@define('RPC_TIME_OUT', 5, true); // in seconds

@define('LOG_RPC_CALLS', false, true);
@define('LOG_RPC_FAULTS', true, true);

// for php
@define('PHP_USE_GZIP', false, true);
@define('PHP_GZIP_LEVEL', 2, true);

$do_diagnostic = true;
$log_file = '/var/tmp/errors.log'; // path to log file (comment or make empty to disable logging)
$saveUploadedTorrents = true;

$topDirectory = '/'; // Upper available directory. Absolute path with trail slash.
$forbidUserSettings = false;

$scgi_port = 0;
$scgi_host = "unix:///home/dot/rtorrent/.socket/rpc.socket";

$XMLRPCMountPoint = "/RPC2"; // DO NOT DELETE THIS LINE!!! DO NOT COMMENT THIS LINE!!!

$pathToExternals = array(
"php" => '/usr/bin/php', // Something like /usr/bin/php. If empty, will be founded in PATH.
"curl" => '/usr/bin/curl', // Something like /usr/bin/curl. If empty, will be founded in PATH.
"gzip" => '/bin/gzip', // Something like /usr/bin/gzip. If empty, will be founded in PATH.
"id" => '/usr/bin/id', // Something like /usr/bin/id. If empty, will be founded in PATH.
"stat" => '/usr/bin/stat', // Something like /usr/bin/stat. If empty, will be founded in PATH.
);

snippet of .rtorrent.rc
Code:
schedule = chmod,0,0,"execute=chmod,777,/home/dot/rtorrent/.socket/rpc.socket"

scgi_local = /home/dot/rtorrent/.socket/rpc.socket

Php version is 5.3.4

I'm using Cherokee 1.0.15
Code: [Select]
vserver!2!collector!enabled = 1
vserver!2!directory_index = index.html,index.php
vserver!2!document_root = /srv/http/rutorrent/
vserver!2!error_writer!filename = /var/tmp/rutorrent-error.log
vserver!2!error_writer!type = file
vserver!2!nick = rutorrent
vserver!2!rule!50!document_root = /srv/http/rutorrent/
vserver!2!rule!50!handler = scgi
vserver!2!rule!50!handler!balancer = round_robin
vserver!2!rule!50!handler!balancer!source!10 = 11
vserver!2!rule!50!handler!balancer!source!20 = 1
vserver!2!rule!50!match = request
vserver!2!rule!50!match!request = /RPC2
vserver!2!rule!40!encoder!gzip = allow
vserver!2!rule!40!handler = fcgi
vserver!2!rule!40!handler!balancer = round_robin
vserver!2!rule!40!handler!balancer!source!10 = 1
vserver!2!rule!40!handler!balancer!source!20 = 11
vserver!2!rule!40!handler!error_handler = 1
vserver!2!rule!40!match = extensions
vserver!2!rule!40!match!extensions = php,html
vserver!2!rule!40!match!final = 1
vserver!2!rule!40!timeout = 20
vserver!2!rule!20!document_root = /usr/share/cherokee/icons
vserver!2!rule!20!handler = file
vserver!2!rule!20!match = directory
vserver!2!rule!20!match!directory = /icons
vserver!2!rule!10!document_root = /srv/http/rutorrent/
vserver!2!rule!10!handler = common
vserver!2!rule!10!handler!allow_dirlist = 1
vserver!2!rule!10!handler!allow_pathinfo = 1
vserver!2!rule!10!match = default
source!1!env!PHP_FCGI_CHILDREN = 5
source!1!env!PHP_FCGI_MAX_REQUESTS = 490
source!1!env_inherited = 1
source!1!group = http
source!1!host = 127.0.0.1:47990
source!1!interpreter = /usr/bin/php-cgi -b 127.0.0.1:47990
source!1!nick = PHP Interpreter
source!1!type = interpreter
source!1!user = dot
source!11!env_inherited = 1
source!11!group = http
source!11!host = /home/dot/rtorrent/.socket/rpc.socket
source!11!interpreter = /bin/sh
source!11!nick = rTorrent XMLRPC
source!11!type = interpreter
source!11!user = dot

Any ideas appreciated, thanks for reading!
 

somus1735

Member
May 25, 2018
833
0
16
Thanks wonslung! In the link you gave in reply#10 you mention php.ini and timezone. Indeed running php initplugins.php gave timezone errors. After I modified php.ini's timezone and restarted cherokee and rtorrent, rutorrent was in better shape. There are now all plugins and "Bad response from server: (0 [error,list])" that was caused by my plugins.ini conf - it was allowing all plugins when I was trying to figure out why there was only four plugins available. I disabled httprpc plugin, resfreshed rutorrent and voilá, things are back to normal.

Anyway, it's little pity that error messages are not more informative and it is little bit hard to figure out what is wrong.

By the way I tried google how to debug rpc file socket, so far no luck. Bad choice of keywords, I believe. Tip for that, anyone?
 

dsouvik215

Member
May 25, 2018
896
0
16
i would bet your issues are more cherokee related than anything.


I originally used cherokee myself but found it to be very unstable for rutorrent.

In my opinion apache is going to be the easiest, most reliable webserver for 99% of rutorrent users.

If you MUST use a more "light weight" webserver, i'd recommend nginx, though many people have success with lighttpd as well. I used cherokee for quite a long time but it seems the RPC module in cherokee is flakey, causing the exact error,list bug thing you are talking about.


Most of the ACTUAL error messages for rutorrent are very descriptive, the problem you are facing is the connection between rutorrent and rtorrent is failing. Rutorrent is a good portion javascript which means once you load the page (and it's running) it runs client side. If it fails to connect back to rtorrent sometime later due to a flakey SCGI connection, you will get all kinds of problems.

As far as leaving a rutorrent window open, i've been able to leave ones on apache open for days at a time, same with nginx, while cherokee would always die after a few hours.
 

somus1735

Member
May 25, 2018
833
0
16
I remember having problems few months ago, namely timeouts with cherokee. Despite that nowadays I've had session open for weeks without problem.

I reviewed upgrade log, both php and cherokee were upgraded. That was initial cause for my problems, I must have done application restarts somehow wrongly, because I couldn't reproduce similar problem.

If anyone faces similar problem, check php.ini timezone setting (it is good to be correct anyway, while in this case not essential correction) and stop cherokee, rtorrent / start rtorrent, cherokee, not just restart.

Still it is not enough if most error messages are descriptive, they are in general major Achille's heel in nearly any program. I sincerely hope programmers pay better attention to them.

Also thanks for nginx tip, might be useful some day! Meanwhile I'll keep cherokee.
 

dsouvik215

Member
May 25, 2018
896
0
16
i think i might have misunderstood your previous response, i wasn't aware you were saying the timezone setting completely solved your problems, i am glad this is the case.

If aint broke, don't fix it. (regarding cherokee)

anyways, i'm glad you got it working.