[Support] binhex - rTorrentVPN


Recommended Posts

32 minutes ago, binhex said:

Check the 'go' file on the original box, you may of added the loading of iptable_mangle and forgotten about it.

Sent from my CLT-L09 using Tapatalk
 

no it wasn't there.  that is what prompted the question.  i added it on that box the same time i added it on the new box just to be safe.  

 

thanks 

Edited by morreale
Link to comment
10 hours ago, DavidAUK said:

This worked for me. Thank you. How do I avoid doing this manually though?

 

For anyone who wants to try this for themselves, go to the shell in the container. To find out which ports are listening use


netstat -plnt

If the port is not listening then you can dynamically set the port as Cat_Seeder describes by issuing the following commands.


rtxmlrpc network.port_range.set '' "XXXXX-XXXXX"
rtxmlrpc dht.port.set '' "XXXXX"

Where XXXXX is the rtorrent listening port. Then type the following command.


rtxmlrpc network.bind_address.set '' "The VPN assigned IP"

I found the VPN assigned IP in the following line of rtorrentvpn container log where I've marked XX.XX.X.XX


Sat Jan 25 03:07:45 2020 PUSH: Received control message: 'PUSH_REPLY,redirect-gateway def1,dhcp-option DNS zz.z.z.z,dhcp-option DNS zz.z.z.z,sndbuf 524288,rcvbuf 524288,route zz.zz.z.z,topology net30,ping 5,ping-restart 30,compress,ifconfig XX.XX.X.XX zz.zz.z.zz,peer-id 0'

Then issue the following command.


rtxmlrpc network.local_address.set '' "The External IP"

I found the External IP in the following line of the rtorrentvpn.


[info] Successfully retrieved external IP address XX.XXX.XXX.XXX

After I'd sent those four commands the netstat -plnt showed the port as listening, as did the rutorrent web interface.

I was thinking about your problem, looking at the watchdogs script, and assuming that all environment variables are set correctly, everything should work out of the box for you.

 

Two things that may help figuring out what is happening.

 

1. Running a new container with DEBUG enabled and keeping an eye on the external IP, VPN IP, rTorrent IP and ports. Maybe something is not right with one of those values? 

 

2. If you can't spot anything out of the ordinary in the logs, just open a terminal and use rtxmlrpc to inspect the values configured for your container. (E.g., with: rtxmlrpc network.local_address)

 

My gut feeling is that one of the 4 values above is wrong for some reason.

 

Edited by Cat_Seeder
  • Like 1
Link to comment
1 hour ago, Cat_Seeder said:

My gut feeling is that one of the 4 values above is wrong for some reason.

Yes, I think you're right. The listening socket is not set when I use rtxmlrpc network.port_range to check it. It's listening as it starts, but then when rtorrent tries to connect to the web interface (if I'm understanding it right) it reconfigures and sets the listening port to null.

[info] rTorrent listening interface IP 0.0.0.0 and VPN provider IP 10.35.0.101 different, marking for reconfigure

Here's a log, which shows more.

2020-01-25 21:25:59,063 DEBG 'watchdog-script' stdout output:
[info] rTorrent listening interface IP 0.0.0.0 and VPN provider IP 10.35.0.101 different, marking for reconfigure
2020-01-25 21:26:20,367 DEBG 'watchdog-script' stdout output:
WARNING  Not a valid number: '-' (invalid literal for int() with base 10: '-')
2020-01-25 21:26:20,369 DEBG 'watchdog-script' stdout output:
-
2020-01-25 21:26:25,509 DEBG 'watchdog-script' stderr output:
INFO: Bad data packets written to '/tmp/xmlrpc2scgi-1000.xml'
2020-01-25 21:26:25,510 DEBG 'watchdog-script' stdout output:
ERROR    While calling network.bind_address.set('', '10.35.0.101'): <Fault -503: 'Invalid port_range argument.'

The relevant lines in my rtorrent.conf look like this.

# SCGI Connectivity (for alternative rtorrent interfaces, XMLRPC)
#
# Use a IP socket with scgi_port, or a Unix socket with scgi_local.
# schedule can be used to set permissions on the unix socket.
#
scgi_port = 0.0.0.0:5000
#scgi_local = /home/user/rtorrent/rpc.socket
#schedule = scgi_permission,0,0,"execute.nothrow=chmod,\"g+w,o=\",/home/user/rtorrent/rpc.socket"

Is that scgi_port setting incorrect? Thank you for your help! I feel like I'm getting closer.

  • Thanks 1
Link to comment
On 1/25/2020 at 10:04 PM, DavidAUK said:

Yes, I think you're right. The listening socket is not set when I use rtxmlrpc network.port_range to check it. It's listening as it starts, but then when rtorrent tries to connect to the web interface (if I'm understanding it right) it reconfigures and sets the listening port to null.


[info] rTorrent listening interface IP 0.0.0.0 and VPN provider IP 10.35.0.101 different, marking for reconfigure

Here's a log, which shows more.


2020-01-25 21:25:59,063 DEBG 'watchdog-script' stdout output:
[info] rTorrent listening interface IP 0.0.0.0 and VPN provider IP 10.35.0.101 different, marking for reconfigure
2020-01-25 21:26:20,367 DEBG 'watchdog-script' stdout output:
WARNING  Not a valid number: '-' (invalid literal for int() with base 10: '-')
2020-01-25 21:26:20,369 DEBG 'watchdog-script' stdout output:
-
2020-01-25 21:26:25,509 DEBG 'watchdog-script' stderr output:
INFO: Bad data packets written to '/tmp/xmlrpc2scgi-1000.xml'
2020-01-25 21:26:25,510 DEBG 'watchdog-script' stdout output:
ERROR    While calling network.bind_address.set('', '10.35.0.101'): <Fault -503: 'Invalid port_range argument.'

The relevant lines in my rtorrent.conf look like this.


# SCGI Connectivity (for alternative rtorrent interfaces, XMLRPC)
#
# Use a IP socket with scgi_port, or a Unix socket with scgi_local.
# schedule can be used to set permissions on the unix socket.
#
scgi_port = 0.0.0.0:5000
#scgi_local = /home/user/rtorrent/rpc.socket
#schedule = scgi_permission,0,0,"execute.nothrow=chmod,\"g+w,o=\",/home/user/rtorrent/rpc.socket"

Is that scgi_port setting incorrect? Thank you for your help! I feel like I'm getting closer.

 

Hi David, the SCGI socket itself is static and fixed to 5000. It has nothing to do with port forwarding.

 

Considering that the desired fixed VPN port is XXXXX, the lines that you need in rtorrent.rc are:

 

network.port_range.set = XXXXX-XXXXX

network.port_random.set = no

 

And If you also need dht (for public trackers):

 

dht.mode.set = auto

dht.port.set = XXXXX

 

Considering the error messages above it looks like either:

 

1) One of those lines are not in your rtorrent.rc; or

2) VPN_INCOMING_PORT environment variable is empty for some reason (check that it's set in your docker configuration and that you don't have any PIA specific setting like STRICT_PORT_FORWARD=yes)

 

Let me know if the above helps.

Edited by Cat_Seeder
Link to comment

Thanks @Cat_Seeder. Genuinely appreciate the help.

 

Those lines are correct in my rtorrent.rc file. I just pulled a fresh rc file from the git repo and only changed the network.port_range.set line and it still didn't work. I don't use DHT so I think it's safe to rule that out.

 

The clues, as I see them, are the fact that the port is open and listening for a few minutes when it starts but then stops listening as it finishes initialising. I can fix it by setting it manually in the container. Also, there are lines in the log that say:

WARNING Not a valid number: '-' (invalid literal for int() with base 10: '-')
INFO: Bad data packets written to '/tmp/xmlrpc2scgi-1000.xml'
ERROR While calling network.bind_address.set('', '10.35.0.101'): <Fault -503: 'Invalid port_range argument.'

Here's a pastebin of my rc.

 

STRICT_PORT_FORWARD was set to yes, but setting to no hasn't fixed the problem.

VPN_INCOMING_PORT isn't a environment variable for this container, is it?

Link to comment
13 minutes ago, DavidAUK said:

Thanks @Cat_Seeder. Genuinely appreciate the help.

 

Those lines are correct in my rtorrent.rc file. I just pulled a fresh rc file from the git repo and only changed the network.port_range.set line and it still didn't work. I don't use DHT so I think it's safe to rule that out.

 

The clues, as I see them, are the fact that the port is open and listening for a few minutes when it starts but then stops listening as it finishes initialising. I can fix it by setting it manually in the container. Also, there are lines in the log that say:


WARNING Not a valid number: '-' (invalid literal for int() with base 10: '-')
INFO: Bad data packets written to '/tmp/xmlrpc2scgi-1000.xml'
ERROR While calling network.bind_address.set('', '10.35.0.101'): <Fault -503: 'Invalid port_range argument.'

Here's a pastebin of my rc.

 

STRICT_PORT_FORWARD was set to yes, but setting to no hasn't fixed the problem.

VPN_INCOMING_PORT isn't a environment variable for this container, is it?

 

VPN_INCOMING_PORT is used in rtorrent.sh (although it is not documented and I'm not really sure if it's meant to be used directly). Could you try to set it with the desired port just for the sake of testing?

IMO, as per my comment to binhex above, the port statements should not run for providers other than PIA (this is a code change that either myself or binhex would have to do), however, there is a chance that setting VPN_INCOMING_PORT will provide a temporary workaround for your problem. Could you please try it?

  • Like 1
Link to comment
11 hours ago, Cat_Seeder said:

@binhex, now that I'm thinking about it, maybe the logic in rtorrent.sh should skip setting port-range and dht when provider is not PIA (or at least when VPN_INCOMING_PORT is empty).

 

What do you think?

yes i agree, i need to put in a further check in rtorrent.sh, i can only assume we were 'getting away with it' previously because xmlrpc didnt error if the VPN_INCOMING_PORT value was null or an empty string, now we have switched to rtxmlrpc its a bit more picky (and rightly so), i know what needs to be done, look out for a new image in the next few hours with the fix.

  • Like 2
Link to comment
13 hours ago, Cat_Seeder said:

VPN_INCOMING_PORT is used in rtorrent.sh (although it is not documented and I'm not really sure if it's meant to be used directly). Could you try to set it with the desired port just for the sake of testing?

I set VPN_INCOMING_PORT=XXXXX as an environment variable for the rtorrentvpn container and it worked! XXXXX is my listening port as set in the network.port_range.set = XXXXX-XXXXX setting in rtorrent.rc. Thank you so much for digging into that one.

 

I have a feeling the same thing is happening with DelugeVPN.

Link to comment
13 hours ago, Cat_Seeder said:

VPN_INCOMING_PORT is used in rtorrent.sh (although it is not documented

i did toy with the idea of documenting this, however i just knew the support tickets would then start pouring in with people saying 'ive set vpn_incoming_port to XXXX but i still am not connectable, why is this?', at which point i then point out the fact that this needs to be a port defined via your vpn provider and not some number plucked out of the air :-), so its best not to shout about this too much eh.

 

14 minutes ago, DavidAUK said:

I have a feeling the same thing is happening with DelugeVPN.

this is not the case, delugevpn is quite different in how you define the incoming port, and the logic is there to check for vpn provider == pia (ive checked).

 

edit - new image currently building, this will prevent any incoming port assignment if the vpn provider != pia

Edited by binhex
  • Like 2
Link to comment

OK here's a weird one I just started getting:

2020-01-31 14:42:40,668 DEBG 'rutorrent-script' stderr output:
2020/01/31 14:42:40 [error] 871#871: *2926 FastCGI sent in stderr: "PHP message: PHP Notice:  Trying to access array offset on value of type bool in /usr/share/webapps/rutorrent/plugins/autodl-irssi/getConf.php on line 54PHP message: PHP Notice:  Trying to access array offset on value of type bool in /usr/share/webapps/rutorrent/plugins/autodl-irssi/getConf.php on line 61" while reading response header from upstream, client: 192.168.1.135, server: localhost, request: "GET /plugins/autodl-irssi/getlines.php?cid=34220718&_=1580499725887 HTTP/1.1", upstream: "fastcgi://127.0.0.1:7777", host: "192.168.1.118:9080", referrer: "http://192.168.1.118:9080/"

Everything will be working fine, then after about an hour rutorrent will run into connection errors. Refresh the page and its unable to connect. Go into the logs and get this message over and over and over again. A restart of the rtorrent container brings it back until this happens again after about the same time.

 

Any ideas?

 

Link to comment
First of all thanks for this docker.
 
1. i use torguard. and i have 500/500 mbit. but the highest download with vpn is about 20 mibt.
when i use vpn on my pc and download i get around 300 mbit?.
 
2. can i use this docker without vpn. how do i port forward the right port.
it always say port are closed.
 
please help. 
 
 
 
Get yourself a incoming port from your VPN provider, then configure rtorrent to use it by defining the port in the /config/rtorrent/config/rtorrent.rc file, that stood then give you an open port and much better speeds

Sent from my CLT-L09 using Tapatalk

Link to comment

I'm new to unraid and rtorrent but I've been able to get this docker up and running for the most part as far as adding and seeding but have hit a wall with how to move  completed torrents.

 

I have all of my torrent files stored on another server and would like to continue doing that for backup purposes. I setup my folder shares from the other server with the unassigned devices plugin and can access everything just fine with krusader but when I use the "save to.." function in rutorrent I only seem to have the original download folder as an option.

 

I've tried setting a new paths to the folders in the settings but still just see the download folder. Am I missing something obvious? I've been using utorrent, deluge and qbittorrent on windows and have always been able to move torrents to a mapped drive but after hours of playing around and searches I am officially stumped.

Link to comment
5 minutes ago, eman31 said:

I've tried setting a new paths to the folders in the settings but still just see the download folder.

Post your docker run command as explained at the first link in the Docker FAQ pinned near the top of the Docker Engine subforum. 

Link to comment

Howdy @binhex

 

With your latest image I'm getting a bunch of these errors - looks like something to do with the different torrent trackers? Each error is the same but lists different trackers:

 

2020-02-06 19:41:48,202 DEBG 'rutorrent-script' stderr output:
2020/02/06 19:41:48 [error] 10556#10556: *1 FastCGI sent in stderr: "PHP message: PHP Notice:  Trying to access array offset on value of type bool in /usr/share/webapps/rutorrent/plugins/autodl-irssi/getConf.php on line 54PHP message: PHP Notice:  Trying to access array offset on value of type bool in /usr/share/webapps/rutorrent/plugins/autodl-irssi/getConf.php on line 61" while reading response header from upstream, client: 192.168.1.100, server: localhost, request: "GET /plugins/autodl-irssi/getfile.php?file=BrokenStones.tracker&_=1581018106166 HTTP/1.1", upstream: "fastcgi://127.0.0.1:7777", host: "192.168.1.118:9080", referrer: "http://192.168.1.118:9080/"

 

This one happens to list "BrokenStones" which I don't use but still. Seems to go through each one that's built into autodl and then not start. Any ideas?

Link to comment
15 hours ago, td00 said:

Howdy @binhex

 

With your latest image I'm getting a bunch of these errors - looks like something to do with the different torrent trackers? Each error is the same but lists different trackers:

 

2020-02-06 19:41:48,202 DEBG 'rutorrent-script' stderr output:
2020/02/06 19:41:48 [error] 10556#10556: *1 FastCGI sent in stderr: "PHP message: PHP Notice:  Trying to access array offset on value of type bool in /usr/share/webapps/rutorrent/plugins/autodl-irssi/getConf.php on line 54PHP message: PHP Notice:  Trying to access array offset on value of type bool in /usr/share/webapps/rutorrent/plugins/autodl-irssi/getConf.php on line 61" while reading response header from upstream, client: 192.168.1.100, server: localhost, request: "GET /plugins/autodl-irssi/getfile.php?file=BrokenStones.tracker&_=1581018106166 HTTP/1.1", upstream: "fastcgi://127.0.0.1:7777", host: "192.168.1.118:9080", referrer: "http://192.168.1.118:9080/"

 

This one happens to list "BrokenStones" which I don't use but still. Seems to go through each one that's built into autodl and then not start. Any ideas?

it looks like a bug in autodl-irssi plugin, your best bet is to post this as an 'issue' on the github repo for that plugin:- 

https://github.com/autodl-community/autodl-irssi/issues

Link to comment
On 2/7/2020 at 5:58 AM, binhex said:

it looks like a bug in autodl-irssi plugin, your best bet is to post this as an 'issue' on the github repo for that plugin:- 

https://github.com/autodl-community/autodl-irssi/issues

Hey @binhex

 

So I reached out to the autodl-irssi guys with the error. They said that it had to do with the version of PHP the image was using (currently your image is using 7.4.1 see here: https://imgur.com/TwKNPuP). They were saying that there have been reports of many issues with that version of PHP and that autodl-irssi recommends version 5 of PHP to run autodl-irssi successfully.

 

I actually tried to downgrade your image with zero success lol (I guess that's the whole point of an image :)) and I figure that the only reason the latest image is using newest version of PHP is probably the base image of arch you use to create the image. Anyway, I don't know/think you have any solutions to this (I suppose it doesn't make sense to recompile the whole thing for a PHP version) but just thought you should know in case there was anything you could do.

Edited by td00
Link to comment
  • binhex locked this topic
Guest
This topic is now closed to further replies.