guillaumedsde / alpine-qbittorrent-openvpn

qBittorrent docker container with OpenVPN client running as unprivileged user on alpine linux
https://guillaumedsde.gitlab.io/alpine-qbittorrent-openvpn/
GNU General Public License v3.0
216 stars 40 forks source link

NordVPN: updateConfigs.sh not found #35

Closed JasperMC closed 3 years ago

JasperMC commented 4 years ago

Information

Whenever I attempt to use NordVPN with this container I get the following error:

/var/run/s6/etc/cont-init.d/02-setup-openvpn: /etc/openvpn/nordvpn/configure-openvpn.sh: line 12: 
/etc/openvpn/nordvpn/updateConfigs.sh: not found

ERROR: Could not find OpenVPN configuration "" for provider NORDVPN

This occurs both with the suggested configuration as well as with the NordVPN specific env variables as mentioned here: https://haugene.github.io/docker-transmission-openvpn/nordvpn-script/

As the files for NordVPN are coming from docker-transmission-openvpn, I also tried that container with the same configuration. The problem does not appear there.

My suspicion is that the script is looking for the file in the wrong place. I think it's because of the "${VPN_PROVIDER_HOME} variable. Trying to confirm that.

Current setup

Docker image tag: latest Docker image hash: sha256:8157f288e27d2b642f0aefd72b6f86174185e6e4eb310063d2d4b85720199dd6

docker-compose.yml file or docker run command

Started using docker-compose.yaml:

version: "3.3"
services:
  alpine-qbittorrent-openvpn:
    volumes:
      - "/your/storage/path/:/downloads"
      - "/path/to/config/directory:/config"
      - "/etc/localtime:/etc/localtime:ro"
    environment:
      - OPENVPN_PROVIDER=NORDVPN
      - OPENVPN_CONFIG=NL\
      - OPENVPN_USERNAME=user
      - OPENVPN_PASSWORD=pass
      - PUID=1000
      - PGID=1000
      - LAN=192.168.0.0/16
    ports:
      - "8080:8080"
    cap_add:
      - NET_ADMIN
    image: guillaumedsde/alpine-qbittorrent-openvpn:latest

Attempted Fix(es)

  1. Set "behavior if S2 fails" to 0 to prevent termination
  2. Went into the container to verify whether updateConfigs.sh exists (it does)
  3. Tried with NordVPN-specific env variables (did not work)
theendsofinvention commented 4 years ago

I'm having the exact same issue here, also investigating.

JasperMC commented 4 years ago

Small update from my side: I've found out that the VPN_PROVIDER_HOME variable is created in /etc/cont-init.d/02-setup-openvpn

It basically takes the path to openvpn and appends the name of the provider ( /etc/openvpn/{lowercase_provider_name}. I don't see what's going wrong here as the path does check out.

Upon looking in configure-openvpn.sh I also noticed something in the following code snippet:

if [[ -n $OPENVPN_CONFIG ]]; then
    echo "Downloading user specified config. NORDVPN_PROTOCOL is set to: ${NORDVPN_PROTOCOL}"
    ${VPN_PROVIDER_HOME}/updateConfigs.sh --openvpn-config
elif [[ -n $NORDVPN_COUNTRY ]]; then
    export OPENVPN_CONFIG=$(${VPN_PROVIDER_HOME}/updateConfigs.sh)
else
    export OPENVPN_CONFIG=$(${VPN_PROVIDER_HOME}/updateConfigs.sh --get-recommended)
fi

In the first line of code, it checks if the OPENVPN_CONFIG variable has been passed through. Only then, it should execute the echo and updateConfigs with --openvpn-config argument.

If I do not provide OPENVPN_CONFIG in the Docker env variables, it still passes this check though: It still says "line 12: not found", whereas I would expect it to say "line 14: not found" (because I passed the NORDVPN_COUNTRY instead of OPENVPN_CONFIG) or at least line 16 if all checks fail.

I have no idea what's going wrong here and why it works well in docker-transmission-openvpn.

maxi1134 commented 4 years ago

Same issue here! Would love to help testing

gurmukhp commented 4 years ago

Also having this issue:

Downloading user specified config. NORDVPN_PROTOCOL is set to: UDP
/var/run/s6/etc/cont-init.d/02-setup-openvpn: /etc/openvpn/nordvpn/configure-openvpn.sh: line 12: /etc/openvpn/nordvpn/updateConfigs.sh: not found
ERROR: Could not find OpenVPN configuration "" for provider NORDVPN
[cont-init.d] 02-setup-openvpn: exited 1.
[cont-finish.d] executing container finish scripts...
[cont-finish.d] done.
[s6-finish] waiting for services.
[s6-finish] sending all processes the TERM signal.
[s6-finish] sending all processes the KILL signal and exiting.
PwnPeter commented 3 years ago

Same, so I use an ovpn file from nordvpn instead.

JasperMC commented 3 years ago

@guillaumedsde Could you have a look at this issue? I can't seem to figure it out.

JasperMC commented 3 years ago

Same, so I use an ovpn file from nordvpn instead.

Hi Peter,

Does that work for you as is? I had to change behavior_if_s2_fails from 2 to 0 to make it work, but perhaps that is unnecessary.

guillaumedsde commented 3 years ago

I've merged this PR from @notsureifkevin that might fix the issue, could one of you try and pull the development tag to see if its fixed?

JasperMC commented 3 years ago

Hi @guillaumedsde,

I can confirm this works! Thanks so much for the merge and many thanks for @notsureifkevin for the pull request.

guillaumedsde commented 3 years ago

Good to hear, I'll leave this issue open for some time for people to test it then I'll merge it in master

Leiasticot commented 3 years ago

Hello, I actually have the problem and I don't really understand how to solve it. Can someone help me pls ?

JasperMC commented 3 years ago

Hello, I actually have the problem and I don't really understand how to solve it.

Can someone help me pls ?

You need to use a different version of the docker image. Right now you may for example be using :latest, but to try this fix you need to set it to :development

guillaumedsde commented 3 years ago

Thanks @JasperMC :) I've just merged the change into master so it should be available under latest now

jos149 commented 3 years ago
version: "3.3"
services:
  alpine-qbittorrent-openvpn:
    volumes:
      - "/your/storage/path/:/downloads"
      - "/path/to/config/directory:/config"
      - "/etc/localtime:/etc/localtime:ro"
    environment:
      - OPENVPN_PROVIDER=NORDVPN
      - OPENVPN_CONFIG=NL\
      - OPENVPN_USERNAME=user
      - OPENVPN_PASSWORD=pass
      - PUID=1000
      - PGID=1000
      - LAN=192.168.0.0/16
    ports:
      - "8080:8080"
    cap_add:
      - NET_ADMIN
    image: guillaumedsde/alpine-qbittorrent-openvpn:latest

My setup is almost similar. Just wondering; what does the \ do after NL? And I guess my LAN should be routerip/24 (if subnet mask is 255.255.255.0)

I am trying to get my container to work, however, it fails to boot. My portainer logs say:

s6-svscan: warning: unable to iopause: Operation not permitted
s6-svscan: warning: executing into .s6-svscan/crash
s6-supervise s6-fdholderd: fatal: unable to iopause: Operation not permitted
s6-svscan panicked! Dropping to a root shell.