• Seedbox
  • rTorrent bad response from server (404 error list)

C'est bien un choix volontaire d'avoir sauté le chroot user et choisi un 777 sur le /home ?
777 kaotik:kaotik /home/kaotik
Ex.

    xavier
    Salut et merci, ça roule nickel, j'avais beau relire je ne voyais pas les erreurs.
    ex_rat
    Oui, c'est un choix volontaire car c'est le seul user et parfois besoin de se "déplacer" dans la racine.

      Mildred plutôt merci a @ex_rat car cest lui qui a fait toute les démarches pour trouvé la panne..

      Salut,
      Au temps pour moi, j'ai manqué de politesse.
      Merci @ex_rat pour le check et @xavier pour la correction.

      7 jours plus tard

      Bonjour,
      J'ai le même soucis, en local, j'ai bien accès à Rutorrent, je voit mes DL aucune erreurs.
      Par contre, depuis l'extérieur, avec un reverse proxy, je n'ai accès qu'à l'interface et je ne voit aucun torrent : http://paste.ubuntu.com/26071660/

      5 mois plus tard

      Bonjour à tous,

      J'ai le même problème depuis quelques mois. Tout fonctionnait très bien auparavant et je n'ai apporté aucune modification. Pourtant ce problème est apparu du jour au lendemain sans que je ne trouve de solutions... Ce qui est bizarre c'est qu'en patientant quelques jours le problème disparaît de lui-même et ça refonctionne jusqu'à un moment totalement aléatoire où il va re-surgir... !!

      Voici le rapport après l'exécution du script Debug de ce site Mondedie :

      http://paste.ubuntu.com/p/sTjb5P5zjm/

      Merci par avance pour votre aide précieuse 😉

        Nitua Salut, déjà que quelqu'un me corrige si je te dis de la 💩 mais lors d'une installe normal on est pas sensé avoir 755 root:root /home/nitua

        Ensuite :

        .......................................................................................................................................
        ## Test rTorrent & sgci
        .......................................................................................................................................
        
        rTorrent down
        Aucun programme n'écoute sur le port 5012
        Mauvais port SCGI renseigné dans le fichier config.php
        Les ports nginx et celui indiqué correspondent
        

        Commence par tout redémarrer proprement (remplacer toto par l'utilisateur souhaité) :

        killall --user toto rtorrent
        killall --user toto screen
        rm /home/toto/.session/rtorrent.lock
        /etc/init.d/toto-rtorrent start
        
          9 mois plus tard

          Banip Désolé de débarquer des mois après mais je tenais quand même à te remercier pour ton aide qui m'a été très utile 😉

          un an plus tard

          Bonjour,

          J'ai suivi ce très bon tuto pour l'installation de rutorrent sur Debian 10 : https://mondedie.fr/d/10831

          J'avais déployé 4 seedboxes pour 4 users, sur les ports 5001, 5002, 5003 et 5004, celles-ci fonctionnent à merveille. J'ai souhaité, quelque temps après, ajouter un utilisateur supplémentaire, j'ai donc refait la même chose pour ce nouveau user sur le port 5005, et cette fois j'ai cette même erreur lorsque je me connecte à rutorrent avec cet utilisateur :

          Bad response from server: (404 [error,list]) <html> <head><title>404 Not Found</title></head> <body bgcolor="white"> <center><h1>404 Not Found</h1></center> <hr><center>nginx</center> </body> </html>

          Je précise que, bien que l'interface n'affiche aucun torrent, lorsque j'ajoute un torrent, il est bien envoyé à rtorrent, car le fichier est téléchargé.

          J'ai donc passé en revue tous les fichiers de conf, mais je n'y trouve aucune erreur. Le port est bien 5005 partout, le RPC mount point est cohérent entre /var/www/rutorrent/conf/users/<mon_nouveau_user>/config.php et mon bloc "location = /MON_NOUVEAU_USER" dans la config de nginx. Ne trouvant aucun problème dans la conf, j'ai utilisé le script de debug sur ce user, mais le rapport ne fait état d'aucun problème. Pour aller plus loin, j'ai passé le script également sur un des users pour qui rutorrent fonctionne bien, et j'ai fait un diff entre les deux rapports : je ne vois aucune différence entre les deux.

          Dans les logs nginx, c'est cette erreur qui apparait à chaque http 404 :
          [error] 5760#5760: *15 open() "/var/www/MON_NOUVEAU_USER" failed (2: No such file or directory)

          Je constate la même chose dans les outils de développement de firefox, la requête vers le RPC mount point https://<mon_domaine>/MON_NOUVEAU_USER se voit répondre http 404. Pour mes autres users, j'ai bien un http 200 en réponse de ces requêtes.

          Après de nombreuses heures à fouiller les confs et les log, je suis complétement à court d'idée.

          Voici les rapports du script de debug :
          Rapport pour user1, pour qui rutorrent est fonctionnel :
          Rapport pour toto, pour qui rutorrent a l'erreur 404 :

          Les rapports sont anonymisés, j'ai remplacé les nom d'utilisateurs par user1, user2, user3, user4 + le nouveau user problématique : toto. Le domaine a été remplacé par exemple.com, les ip clientes masqués.

          Si quelqu'un a une piste pour corriger le problème, je serais très intéressé de lire vos suggestions 🙂

          Merci par avance de votre aide!

            arnobru J'ai vu une erreur

            Dans le fichier /var/www/rutorrent/plugins/create/conf.php
            mktorrent entre guillemet

            $useExternal = 'mktorrent'; 

            Ensuite on peut voir la conf du user5 dans nginx?
            /etc/nginx/sites-enabled/seedbox.conf

              Magicalex Merci de ta réponse, car ta question m'a fait trouvé l'erreur 🙂.

              Suite à l'installation initiale des 4 premières seedbox, j'avais rajouté une configuration https avec letsencrypt. Certbot m'avait dupliqué tout le bloc de config server { } pour les accès https. Par conséquent, les sous-bloc "location = /USER {}" sont également présents en double dans la conf. Comme j'avais pas conscience de cela, j'avais uniquement rajouté le nouveau user dans le premier bloc server {} en http 80, alors qu'il faut qu'il soit présent dans l'autre bloc server() en https 443. Comme tu m'as demandé des infos issues de ce fichier, j'ai pensé bon de fournir l’entièreté du fichier, et c'est là que j'ai vu l'erreur, évidente une fois qu'on regarde plus bas dans le fichier de conf 😅

              Une fois la config rajouté dans l'autre bloc server, sans surprise, tout fonctionne correctement...

              Merci beaucoup, j'espère que cela servira à quelqu'un un jour! Plus généralement merci à cette communauté pour l'aide et les tutos, c'est très précieux! 😄

                2 ans plus tard

                si une âme charitable peux bien me trouver l'erreur car sa me rend fou de ne pas trouver grrrr

                `

                Rapport pour ruTorrent généré le 14-09-2021 à 13:08

                Utilisateur ruTorrent --> ramutcho

                Debian : 10.10
                Kernel : 4.19.0-17-amd64
                CPU : Intel(R) Xeon(R) CPU E3-1220 V2 @ 3.10GHz
                nGinx : 1.14.2
                ruTorrent : 3.10
                rTorrent : 0.9.8
                PHP : 8.0

                --> Utilisateur ramutcho existant
                Le programme pastebinit est installé

                .......................................................................................................................................

                Partitions & Droits

                .......................................................................................................................................

                Sys. de fichiers Taille Utilisé Dispo Uti% Monté sur
                udev 16G 0 16G 0% /dev
                tmpfs 3,2G 137M 3,1G 5% /run
                /dev/md1 7,3T 1,8T 5,1T 26% /
                tmpfs 16G 0 16G 0% /dev/shm
                tmpfs 5,0M 0 5,0M 0% /run/lock
                tmpfs 16G 0 16G 0% /sys/fs/cgroup
                /dev/md0 999M 48M 883M 6% /boot
                overlay 7,3T 1,8T 5,1T 26% /var/lib/docker/overlay2/399209a7b53d3f3e4bf0d790d6506d1e8a5a85910090ff6fd5debebebfa99969/merged
                tmpfs 3,2G 0 3,2G 0% /run/user/0

                755 root:ramutcho /home/ramutcho
                644 ramutcho:ramutcho /home/ramutcho/.rtorrent.rc
                755 ramutcho:ramutcho /home/ramutcho/.session
                755 ramutcho:ramutcho /home/ramutcho/torrents
                755 ramutcho:ramutcho /home/ramutcho/watch

                .......................................................................................................................................

                Test rTorrent & sgci

                .......................................................................................................................................

                rTorrent Up
                Un socket écoute sur le port 5001
                C'est bien rTorrent qui écoute sur le port 5001
                Bon port SCGI renseigné dans le fichier config.php
                Les ports nginx et celui indiqué correspondent

                .......................................................................................................................................

                rTorrent Activity

                .......................................................................................................................................

                ramutch+ 3148 0.0 0.0 8752 2440 ? Ss 13:07 0:00 SCREEN -dmS ramutcho-rtorrent rtorrent
                ramutch+ 3149 0.0 0.0 257932 19252 pts/1 Ssl+ 13:07 0:00 rtorrent

                .......................................................................................................................................

                Irssi Activity

                .......................................................................................................................................

                --> Irssi non installé

                .......................................................................................................................................

                .rtorrent.rc

                File : /home/ramutcho/.rtorrent.rc

                .......................................................................................................................................

                network.scgi.open_port = 127.0.0.1:5001
                encoding.add = UTF-8
                network.port_range.set = 45000-65000
                network.port_random.set = no
                pieces.hash.on_completion.set = no
                directory.default.set = /home/ramutcho/torrents
                session.path.set = /home/ramutcho/.session
                protocol.encryption.set = allow_incoming, try_outgoing, enable_retry
                schedule2 = watch_directory,1,1,load.start=/home/ramutcho/watch/.torrent
                schedule2 = untied_directory,5,5,stop_untied=/home/ramutcho/watch/
                .torrent
                schedule2 = espace_disque_insuffisant,1,30,close_low_diskspace=500M
                trackers.use_udp.set = yes
                dht.mode.set = off
                protocol.pex.set = no
                throttle.min_peers.normal.set = 40
                throttle.max_peers.normal.set = 100
                throttle.min_peers.seed.set = 10
                throttle.max_peers.seed.set = 50
                throttle.max_uploads.set = 15
                execute2 = {sh,-c,/usr/bin/php /var/www/rutorrent/php/initplugins.php ramutcho &}

                .......................................................................................................................................

                ruTorrent /filemanager/conf.php

                File : /var/www/rutorrent/plugins/filemanager/conf.php

                .......................................................................................................................................

                <?php

                $fm['tempdir'] = '/tmp'; // path were to store temporary data ; must be writable
                $fm['mkdperm'] = 755; // default permission to set to new created directories

                // set with fullpath to binary or leave empty

                if(empty($pathToExternals['rar'])) // May be path already defined?
                {
                $pathToExternals['rar'] = '/usr/bin/rar';
                }
                if(empty($pathToExternals['zip'])) // May be path already defined?
                {
                $pathToExternals['zip'] = '/usr/bin/zip';
                }
                if(empty($pathToExternals['unzip'])) // May be path already defined?
                {
                $pathToExternals['unzip'] = '/usr/bin/unzip';
                }
                if(empty($pathToExternals['tar'])) // May be path already defined?
                {
                $pathToExternals['tar'] = '/usr/bin/tar';
                }
                if(empty($pathToExternals['gzip'])) // May be path already defined?
                {
                $pathToExternals['gzip'] = '/usr/bin/gzip';
                }
                if(empty($pathToExternals['bzip2'])) // May be path already defined?
                {
                $pathToExternals['bzip2'] = '/usr/bin/bzip2';
                }

                // archive mangling, see archiver man page before editing

                $fm['archive']['types'] = array('rar', 'zip', 'tar', 'gzip', 'bzip2');

                $fm['archive']['compress'][0] = range(0, 5);
                $fm['archive']['compress'][1] = array('-0', '-1', '-9');
                $fm['archive']['compress'][2] = $fm['archive']['compress'][3] = $fm['archive']['compress'][4] = array(0);

                ?>

                .......................................................................................................................................

                ruTorrent /create/conf.php

                File : /var/www/rutorrent/plugins/create/conf.php

                .......................................................................................................................................

                <?php
                // configuration parameters

                $useExternal = 'mktorrent'; // Valid choices:
                // false - use internal realization (may be too slow for large files)
                // "transmissioncli" - use program transmissioncli (see http://www.transmissionbt.com/)
                // "transmissioncreate" - use program transmissioncreate (see http://www.transmissionbt.com/)
                // "createtorrent" - use program createtorrent (see http://www.createtorrent.com)
                // "mktorrent" - use program mktorrent (see http://mktorrent.sourceforge.net)
                // "buildtorrent" - use program buildtorrent (see http://claudiusmaximus.goto10.org/cm/torrent.html)
                // "torrenttools" - use program torrenttools (see http://github.com/fbdtemme/torrenttools)
                $pathToCreatetorrent = '/usr/bin/mktorrent'; // Something like /bin/createtorrent, or /bin/transmissioncli. If empty, program will be found in PATH.

                $recentTrackersMaxCount = 15;

                .......................................................................................................................................

                ruTorrent config.php ramutcho

                File : /var/www/rutorrent/conf/users/ramutcho/config.php

                .......................................................................................................................................

                <?php
                $pathToExternals = array(
                "curl" => '/usr/bin/curl',
                "stat" => '/usr/bin/stat',
                "php" => '/usr/bin/php7.4',
                "pgrep" => '/usr/bin/pgrep',
                "python" => '/usr/bin/python3'
                );
                $topDirectory = '/home/ramutcho';
                $scgi_port = 5001;
                $scgi_host = '127.0.0.1';
                $XMLRPCMountPoint = '/RAMUTCHO';

                .......................................................................................................................................

                ramutcho-rtorrent

                File : /etc/init.d/ramutcho-rtorrent

                .......................................................................................................................................

                #!/usr/bin/env bash

                Dépendance : screen, killall et rtorrent

                BEGIN INIT INFO

                Provides: ramutcho-rtorrent

                Required-Start: $syslog $network

                Required-Stop: $syslog $network

                Default-Start: 2 3 4 5

                Default-Stop: 0 1 6

                Short-Description: Start daemon at boot time

                Description: Start-Stop rtorrent user session

                END INIT INFO

                Début configuration

                user="ramutcho"

                Fin configuration

                rt_start() {
                su --command="screen -dmS ${user}-rtorrent rtorrent" "${user}"
                }

                rt_stop() {
                killall --user "${user}" screen
                }

                case "$1" in
                start) echo "Starting rtorrent..."; rt_start
                ;;
                stop) echo "Stopping rtorrent..."; rt_stop
                ;;
                restart) echo "Restart rtorrent..."; rt_stop; sleep 1; rt_start
                ;;
                *) echo "Usage: $0 {start|stop|restart}"; exit 1
                ;;
                esac
                exit 0

                .......................................................................................................................................

                rutorrent.conf

                File : /etc/nginx/sites-enabled/rutorrent.conf

                .......................................................................................................................................

                include /etc/nginx/conf.d/log_rutorrent.conf;

                server {
                listen 80 default_server;
                listen 443 default_server ssl http2;
                server_name _;

                index index.html index.php;
                charset utf-8;
                client_max_body_size 10M;
                
                ssl_certificate /etc/nginx/ssl/server.crt;
                ssl_certificate_key /etc/nginx/ssl/server.key;

                include /etc/nginx/conf.d/ciphers.conf;

                access_log /var/log/nginx/rutorrent-access.log combined if=$loggable;
                error_log /var/log/nginx/rutorrent-error.log error;
                
                error_page 500 502 503 504 /50x.html;
                
                root /var/www;
                
                location = /favicon.ico {
                	access_log off;
                	log_not_found off;
                }
                
                location = /50x.html {
                	root /usr/share/nginx/html;
                }
                
                ## Config accueil serveur ##
                
                location ^~ / {
                	root /var/www/base;
                	include /etc/nginx/conf.d/php.conf;
                	include /etc/nginx/conf.d/cache.conf;
                	satisfy any;
                	allow all;
                }
                
                ## Config rutorrent ##
                
                location /rutorrent {
                	auth_basic "Restricted";
                	auth_basic_user_file "/etc/nginx/passwd/rutorrent_passwd";
                	include /etc/nginx/conf.d/php.conf;
                	include /etc/nginx/conf.d/cache.conf;
                	try_files $uri $uri/ /index.html;
                }
                
                location ~ ^/rutorrent/(conf|share)/(.+)$ {
                	deny all;
                }
                
                ## Config utilisateurs ##
                
                    location /RAMUTCHO {
                            include scgi_params;
                            scgi_pass 127.0.0.1:5001;
                            auth_basic "Restricted";
                            auth_basic_user_file "/etc/nginx/passwd/rutorrent_passwd_ramutcho";
                    }

                }

                .......................................................................................................................................

                nginx.conf

                File : /etc/nginx/nginx.conf

                .......................................................................................................................................

                user www-data;
                worker_processes auto;
                pid /var/run/nginx.pid;

                events {
                worker_connections 1024;
                use epoll; # gestionnaire d'évènements epoll (kernel 2.6+)
                }

                http {
                include /etc/nginx/mime.types;
                default_type application/octet-stream;

                access_log /var/log/nginx/access.log combined;
                error_log /var/log/nginx/error.log error;
                
                sendfile on;
                keepalive_timeout 15;
                keepalive_disable msie6;
                keepalive_requests 100;
                tcp_nopush on;
                tcp_nodelay off;
                server_tokens off;
                
                gzip on;
                gzip_comp_level 5;
                gzip_min_length 512;
                gzip_buffers 4 8k;
                gzip_proxied any;
                gzip_vary on;
                gzip_disable "msie6";
                gzip_types
                    text/css
                    text/javascript
                    text/xml
                    text/plain
                    text/x-component
                    application/javascript
                    application/x-javascript
                    application/json
                    application/xml
                    application/rss+xml
                    application/vnd.ms-fontobject
                    font/truetype
                    font/opentype
                    image/svg+xml;
                
                include /etc/nginx/sites-enabled/*.conf;

                }

                .......................................................................................................................................

                cache.conf

                File : /etc/nginx/conf.d/cache.conf

                .......................................................................................................................................

                location ~* .(jpg|jpeg|gif|css|png|js|woff|ttf|svg|eot)$ {
                expires 30d;
                access_log off;
                }

                location ~* .(eot|ttf|woff|svg)$ {
                add_header Acccess-Control-Allow-Origin *;
                }

                .......................................................................................................................................

                log_rutorrent.conf

                File : /etc/nginx/conf.d/log_rutorrent.conf

                .......................................................................................................................................

                map $request_uri $loggable {
                /RAMUTCHO 0;
                /rutorrent/ 0;
                /rutorrent/plugins/history/action.php 0;
                /rutorrent/plugins/check_port/action.php 0;
                /rutorrent/images/favicon.ico 0;
                /rutorrent/php/getsettings.php 0;
                /rutorrent/plugins/trafic/action.php 0;
                /rutorrent/plugins/fileshare/settings.js.php 0;
                /rutorrent/plugins/fileshare/fsh.php 0;
                /rutorrent/plugins/filemanager/flm.php 0;
                /rutorrent/plugins/filemanager/settings.js.php 0;
                /rutorrent/php/setsettings.php 0;
                /rutorrent/plugins/rss/action.php 0;
                /rutorrent/plugins/_task/action.php 0;
                /rutorrent/php/getplugins.php 0;
                /rutorrent/plugins/create/action.php 0;
                ~/rutorrent/plugins/diskspace/action.php? 0;
                ~/rutorrent/plugins/cpuload/action.php? 0;
                ~/rutorrent/plugins/tracklabels/action.php? 0;
                default 1;
                }

                .......................................................................................................................................

                php.conf

                File : /etc/nginx/conf.d/php.conf

                .......................................................................................................................................

                location ~ .php$ {
                fastcgi_index index.php;
                fastcgi_pass unix:/run/php/php7.4-fpm.sock;
                fastcgi_param SCRIPT_FILENAME $document_root$fastcgi_script_name;
                include /etc/nginx/fastcgi_params;
                }

                .......................................................................................................................................

                fichier pass nginx

                Dir : /etc/nginx/passwd

                .......................................................................................................................................

                640 www-data:www-data rutorrent_passwd
                640 www-data:www-data rutorrent_passwd_ramutcho

                .......................................................................................................................................

                fichier ssl nginx

                Dir : /etc/nginx/ssl

                .......................................................................................................................................

                dhparams.pem
                server.crt
                server.key

                .......................................................................................................................................

                nginx.log

                File : /var/log/nginx/rutorrent-error.log

                .......................................................................................................................................

                2021/09/14 12:49:57 [crit] 2048#2048: *1 SSL_read() failed (SSL: error:14191044:SSL routines:tls1_enc:internal error) while processing HTTP/2 connection, client: 185.254.11.210, server: 0.0.0.0:443
                2021/09/14 12:50:00 [crit] 2048#2048: *2 SSL_read() failed (SSL: error:14191044:SSL routines:tls1_enc:internal error) while processing HTTP/2 connection, client: 185.254.11.210, server: 0.0.0.0:443
                2021/09/14 12:50:16 [crit] 2048#2048: *3 connect() to unix:/run/php/php7.4-fpm.sock failed (2: No such file or directory) while connecting to upstream, client: 185.254.11.210, server: _, request: "GET /rutorrent/php/getplugins.php HTTP/2.0", upstream: "fastcgi://unix:/run/php/php7.4-fpm.sock:", host: "62.210.214.219", referrer: "https://62.210.214.219/rutorrent/"
                2021/09/14 12:50:16 [error] 2048#2048: *3 open() "/usr/share/nginx/html/50x.html" failed (2: No such file or directory), client: 185.254.11.210, server: _, request: "GET /rutorrent/php/getplugins.php HTTP/2.0", upstream: "fastcgi://unix:/run/php/php7.4-fpm.sock", host: "62.210.214.219", referrer: "https://62.210.214.219/rutorrent/"
                2021/09/14 12:52:09 [error] 2048#2048: *8 user "ramutcho" was not found in "/etc/nginx/passwd/rutorrent_passwd", client: 195.200.221.234, server: _, request: "GET /rutorrent/ HTTP/2.0", host: "62.210.214.219"
                2021/09/14 12:52:11 [error] 2048#2048: *8 user "ramutcho" was not found in "/etc/nginx/passwd/rutorrent_passwd", client: 195.200.221.234, server: _, request: "GET /rutorrent/ HTTP/2.0", host: "62.210.214.219"
                2021/09/14 13:05:12 [crit] 2048#2048: *9 SSL_read() failed (SSL: error:14191044:SSL routines:tls1_enc:internal error) while processing HTTP/2 connection, client: 185.254.11.210, server: 0.0.0.0:443
                2021/09/14 13:05:12 [crit] 2048#2048: *10 connect() to unix:/run/php/php7.4-fpm.sock failed (2: No such file or directory) while connecting to upstream, client: 185.254.11.210, server: _, request: "GET /rutorrent/php/getplugins.php HTTP/2.0", upstream: "fastcgi://unix:/run/php/php7.4-fpm.sock:", host: "62.210.214.219", referrer: "https://62.210.214.219/rutorrent/"
                2021/09/14 13:05:12 [error] 2048#2048: *10 open() "/usr/share/nginx/html/50x.html" failed (2: No such file or directory), client: 185.254.11.210, server: _, request: "GET /rutorrent/php/getplugins.php HTTP/2.0", upstream: "fastcgi://unix:/run/php/php7.4-fpm.sock", host: "62.210.214.219", referrer: "https://62.210.214.219/rutorrent/"
                2021/09/14 13:07:34 [crit] 3046#3046: *1 SSL_read() failed (SSL: error:14191044:SSL routines:tls1_enc:internal error) while processing HTTP/2 connection, client: 185.254.11.210, server: 0.0.0.0:443
                2021/09/14 13:07:35 [crit] 3046#3046: *2 connect() to unix:/run/php/php7.4-fpm.sock failed (2: No such file or directory) while connecting to upstream, client: 185.254.11.210, server: _, request: "GET /rutorrent/php/getplugins.php HTTP/2.0", upstream: "fastcgi://unix:/run/php/php7.4-fpm.sock:", host: "62.210.214.219", referrer: "https://62.210.214.219/rutorrent/"
                2021/09/14 13:07:35 [error] 3046#3046: *2 open() "/usr/share/nginx/html/50x.html" failed (2: No such file or directory), client: 185.254.11.210, server: _, request: "GET /rutorrent/php/getplugins.php HTTP/2.0", upstream: "fastcgi://unix:/run/php/php7.4-fpm.sock", host: "62.210.214.219", referrer: "https://62.210.214.219/rutorrent/"

                .......................................................................................................................................

                fin

                .......................................................................................................................................
                `

                résolu. Il y avait un soucis avec le paquet php.

                Répondre…