Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

When adding torrents, directory listing is blank/empty #1647

Closed
delize opened this issue Jan 30, 2018 · 6 comments
Closed

When adding torrents, directory listing is blank/empty #1647

delize opened this issue Jan 30, 2018 · 6 comments

Comments

@delize
Copy link

delize commented Jan 30, 2018

image

rtorrent version: 0.9.6
libtorrent version: 0.13.6

My download location is CIFS (soon to be NFS) and while the local system has no issues seeing the directories that appear within the root torrent directory (and neither does rtorrent), rutorrent does (even though www-data belongs to the media goup):

root@rtorrent:~# id www-data
uid=33(www-data) gid=33(www-data) groups=33(www-data),117(media)
root@rtorrent:~# cat /etc/group | grep media
media:x:117:me,rtorrent,www-data,sonarr
root@rtorrent:~# cat /etc/apache2/envvars | grep media
export APACHE_RUN_GROUP=media

For the sake of troubleshooting, I set this to 777, but 775 should suffice under normal circumstances (remember CIFS mount):

root@rtorrent:~# ls -al /media/storage/rtorrent/torrent/download/
total 4
drwxrwxrwx 2 rtorrent media 4096 Jan 28 22:14 .
drwxrwxrwx 2 rtorrent media    0 Jan 25 23:04 ..
drwxrwxrwx 2 rtorrent media    0 Jan 25 23:04 book
drwxrwxrwx 2 rtorrent media    0 Jan 25 23:04 game
drwxrwxrwx 2 rtorrent media    0 Jan 25 23:04 movie
drwxrwxrwx 2 rtorrent media    0 Jan 25 23:04 music
drwxrwxrwx 2 rtorrent media    0 Jan 25 23:04 other
drwxrwxrwx 2 rtorrent media    0 Jan 28 22:11 software
drwxrwxrwx 2 rtorrent media    0 Jan 25 23:04 tv

apache2 access.log file:

rtorrent.localnetworkwork:443 192.168.2.30 - me [29/Jan/2018:21:16:10 -0800] "GET /rutorrent/plugins/_getdir/getdirs.php?dir=&btn=dir_btn&edit=dir_edit&frame=dir_edit_frame&time=1517289371097 HTTP/1.1" 200 1988 "https://rtorrent.localnetwork/rutorrent/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.119 Safari/537.36"
rtorrent.localnetworkwork:443 192.168.2.30 - me [29/Jan/2018:21:16:11 -0800] "POST /rutorrent/plugins/httprpc/action.php HTTP/1.1" 200 802 "https://rtorrent.localnetwork/rutorrent/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.119 Safari/537.36"
rtorrent.localnetworkwork:443 192.168.2.30 - me [29/Jan/2018:21:16:11 -0800] "POST /rutorrent/plugins/httprpc/action.php HTTP/1.1" 200 823 "https://rtorrent.localnetwork/rutorrent/" "Mozilla/5.0 (Windows NT 10.0; Win64; x64) AppleWebKit/537.36 (KHTML, like Gecko) Chrome/64.0.3282.119 Safari/537.36"

error.log:


[Mon Jan 29 21:27:21.109382 2018] [:error] [pid 17115] [client 192.168.2.30:56918] PHP Warning:  Declaration of rxmlrpcfix::run() should be compatible with rXMLRPCRequest::run($trusted = true) in /var/www/rutorrent/plugins/filemanager/xmlfix.php on line 0, referer: https://rtorrent.localnetwork/rutorrent/
[Mon Jan 29 21:27:47.430422 2018] [:error] [pid 5818] [client 192.168.2.30:56950] PHP Warning:  Declaration of rxmlrpcfix::run() should be compatible with rXMLRPCRequest::run($trusted = true) in /var/www/rutorrent/plugins/filemanager/xmlfix.php on line 0, referer: https://rtorrent.localnetwork/rutorrent/

This started happening, but didn't happen prior to today when I filled out this issue (I think this was because of an expired cookie though):

[29.01.2018 21:24:29] Bad response from server: (401 [error,list]) [my login page html code]

If I type the path in manually, it will accept the location.

What is going on with this, and what can be done to correct the either timing out issue or the fact that PHP/rutorrent can't see the directory folders?

Other web based services (like sonarr) can browse the location and see the contents.

@delize
Copy link
Author

delize commented Jan 30, 2018

Seems like it was indeed a permissions issue on the directory.

@delize delize closed this as completed Jan 30, 2018
@drewbitt
Copy link

drewbitt commented Feb 12, 2018

I get this too.

If I type in the path manually I can access it just not see. I can even access the files with the path typed in manually (i.e. create a torrent from a directory that I typed in manually), I just can't see the directory. I have execute permissions in the directory for everyone.

What did you do to fix this? My permissions are identical to another server I have rtorrent on.

Empty upon first pressing ... in rutorrent
/home/bmbm/ is visible if typed in manually. drwxr-xr-x 14 bmbm bmbm 4096 bmbm
/home/bmbm/rtorrent/ is visible drwxrw-r-x 5 root root 4096 rtorrent
/home/bmbm/rtorrent/downloads, the main rtorrent download directory, is not visible drwxrwx--x 11 bmbm bmbm 4096 downloads

uid=33(www-data) gid=33(www-data) groups=33(www-data),1000(bmbm)

To me it looks like it can't see anything in /home/bmbm/rtorrent/downloads because it doesn't have read, but it should be running as www-data which is in the bmbm group and has read. nginx is using the www-data user according to ps aux

I have even restarted (didn't fix) and gave downloads 777 then restarted nginx/apache2 - which unbelievably still did not let me see the directory.

@drewbitt
Copy link

Upon a git pull update of rutorrent, I immediately was able to see all directories. I guess it was likely not a permission issue but an issue with my rutorrent config itself. That was my original guess but delize's success with the permissions got me sidetracked.

@k0mmsussert0d
Copy link

k0mmsussert0d commented Feb 26, 2019

I've been struggling with same issue for a while and decided to drop a hint here, since this page is the first rutorrent github result you came upon googling for "rutorrent can't select directory".

If you're 100% sure you entered right path in the $topDirectory variable in the config.php file and that user running HTTP server has an access to read that directory, check what is your X-Frame-Options server response. In my case, one nginx snippet has it set to DENY. Changing it to SAMEORIGIN will solve the issue.

So you should have this line in your server config:
add_header X-Frame-Options SAMEORIGIN

rutorrent strongly depends on iframe usage. So strong you wouldn't even see the starting path indicated by $topDirectory, not to mention the file explorer drop-down window. This behavior made me think, that there must be some kind of bug in this variable processing.

@elsc
Copy link

elsc commented Mar 20, 2023

without php-mbstring may cause this problem

@rjalexa
Copy link

rjalexa commented Jan 19, 2024

add_header X-Frame-Options SAMEORIGIN

For Apache2 the line would be:

<Directory "/var/www/rutorrent">
    AuthName "ruTorrent authentication"
    AuthType Basic
    Require valid-user
    AuthUserFile /var/www/rutorrent/.htpasswd
    Header always set X-Frame-Options "SAMEORIGIN"
</Directory>

in the rutorrent virtual host configuration.

To get things working check all of the following (example)

apache2 runs as www-data and so the /4TBHDD/download directory is:
drwxrwx--- 15 www-data bob 4096 Jan 19 08:51 download
rutorrent configuration has:
$topDirectory = '/4TBHDD/download/';
checked Apache2 config, OK; restarted it

All good now. HTH !!!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

5 participants