DyonR / docker-Jackettvpn

Docker container which runs a headless Jackett Server with an optional WireGuard or OpenVPN connection
https://hub.docker.com/r/dyonr/jackettvpn/
GNU General Public License v3.0
68 stars 32 forks source link

Error opening configuration file: openvpn closes connection and kills container #50

Closed wattsra closed 2 years ago

wattsra commented 2 years ago

Whenever I start this container it immediately fails and kills itself with the error below.

Options error: In [CMD-LINE]:1: Error opening configuration file: /config/openvpn/id-jak.prod.surfshark.comsurfshark_openvpn_tcp.ovpn

I am running on portainer with the attached yml file as a stack. I believe that this should sort out the "privleged" requirement.

I suspect that it is linked to this issue, but the solutions/workarounds posted there don't seem to work for me : https://github.com/haugene/docker-transmission-openvpn/issues/1839

yaml file:

version: '3.3'
services:
  jackettvpn:
    image: dyonr/jackettvpn:latest
    privileged: true
    restart: unless-stopped
    cap_add:
      - NET_ADMIN
    ports:
      - 9117:9117 # http://nas-ip:9091 to access ui
    environment:
      - VPN_ENABLED=yes
      - VPN_TYPE=openvpn
      - LAN_NETWORK=192.168.50.0/24
    volumes:
      - /volume1/docker/jackettvpn:/config # change to download dir
    network_mode: bridge

Log file:

2021-08-13 15:53:49.611756 [INFO] VPN_ENABLED defined as 'yes'
2021-08-13 15:53:49.664239 [INFO] VPN_TYPE defined as 'openvpn'
2021-08-13 15:53:49.745704 [INFO] OpenVPN config file is found at /config/openvpn/id-jak.prod.surfshark.comsurfshark_openvpn_tcp.ovpn
dos2unix: converting file /config/openvpn/id-jak.prod.surfshark.comsurfshark_openvpn_tcp.ovpn to Unix format...
2021-08-13 15:53:49.844749 [INFO] VPN remote line defined as 'id-jak.prod.surfshark.com 1443'
2021-08-13 15:53:49.882589 [INFO] VPN_REMOTE defined as 'id-jak.prod.surfshark.com'
2021-08-13 15:53:49.920998 [INFO] VPN_PORT defined as '1443'
2021-08-13 15:53:49.959346 [INFO] VPN_PROTOCOL defined as 'tcp'
2021-08-13 15:53:49.996575 [INFO] VPN_DEVICE_TYPE defined as 'tun0'
2021-08-13 15:53:50.033733 [INFO] LAN_NETWORK defined as '192.168.50.0/24'
2021-08-13 15:53:50.070801 [WARNING] NAME_SERVERS not defined (via -e NAME_SERVERS), defaulting to CloudFlare and Google name servers
2021-08-13 15:53:50.108169 [INFO] VPN_OPTIONS not defined (via -e VPN_OPTIONS)
2021-08-13 15:53:50.150287 [INFO] Adding 1.1.1.1 to resolv.conf
2021-08-13 15:53:50.187892 [INFO] Adding 8.8.8.8 to resolv.conf
2021-08-13 15:53:50.224315 [INFO] Adding 1.0.0.1 to resolv.conf
2021-08-13 15:53:50.263070 [INFO] Adding 8.8.4.4 to resolv.conf
2021-08-13 15:53:50.297636 [INFO] PUID not defined. Defaulting to root user
2021-08-13 15:53:50.332493 [INFO] PGID not defined. Defaulting to root group
2021-08-13 15:53:50.369179 [INFO] Starting OpenVPN...
Options error: In [CMD-LINE]:1: Error opening configuration file: /config/openvpn/id-jak.prod.surfshark.comsurfshark_openvpn_tcp.ovpn
DyonR commented 2 years ago

It does indeed seem related to the issue you shared.
Did you try this yet?
Unchecking "execute container using high privilege" and re-checking it again fixes the issue with DSM 7.0 after migration.

And, did you also try other solutions of that issue, like this one?
https://github.com/haugene/docker-transmission-openvpn/issues/1839#issuecomment-894724920

ghost commented 2 years ago

I found the fix and already posted it in the mentioned qbittorrentvpn issue, but I thought I'd put it here also.

Add the following lines to your compose file:

  devices:
    - /dev/net/tun
DyonR commented 2 years ago

Please refer to this issue for a solution, as @SheepKid12 also mentioned:
https://github.com/DyonR/docker-qbittorrentvpn/issues/56

elb34st commented 2 years ago

I have the same problem even after trying the solution from the other posts...

gwrichard commented 2 years ago

Same. My yaml is identical to yours and I get the same read error about the openvpn config file.

Made sure to add the cap_add: - NET_ADMIN and privileged parameters.

Interestingly it worked for my transmission docker instance but not jackett.

Running on Synology DSM 7