openvpn-client icon indicating copy to clipboard operation
openvpn-client copied to clipboard

Error : sh: syntax error: unexpected

Open EVOTk opened this issue 4 years ago • 1 comments

Hello, I solicit your help, because I have a error in the logs of the container. My VPN file work well in another VPN client.

My system : Docker version 20.10.6, build 370c289 docker-compose version 1.28.4, build cabd5cfb Linux 5.10.0-0.bpo.5-amd64 #1 SMP Debian 5.10.24-1~bpo10+1 (2021-03-29) x86_64 GNU/Linux

This is my compose:

version: '3.2'
      
services: 
  vpn:
    image: dperson/openvpn-client:latest
    container_name: vpn
    restart: unless-stopped
    cap_add:
     - NET_ADMIN
    sysctls:
     - net.ipv6.conf.all.disable_ipv6=0
    security_opt:
     - label:disable
    environment:
     - PUID=1000
     - PGID=100
     - TZ=Europe/Paris
    networks:
     - vpn-network
    dns:
     - 84.200.69.80
     - 8.8.8.8
     - 9.9.9.9
    ports :
     - 8384:8384  
    devices:
     - /dev/net/tun:/dev/net/tun
    volumes:
     - /srv/disk1/docker/vpn/config:/vpn
     - /srv/disk1/docker/vpn/scripts:/scripts
    command: '-f "" -r 192.168.0.0/24'
    healthcheck:
      test: ["CMD", "curl", "-Ss", "ifconfig.co"]
      interval: 60s
      timeout: 15s
    
networks:
  vpn-network:
    external:
      name: vpn-network

Here are the logs of the container:

WARNING: ip6tables disabled!
Run 'sudo modprobe ip6table_filter' on your host
modprobe: can't change directory to '/lib/modules': No such file or directory
modprobe: can't change directory to '/lib/modules': No such file or directory
ip6tables v1.8.4 (legacy): can't initialize ip6tables table `nat': Table does not exist (do you need to insmod?)
Perhaps ip6tables or your kernel needs to be upgraded.
modprobe: can't change directory to '/lib/modules': No such file or directory
modprobe: can't change directory to '/lib/modules': No such file or directory
ip6tables v1.8.4 (legacy): can't initialize ip6tables table `nat': Table does not exist (do you need to insmod?)
Perhaps ip6tables or your kernel needs to be upgraded.
The use of ROUTE or -r may no longer be needed, try it without!
Dump terminated
+ exec sg vpn -c 'openvpn --cd /vpn --config /vpn/client(7).ovpn --script-security 2 --redirect-gateway def1 --route-up '\''/bin/sh -c " iptables -A OUTPUT -d 127.0.0.11 -j ACCEPT"'\'' --route-pre-down '\''/bin/sh -c " iptables -D OUTPUT -d 127.0.0.11 -j ACCEPT"'\'' --auth-user-pass /vpn/vpn.auth                 '
sh: syntax error: unexpected "("

thank you so much

EVOTk avatar Apr 25 '21 07:04 EVOTk

Hello, I found the problem, it comes from the name of my .opvn file

Indeed, the parentheses contained in the name is a problem for the proper execution of the container! Once the file is renamed without parentheses, it works without problems.

EVOTk avatar Apr 25 '21 14:04 EVOTk