binhex / arch-qbittorrentvpn

Docker build script for Arch Linux base with qBittorrent, Privoxy and OpenVPN
GNU General Public License v3.0
473 stars 48 forks source link

PIA Port Not applied to qbittorrent client #26

Closed upcboy closed 4 years ago

upcboy commented 4 years ago

The new pia port does not get set on start up. The logs show PIA gives a port but it is not changed in the client. below is the relevant logs

qbitttorrent    | 2019-12-26 15:51:38,170 DEBG 'start-script' stdout output:
qbitttorrent    | [info] Checking endpoint 'ca-toronto.privateinternetaccess.com' is port forward enabled...
qbitttorrent    |
qbitttorrent    | 2019-12-26 15:51:38,180 DEBG 'start-script' stdout output:
qbitttorrent    | [info] Attempting to curl https://www.privateinternetaccess.com/vpninfo/servers?version=82...
qbitttorrent    |
qbitttorrent    | 2019-12-26 15:51:38,687 DEBG 'start-script' stdout output:
qbitttorrent    | [info] Curl successful for https://www.privateinternetaccess.com/vpninfo/servers?version=82, response code 200
qbitttorrent    |
qbitttorrent    | 2019-12-26 15:51:38,890 DEBG 'start-script' stdout output:
qbitttorrent    | [info] PIA endpoint 'ca-toronto.privateinternetaccess.com' is in the list of endpoints that support port forwarding
qbitttorrent    |
qbitttorrent    | 2019-12-26 15:51:38,890 DEBG 'start-script' stdout output:
qbitttorrent    | [info] List of PIA endpoints that support port forwarding:-
qbitttorrent    |
qbitttorrent    | 2019-12-26 15:51:38,891 DEBG 'start-script' stdout output:
qbitttorrent    | [info] ca-toronto.privateinternetaccess.com
qbitttorrent    | [info] ca-montreal.privateinternetaccess.com
qbitttorrent    | [info] ca-vancouver.privateinternetaccess.com
qbitttorrent    | [info] de-berlin.privateinternetaccess.com
qbitttorrent    | [info] de-frankfurt.privateinternetaccess.com
qbitttorrent    | [info] sweden.privateinternetaccess.com
qbitttorrent    | [info] swiss.privateinternetaccess.com
qbitttorrent    | [info] france.privateinternetaccess.com
qbitttorrent    | [info] czech.privateinternetaccess.com
qbitttorrent    | [info] spain.privateinternetaccess.com
qbitttorrent    | [info] ro.privateinternetaccess.com
qbitttorrent    | [info] israel.privateinternetaccess.com
qbitttorrent    | [info] Attempting to get dynamically assigned port...
qbitttorrent    |
qbitttorrent    | 2019-12-26 15:51:38,910 DEBG 'start-script' stdout output:
qbitttorrent    | [info] Attempting to curl http://209.222.18.222:2000/?client_id=RED
qbitttorrent    |
qbitttorrent    | 2019-12-26 15:51:39,839 DEBG 'start-script' stdout output:
qbitttorrent    | [info] Curl successful for http://209.222.18.222:2000/?client_id=RED, response code 200
qbitttorrent    |
qbitttorrent    | 2019-12-26 15:51:39,935 DEBG 'start-script' stdout output:
qbitttorrent    | [info] Successfully assigned incoming port 56734
qbitttorrent    |
qbitttorrent    | 2019-12-26 15:51:39,938 DEBG 'start-script' stdout output:
qbitttorrent    | [info] Checking we can resolve name 'www.google.com' to address...
qbitttorrent    |
qbitttorrent    | 2019-12-26 15:51:40,035 DEBG 'start-script' stdout output:
qbitttorrent    | [info] DNS operational, we can resolve name 'www.google.com' to address '172.217.1.4'
qbitttorrent    |
qbitttorrent    | 2019-12-26 15:51:40,039 DEBG 'start-script' stdout output:
qbitttorrent    | [info] Attempting to get external IP using Name Server 'ns1.google.com'...
qbitttorrent    |
qbitttorrent    | 2019-12-26 15:51:40,248 DEBG 'start-script' stdout output:
qbitttorrent    | [info] Successfully retrieved external IP address 172.98.67.4
qbitttorrent    |
qbitttorrent    | 2019-12-26 15:51:40,293 DEBG 'watchdog-script' stdout output:
qbitttorrent    | [info] qBittorrent listening interface IP 0.0.0.0 and VPN provider IP 10.23.10.10 different, marking for reconfigure
qbitttorrent    |
qbitttorrent    | 2019-12-26 15:51:40,301 DEBG 'watchdog-script' stdout output:
qbitttorrent    | [info] qBittorrent not running
qbitttorrent    |
qbitttorrent    | 2019-12-26 15:51:40,310 DEBG 'watchdog-script' stdout output:
qbitttorrent    | [info] Privoxy not running
qbitttorrent    |
qbitttorrent    | 2019-12-26 15:51:40,311 DEBG 'watchdog-script' stdout output:
qbitttorrent    | [info] qBittorrent incoming port 6881 and VPN incoming port 56734 different, marking for reconfigure
qbitttorrent    |
qbitttorrent    | 2019-12-26 15:51:40,311 DEBG 'watchdog-script' stdout output:
qbitttorrent    | [info] Removing session lock file (if it exists)...
qbitttorrent    |
qbitttorrent    | 2019-12-26 15:51:40,315 DEBG 'watchdog-script' stdout output:
qbitttorrent    | [info] Attempting to start qBittorrent...
qbitttorrent    |
qbitttorrent    | 2019-12-26 15:51:40,343 DEBG 'watchdog-script' stdout output:
qbitttorrent    | [info] qBittorrent process started
qbitttorrent    | [info] Waiting for qBittorrent process to start listening on port 8088...
qbitttorrent    |
qbitttorrent    | 2019-12-26 15:51:40,470 DEBG 'watchdog-script' stdout output:
qbitttorrent    | [info] qBittorrent process listening on port 8088
qbitttorrent    |
qbitttorrent    | 2019-12-26 15:51:40,507 DEBG 'watchdog-script' stdout output:
qbitttorrent    | [info] Attempting to start Privoxy...
qbitttorrent    |
qbitttorrent    | 2019-12-26 15:51:41,513 DEBG 'watchdog-script' stdout output:
qbitttorrent    | [info] Privoxy process started
qbitttorrent    | [info] Waiting for Privoxy process to start listening on port 8118...
qbitttorrent    |
qbitttorrent    | 2019-12-26 15:51:41,521 DEBG 'watchdog-script' stdout output:
qbitttorrent    | [info] Privoxy process listening on port 8118
BigC27 commented 4 years ago

Just wanted to add that I'm also having this issue. Logs show the same sequence as above.

binhex commented 4 years ago

@upcboy if you follow the logs later on your should see qbittorrent incoming port gets set (debug must be set to yes for this), and if you login to web ui and click on options and click on 'connection' tab you will see the port is set.

ive just tested this and it is being set correctly for me.

upcboy commented 4 years ago

@binhex I've been doing that as a workaround but I assumed since it was asking pia for a port it would be setting the port automatically on startup. This looked like a bug since it was not being set automatically like it was in your Deluge-vpn setup

binhex commented 4 years ago

i think you misunderstand, im not suggesting you manually set the port, im saying it should be (and is for me) getting automatically set, check the web ui, the port should match the pia incoming port shown in the log.

upcboy commented 4 years ago

I just restarted the container and the logs show below for the port

2020-01-03 21:49:58,854 DEBG 'start-script' stdout output:
[info] Successfully assigned incoming port 30469

but my current port is set to 24995 in the webUI when I check (which was the last port i manually find from the logs.)

edit: Adding more info looking over the logs it seems the watchdog-script thinks qBittorrent's incoming port is set right. I can see

2020-01-03 22:10:22,464 DEBG 'watchdog-script' stdout output:
[debug] VPN incoming port is 30469
[debug] qBittorrent incoming port is 30469
[debug] VPN IP is 10.23.11.10
[debug] qBittorrent IP is 10.23.11.10

but the webui def shows the old 24995 and testing a few different ways shows my client is not listening on port 30469

binhex commented 4 years ago

Sorry guys my mistake I was using a test tagged version I have now replicated the problem and identified the fix look out for a new version soon

binhex commented 4 years ago

now fixed, please pull down latest image.

upcboy commented 4 years ago

I'm still seeing the same behavior and I have made sure I have the latest build on docker hub.

binhex commented 4 years ago

hmm just double checked and its def working for me, so the incoming port shown in the supervisord.log file is not getting set in qbittorrent? (web ui/options/connection tab/port used for incoming connections)

upcboy commented 4 years ago

my logs show

[info] Successfully assigned incoming port 28671

but the webui shows 47417 image

binhex commented 4 years ago

are you 100% sure you have got the latest image pulled down?, issue the following:-

docker pull binhex/arch-qbittorrentvpn:latest

then delete your existing container and re-create it.

upcboy commented 4 years ago

The digest of my images matches the current latest from docker hub

REPOSITORY                     TAG                 DIGEST                                                                    IMAGE ID            CREATED             SIZE
binhex/arch-qbittorrentvpn     latest              sha256:be7780965e945ace78e66480b176448d4e45e360c3bd2678451f0a26f9085124   2c0eb5f10c57        2 days ago          1.02GB
upcboy commented 4 years ago

I found the issue. It looks like in your commit for the fix you hard coded the webui port to 2100 instead of using the variable WEBUI_PORT you had been using before. This would explain why it works for you but not for me since my webui port does not match yours. I can run that same curl command and change my port with out issue if i change the port to my correct webui port.

upcboy commented 4 years ago

@binhex submitted a pull request( #27 ) that fixes the issue. I tested it in a new container and the build looks to work properly now.

binhex commented 4 years ago

ugghh!, thanks for that, must of hard coded it during testing!, merged and image built, please pull down and give it a whirl.

BigC27 commented 4 years ago

Yep working for me now. Cheers!

upcboy commented 4 years ago

Fixed by 7151044024f92d154ccdb055c331c6f10d37038b