haugene/vpn-configs-contrib

`TRANSMISSION_RPC_URL` option causes a `moved permanently` error when using PIA

Closed this issue · 2 comments

Is there a pinned issue for this?

  • I have read the pinned issues and could not find my issue

Is there an existing or similar issue/discussion for this?

  • I have searched the existing issues
  • I have searched the existing discussions

Is there any comment in the documentation for this?

  • I have read the documentation, especially the FAQ and Troubleshooting parts

Is this related to a provider?

  • I have checked the provider repo for issues
  • My issue is NOT related to a provider

Are you using the latest release?

  • I am using the latest release

Have you tried using the dev branch latest?

  • I have tried using dev branch

Docker run config used

version: '3.3'
services:
    transmission-openvpn:
        cap_add:
            - NET_ADMIN
        volumes:
            - '/your/storage/path/:/data'
            - '/your/config/path/:/config'
        environment:
            - OPENVPN_PROVIDER=PIA
            - OPENVPN_CONFIG=france
            - OPENVPN_USERNAME=user
            - OPENVPN_PASSWORD=pass
            - LOCAL_NETWORK=192.168.1.0/24
            - TRANSMISSION_RPC_URL=/foo/
        logging:
            driver: json-file
            options:
                max-size: 10m
        ports:
            - '9091:9091'
        image: haugene/transmission-openvpn

Current Behavior

When starting the container with TRANSMISSION_RPC_URL, the container gives a 301 Moved Permanently error.

Expected Behavior

Not get the error

How have you tried to solve the problem?

Searched for related issues, tried dev branch and looked at the source code.

Log output

transmission-vpn  | TRANSMISSION_HOME is currently set to: /config/transmission-home
transmission-vpn  | Creating TUN device /dev/net/tun
transmission-vpn  | Using OpenVPN provider: PIA
transmission-vpn  | Running with VPN_CONFIG_SOURCE auto
transmission-vpn  | Provider PIA has a bundled setup script. Defaulting to internal config
transmission-vpn  | Executing setup script for PIA
transmission-vpn  | Downloading OpenVPN config bundle openvpn into temporary file /tmp/tmp.kQ0cPCVvJC
transmission-vpn  | Extract OpenVPN config bundle into PIA directory /etc/openvpn/pia
transmission-vpn  | Starting OpenVPN using config netherlands.ovpn
transmission-vpn  | Modifying /etc/openvpn/pia/[REDACTED].ovpn for best behaviour in this container
transmission-vpn  | Modification: Point auth-user-pass option to the username/password file
transmission-vpn  | Modification: Change ca certificate path
transmission-vpn  | Modification: Change ping options
transmission-vpn  | Modification: Update/set resolv-retry to 15 seconds
transmission-vpn  | Modification: Change tls-crypt keyfile path
transmission-vpn  | Modification: Set output verbosity to 3
transmission-vpn  | Modification: Remap SIGUSR1 signal to SIGTERM, avoid OpenVPN restart loop
transmission-vpn  | Modification: Updating status for config failure detection
transmission-vpn  | Setting OpenVPN credentials...
transmission-vpn  | adding route to local network 192.168.1.0/24 via 172.26.0.1 dev eth0
transmission-vpn  | 2023-07-13 09:00:59 DEPRECATED OPTION: --cipher set to 'aes-128-cbc' but missing in --data-ciphers (AES-256-GCM:AES-128-GCM). Future OpenVPN version will ignore --cipher for cipher negotiations. Add 'aes-128-cbc' to --data-ciphers or change --cipher 'aes-128-cbc' to --data-ciphers-fallback 'aes-128-cbc' to silence this warning.
transmission-vpn  | 2023-07-13 09:00:59 OpenVPN 2.5.5 x86_64-pc-linux-gnu [SSL (OpenSSL)] [LZO] [LZ4] [EPOLL] [PKCS11] [MH/PKTINFO] [AEAD] built on Jul 14 2022
transmission-vpn  | 2023-07-13 09:00:59 library versions: OpenSSL 3.0.2 15 Mar 2022, LZO 2.10
transmission-vpn  | 2023-07-13 09:00:59 NOTE: the current --script-security setting may allow this configuration to call user-defined scripts
transmission-vpn  | 2023-07-13 09:00:59 CRL: loaded 1 CRLs from file -----BEGIN X509 CRL-----
    [REDACTED]
transmission-vpn  | -----END X509 CRL-----
transmission-vpn  |
transmission-vpn  |
transmission-vpn  | 2023-07-13 09:00:59 TCP/UDP: Preserving recently used remote address: [AF_INET]143.244.41.142:1198
transmission-vpn  | 2023-07-13 09:00:59 Socket Buffers: R=[212992->212992] S=[212992->212992]
transmission-vpn  | 2023-07-13 09:00:59 UDP link local: (not bound)
transmission-vpn  | 2023-07-13 09:00:59 UDP link remote: [AF_INET]143.244.41.142:1198
transmission-vpn  | 2023-07-13 09:01:01 TLS: Initial packet from [AF_INET]143.244.41.142:1198, sid=5f6c2df3 189d558d
transmission-vpn  | 2023-07-13 09:01:01 VERIFY OK: depth=1, C=US, ST=CA, L=LosAngeles, O=Private Internet Access, OU=Private Internet Access, CN=Private Internet Access, name=Private Internet Access, emailAddress=secure@privateinternetaccess.com
transmission-vpn  | 2023-07-13 09:01:01 VERIFY KU OK
transmission-vpn  | 2023-07-13 09:01:01 Validating certificate extended key usage
transmission-vpn  | 2023-07-13 09:01:01 ++ Certificate has EKU (str) TLS Web Server Authentication, expects TLS Web Server Authentication
transmission-vpn  | 2023-07-13 09:01:01 VERIFY EKU OK
transmission-vpn  | 2023-07-13 09:01:01 VERIFY OK: depth=0, C=US, ST=CA, L=LosAngeles, O=Private Internet Access, OU=Private Internet Access, CN=amsterdam403, name=amsterdam403
transmission-vpn  | 2023-07-13 09:01:01 Control Channel: TLSv1.3, cipher TLSv1.3 TLS_AES_256_GCM_SHA384, peer certificate: 2048 bit RSA, signature: RSA-SHA512
transmission-vpn  | 2023-07-13 09:01:01 [amsterdam403] Peer Connection Initiated with [AF_INET]143.244.41.142:1198
transmission-vpn  | 2023-07-13 09:01:01 PUSH: Received control message: 'PUSH_REPLY,comp-lzo no,redirect-gateway def1,route-ipv6 2000::/3,dhcp-option DNS 10.0.0.243,route-gateway 10.13.112.1,topology subnet,ping 10,ping-restart 60,ifconfig 10.13.112.218 255.255.255.0,peer-id 14,cipher AES-128-GCM'
transmission-vpn  | 2023-07-13 09:01:01 OPTIONS IMPORT: timers and/or timeouts modified
transmission-vpn  | 2023-07-13 09:01:01 OPTIONS IMPORT: compression parms modified
transmission-vpn  | 2023-07-13 09:01:01 OPTIONS IMPORT: --ifconfig/up options modified
transmission-vpn  | 2023-07-13 09:01:01 OPTIONS IMPORT: route options modified
transmission-vpn  | 2023-07-13 09:01:01 OPTIONS IMPORT: route-related options modified
transmission-vpn  | 2023-07-13 09:01:01 OPTIONS IMPORT: --ip-win32 and/or --dhcp-option options modified
transmission-vpn  | 2023-07-13 09:01:01 OPTIONS IMPORT: peer-id set
transmission-vpn  | 2023-07-13 09:01:01 OPTIONS IMPORT: adjusting link_mtu to 1625
transmission-vpn  | 2023-07-13 09:01:01 OPTIONS IMPORT: data channel crypto options modified
transmission-vpn  | 2023-07-13 09:01:01 Data Channel: using negotiated cipher 'AES-128-GCM'
transmission-vpn  | 2023-07-13 09:01:01 Outgoing Data Channel: Cipher 'AES-128-GCM' initialized with 128 bit key
transmission-vpn  | 2023-07-13 09:01:01 Incoming Data Channel: Cipher 'AES-128-GCM' initialized with 128 bit key
transmission-vpn  | 2023-07-13 09:01:01 net_route_v4_best_gw query: dst 0.0.0.0
transmission-vpn  | 2023-07-13 09:01:01 net_route_v4_best_gw result: via 172.26.0.1 dev eth0
transmission-vpn  | 2023-07-13 09:01:01 ROUTE_GATEWAY 172.26.0.1/255.255.0.0 IFACE=eth0 HWADDR=02:42:ac:1a:00:02
transmission-vpn  | 2023-07-13 09:01:01 GDG6: remote_host_ipv6=n/a
transmission-vpn  | 2023-07-13 09:01:01 net_route_v6_best_gw query: dst ::
transmission-vpn  | 2023-07-13 09:01:01 sitnl_send: rtnl: generic error (-101): Network is unreachable
transmission-vpn  | 2023-07-13 09:01:01 ROUTE6: default_gateway=UNDEF
transmission-vpn  | 2023-07-13 09:01:01 TUN/TAP device tun0 opened
transmission-vpn  | 2023-07-13 09:01:01 net_iface_mtu_set: mtu 1500 for tun0
transmission-vpn  | 2023-07-13 09:01:01 net_iface_up: set tun0 up
transmission-vpn  | 2023-07-13 09:01:01 net_addr_v4_add: 10.13.112.218/24 dev tun0
transmission-vpn  | 2023-07-13 09:01:01 net_route_v4_add: 143.244.41.142/32 via 172.26.0.1 dev [NULL] table 0 metric -1
transmission-vpn  | 2023-07-13 09:01:01 net_route_v4_add: 0.0.0.0/1 via 10.13.112.1 dev [NULL] table 0 metric -1
transmission-vpn  | 2023-07-13 09:01:01 net_route_v4_add: 128.0.0.0/1 via 10.13.112.1 dev [NULL] table 0 metric -1
transmission-vpn  | 2023-07-13 09:01:01 WARNING: OpenVPN was configured to add an IPv6 route. However, no IPv6 has been configured for tun0, therefore the route installation may fail or may not work as expected.
transmission-vpn  | 2023-07-13 09:01:01 add_route_ipv6(2000::/3 -> :: metric -1) dev tun0
transmission-vpn  | 2023-07-13 09:01:01 net_route_v6_add: 2000::/3 via :: dev tun0 table 0 metric -1
transmission-vpn  | 2023-07-13 09:01:01 sitnl_send: rtnl: generic error (-13): Permission denied
transmission-vpn  | 2023-07-13 09:01:01 ERROR: Linux IPv6 route can't be added
transmission-vpn  | Up script executed with device=tun0 ifconfig_local=10.13.112.218
transmission-vpn  | Updating TRANSMISSION_BIND_ADDRESS_IPV4 to the ip of tun0 : 10.13.112.218
transmission-vpn  |
transmission-vpn  | -------------------------------------
transmission-vpn  | Transmission will run as
transmission-vpn  | -------------------------------------
transmission-vpn  | User name:   root
transmission-vpn  | User uid:    0
transmission-vpn  | User gid:    0
transmission-vpn  | -------------------------------------
transmission-vpn  |
transmission-vpn  |
transmission-vpn  | Updating Transmission settings.json with values from env variables
transmission-vpn  | Attempting to use existing settings.json for Transmission
transmission-vpn  | Successfully used existing settings.json /config/transmission-home/settings.json
transmission-vpn  | Overriding bind-address-ipv4 because TRANSMISSION_BIND_ADDRESS_IPV4 is set to 10.13.112.218
transmission-vpn  | Overriding download-dir because TRANSMISSION_DOWNLOAD_DIR is set to /data/completed
transmission-vpn  | Overriding incomplete-dir because TRANSMISSION_INCOMPLETE_DIR is set to /data/incomplete
transmission-vpn  | Overriding rpc-authentication-required because TRANSMISSION_RPC_AUTHENTICATION_REQUIRED is set to false
transmission-vpn  | Overriding rpc-enabled because TRANSMISSION_RPC_ENABLED is set to true
transmission-vpn  | Overriding rpc-host-whitelist because TRANSMISSION_RPC_HOST_WHITELIST is set to *
transmission-vpn  | Overriding rpc-password because TRANSMISSION_RPC_PASSWORD is set to [REDACTED]
transmission-vpn  | Overriding rpc-port because TRANSMISSION_RPC_PORT is set to 9091
transmission-vpn  | Overriding rpc-username because TRANSMISSION_RPC_USERNAME is set to [REDACTED]
transmission-vpn  | Overriding watch-dir because TRANSMISSION_WATCH_DIR is set to /data/watch
transmission-vpn  | sed'ing True to true
transmission-vpn  | STARTING TRANSMISSION
transmission-vpn  | Provider PIA has a script for automatic port forwarding. Will run it now.
transmission-vpn  | If you want to disable this, set environment variable DISABLE_PORT_UPDATER=true
transmission-vpn  | Transmission startup script complete.
transmission-vpn  | 2023-07-13 09:01:01 WARNING: this configuration may cache passwords in memory -- use the auth-nocache option to prevent this
transmission-vpn  | 2023-07-13 09:01:01 Initialization Sequence Completed
transmission-vpn  | Running functions for token based port fowarding
transmission-vpn  | Reserved Port: 59281  Thu Jul 13 09:01:06 UTC 2023
transmission-vpn  | transmission auth not required
transmission-vpn  | waiting for transmission to become responsive
transmission-vpn  | Unexpected response: <h1>301: Moved Permanently</h1>

HW/SW Environment

- OS: Ubuntu22.04.2
- Docker: 20.10.21

- OS: Arch
- Docker: 24.0.2

Anything else?

No response

You’ve tried without rpc enabled, right? Does it work then then?

Ah I was wondering why my issue had disappeared. This problem was fixed in haugene/docker-transmission-openvpn#2657