Novik / ruTorrent

Yet another web front-end for rTorrent
Other
2.03k stars 412 forks source link

$XMLRPCMountPoint have no effect #1895

Closed SSoft7 closed 4 years ago

SSoft7 commented 5 years ago

Hi,

Here is my config.php. As you can see I am using SCGI port to connect to rtorrent. Here rutorrent is working with or without the variable $XMLRPCMountPoint mentioned. is the variable valid anymore? I have also tried removing RPC mount from webserver config but it still works. The only thing that have working effect is the $scgi_port and $scgi_host variable.

Am i doing anything wrong?

<?php
  @define('HTTP_USER_AGENT', 'Mozilla/5.0 (Windows NT 6.0; WOW64; rv:12.0) Gecko/20100101 Firefox/12.0', true);
  @define('HTTP_TIME_OUT', 30, true);
  @define('HTTP_USE_GZIP', true, true);
  $httpIP = null;
  @define('RPC_TIME_OUT', 5, true);
  @define('LOG_RPC_CALLS', false, true);
  @define('LOG_RPC_FAULTS', true, true);
  @define('PHP_USE_GZIP', false, true);
  @define('PHP_GZIP_LEVEL', 2, true);
  $schedule_rand = 10;
  $do_diagnostic = true;
  $log_file = '/tmp/errors.log';
  $saveUploadedTorrents = true;
  $overwriteUploadedTorrents = false;
  $topDirectory = '/home/testuser/';
  $forbidUserSettings = false;
  $scgi_port = 42513;
  $scgi_host = "localhost";
  $XMLRPCMountPoint = "/sdsdsdsRPC2s";
$pathToExternals = array(
"php" => '/usr/bin/php', // Something like /usr/bin/php. If empty, will be found in PATH.
"curl" => '/usr/bin/curl', // Something like /usr/bin/curl. If empty, will be found in PATH.
"gzip" => '/bin/gzip', // Something like /usr/bin/gzip. If empty, will be found in PATH.
"id" => '/usr/bin/id', // Something like /usr/bin/id. If empty, will be found in PATH.
"stat" => '/usr/bin/stat', // Something like /usr/bin/stat. If empty, will be found in PATH.
"pgrep" => '/usr/bin/pgrep', // Something like /usr/bin/pgrep. If empty, will be found in PATH.
"python" => '/usr/bin/python', // Something like /usr/bin/pgrep. If empty, will be found in PATH.
);
  $localhosts = array("127.0.0.1", "localhost",);
  $profilePath = '../share';
  $profileMask = 0777;
  $autodlPort = 23139;
  $autodlPassword = "IIveQMdz6aFflnZS";
  $diskuser = "/";
  $quotaUser = "testuser";
Micdu70 commented 5 years ago

Hello, It's because your rutorrent is using "rpc" and/or "httprpc" plugin. ;) Wiki => https://github.com/Novik/ruTorrent/wiki/PluginHTTPRPC

SSoft7 commented 5 years ago

Hello, It's because your rutorrent is using "httprpc" plugin. ;) Wiki => https://github.com/Novik/ruTorrent/wiki/PluginHTTPRPC

Oh, I see, I thought I had some kind of misconfiguration. Now, I am thinking to remove it. But the wiki says

(This does not mean you can remove the $XMLRPCMountPoint entry from your ruTorrent/conf/config.php file.)

Any idea? why?

Micdu70 commented 5 years ago

If you don't set $XMLRPCMountPoint in config.php file, "/RPC2" mount point will always be used because it's the default value if "httprpc" or "rpc" plugin isn't used. It's required to connect to rtorrent client and initialize ruTorrent plugins. It will not be a problem if you don't create multiple users for ruTorrent BUT you will get this following PHP notice in server log: Undefined variable: XMLRPCMountPoint in /var/www/rutorrent/php/getplugins.php on line 223"

SSoft7 commented 5 years ago

Actually, I am using multiuser setup and still can't figure out which plugins it will break, can you mention few plugin names, please?

Micdu70 commented 5 years ago

It's about the initialization of all plugins when connection to rtorrent via XMLRPCMountPoint is done. But "httprpc" plugin changes $XMLRPCMountPoint to "/plugins/httprpc/action.php", this PHP file can handle multi-users config. :)

EDIT: Same with "rpc" plugin => changes $XMLRPCMountPoint to "/plugins/rpc/rpc.php", handle multi-users config too. ^^

XxAcielxX commented 5 years ago

In Arch AUR version of rutorrent it is $XMLRPCMountPoint = /rutorrent/rpc1

Micdu70 commented 5 years ago

@XxAcielxX Are you sure? I actually see "/RPC2" => https://aur.archlinux.org/packages/rutorrent/

So... $XMLRPCMountPoint variable may be optional.

XxAcielxX commented 5 years ago

@Micdu70 sorry I forgot to say AUR rutorrent-git version. Non git is Out of date.

        $scgi_port = 5000;
    $scgi_host = "127.0.0.1";

    // For web->rtorrent link through unix domain socket 
    // (scgi_local in rtorrent conf file), change variables 
    // above to something like this:
    //
    // $scgi_port = 0;
    // $scgi_host = "unix:///tmp/rpc.socket";

    $XMLRPCMountPoint = "/rutorrent/RPC1";

    $pathToExternals = array(
        "php"   => '/usr/bin/php',
        "curl"   => '/usr/bin/curl',
        "gzip"   => '/usr/bin/gzip',
        "id"   => '/usr/bin/id',
        "stat"   => '/usr/bin/stat',
    );
borygo77 commented 4 years ago

Guys having problem with scgi port in my setup :/ After last packages update and server reboot rtorrent never could start again until I've changed scgi port to different than ruTorrent user settings. If I do that rtorrent starts and seeding but haven't got connection to ruTorrent. Once I'll bring back scgi port to proper value rtorrent is crashing. Tried add another user then another one and it's all same rtorrent crashing on them if scgi port is same in .rtorrent.rc and user config.php in var/www. Appreciate any help!

Micdu70 commented 4 years ago

@borygo77 Hello, what's your OS? How did you install rTorrent/libtorrent? Which version? Paste your .rtorrent.rc config file too.

borygo77 commented 4 years ago

Hi Micdu. I'm on Ubuntu 16.04 rtorrent and libtorrent is installed through rtinst script and run in screen. At the moment got 0.9.6 with libtorrent 13.6. Tried updateing and downgrading but nothing helped :( It was running great for nearly a year but after last packages update and reboot of system rtorrent never came back just kept crashing :/ Got rtorrent running only if network.scgi.open_port is different in RuTorrent and rtorrent config files. Attaching my rtorrent.rc and rutorrent config configs.zip

Thank you :)

Micdu70 commented 4 years ago

@borygo77 You don't set "$scgi_host" in config.php, must set it => $scgi_host = "127.0.0.1"; Can you send "/tmp/errors.log" if it exists.

borygo77 commented 4 years ago

If I do this then getting 500 error in web interface ;) "/tmp/errors.log" doesn't exist I'm afraid :(

Micdu70 commented 4 years ago

You need to check Webserver and PHP logs so. ^^ EDIT: To enable ruTorrent's log, add $log_file = '/tmp/errors.log'; in config.php

borygo77 commented 4 years ago

Plenty of errors in nginx server log. Does it say anything ?

2019/11/16 19:26:09 [error] 1600#1600: *5656 FastCGI sent in stderr: "PHP message: PHP Parse error: syntax error, unexpected '.1' (T_DNUMBER) in /var/www/rutorrent/conf/users/tom/config.php on line 6" while reading response header from upstream, client: xx.xx.xx.xx server: xxx.co.uk, request: "GET /rutorrent/php/getplugins.php HTTP/1.1", upstream: "fastcgi://unix:/var/run/php/php7.0-fpm.sock:", host: "xxx.co.uk", referrer: "https://xxx.co.uk/rutorrent/"

borygo77 commented 4 years ago

Here is what I got after starting rtorrent from terminal. It crashing after a minute if scgi ports are same in rtorrent.rc and rutorrent user config.php

Caught Segmentation fault, dumping stack: rtorrent() [0x415ca7] rtorrent() [0x45286c] /lib/x86_64-linux-gnu/libc.so.6(+0x354b0) [0x7f99b1a744b0] /lib/x86_64-linux-gnu/libc.so.6(+0x9fa10) [0x7f99b1adea10] /usr/lib/x86_64-linux-gnu/libxmlrpc.so.3(+0xbf94) [0x7f99b2ad8f94] /usr/lib/x86_64-linux-gnu/libxmlrpc_xmlparse.so.3(+0x5143) [0x7f99b006c143] /usr/lib/x86_64-linux-gnu/libxmlrpc_xmlparse.so.3(+0x6e41) [0x7f99b006de41] /usr/lib/x86_64-linux-gnu/libxmlrpc_xmlparse.so.3(+0x7fbe) [0x7f99b006efbe] /usr/lib/x86_64-linux-gnu/libxmlrpc_xmlparse.so.3(+0x8bc5) [0x7f99b006fbc5] /usr/lib/x86_64-linux-gnu/libxmlrpc_xmlparse.so.3(+0x929d) [0x7f99b007029d] /usr/lib/x86_64-linux-gnu/libxmlrpc_xmlparse.so.3(xmlrpc_XML_Parse+0x225) [0x7f99b006da15] /usr/lib/x86_64-linux-gnu/libxmlrpc.so.3(xml_parse+0xcb) [0x7f99b2ad91eb] /usr/lib/x86_64-linux-gnu/libxmlrpc.so.3(xmlrpc_parse_call+0xb0) [0x7f99b2ad96d0] /usr/lib/x86_64-linux-gnu/libxmlrpc_server.so.3(xmlrpc_registry_process_call2+0xbd) [0x7f99b2ce3f5d] /usr/lib/x86_64-linux-gnu/libxmlrpc_server.so.3(xmlrpc_registry_process_call+0x25) [0x7f99b2ce40f5] rtorrent() [0x52a612] rtorrent() [0x528fae] rtorrent() [0x529942] /usr/lib/libtorrent.so.19(_ZN7torrent9PollEPoll7performEv+0x14a) [0x7f99b2f2bbfa] /usr/lib/libtorrent.so.19(_ZN7torrent9PollEPoll7do_pollEli+0x61) [0x7f99b2f2bca1] Aborted (core dumped)

Micdu70 commented 4 years ago

@borygo77 About nginx error => You forgot to add double quote (") in config.php for this line $scgi_host = "127.0.0.1"; About rtorrent crash => Compile it manually with stable xmlrpc-c repo

borygo77 commented 4 years ago

Here is the fix:

sudo svn checkout http://svn.code.sf.net/p/xmlrpc-c/code/stable@2954 xmlrpc-c cd xmlrpc-c sudo ./configure --disable-cplusplus sudo make sudo make install

After this update rtorrent to 0.9.8 Make sure you have same port in rtorrent.rc and user rutorrent config :)

stale[bot] commented 4 years ago

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.