qdm12 / gluetun

VPN client in a thin Docker container for multiple VPN providers, written in Go, and using OpenVPN or Wireguard, DNS over TLS, with a few proxy servers built-in.
https://hub.docker.com/r/qmcgaw/gluetun
MIT License
7.42k stars 350 forks source link

Bug: cannot unmarshal string into Go struct field ProtonvpnServer.protonvpn.servers.exit_ip of type []net.IP #654

Closed rubbo898 closed 2 years ago

rubbo898 commented 2 years ago

Is this urgent?

No

Host OS

Unraid

CPU arch

x86_64

VPN service provider

Surfshark

What are you using to run the container

docker run

What is the version of Gluetun

qmcgaw/gluetun:latest --> 9fc369b8d6999e1901fea1ff8b89b8317c6c9a37

What's the problem 🤔

Container seems running but in a kind of shutdown loop (see logs)

Share your logs

2021/09/30 09:59:05 INFO Shutdown successful
2021/09/30 09:59:06 ERROR cannot read servers from file: json: cannot unmarshal string into Go struct field ProtonvpnServer.protonvpn.servers.exit_ip of type []net.IP

2021/09/30 09:59:06 INFO Shutdown successful
2021/09/30 09:59:06 ERROR cannot read servers from file: json: cannot unmarshal string into Go struct field ProtonvpnServer.protonvpn.servers.exit_ip of type []net.IP

2021/09/30 09:59:06 INFO Shutdown successful
2021/09/30 09:59:07 ERROR cannot read servers from file: json: cannot unmarshal string into Go struct field ProtonvpnServer.protonvpn.servers.exit_ip of type []net.IP

2021/09/30 09:59:07 INFO Shutdown successful
2021/09/30 09:59:09 ERROR cannot read servers from file: json: cannot unmarshal string into Go struct field ProtonvpnServer.protonvpn.servers.exit_ip of type []net.IP

2021/09/30 09:59:09 INFO Shutdown successful
2021/09/30 09:59:11 ERROR cannot read servers from file: json: cannot unmarshal string into Go struct field ProtonvpnServer.protonvpn.servers.exit_ip of type []net.IP

2021/09/30 09:59:11 INFO Shutdown successful
2021/09/30 09:59:15 ERROR cannot read servers from file: json: cannot unmarshal string into Go struct field ProtonvpnServer.protonvpn.servers.exit_ip of type []net.IP

2021/09/30 09:59:15 INFO Shutdown successful
2021/09/30 09:59:22 ERROR cannot read servers from file: json: cannot unmarshal string into Go struct field ProtonvpnServer.protonvpn.servers.exit_ip of type []net.IP

2021/09/30 09:59:22 INFO Shutdown successful
2021/09/30 09:59:35 ERROR cannot read servers from file: json: cannot unmarshal string into Go struct field ProtonvpnServer.protonvpn.servers.exit_ip of type []net.IP

2021/09/30 09:59:35 INFO Shutdown successful
2021/09/30 10:00:01 ERROR cannot read servers from file: json: cannot unmarshal string into Go struct field ProtonvpnServer.protonvpn.servers.exit_ip of type []net.IP

2021/09/30 10:00:01 INFO Shutdown successful
2021/09/30 10:00:53 ERROR cannot read servers from file: json: cannot unmarshal string into Go struct field ProtonvpnServer.protonvpn.servers.exit_ip of type []net.IP

2021/09/30 10:00:53 INFO Shutdown successful
2021/09/30 10:01:54 ERROR cannot read servers from file: json: cannot unmarshal string into Go struct field ProtonvpnServer.protonvpn.servers.exit_ip of type []net.IP

2021/09/30 10:01:54 INFO Shutdown successful
2021/09/30 10:02:54 ERROR cannot read servers from file: json: cannot unmarshal string into Go struct field ProtonvpnServer.protonvpn.servers.exit_ip of type []net.IP

Share your configuration

docker run -d --name='GluetunVPN' --net='xxxxxxxxx' -e TZ="Europe/Berlin" -e HOST_OS="Unraid" -e 'TZ'='Europe/Rome' -e 'VPNSP'='surfshark' -e 'VPN_TYPE'='openvpn' -e 'OPENVPN_PROTOCOL'='udp' -e 'OPENVPN_USER'='xxxxxxx' -e 'OPENVPN_PASSWORD'='xxxxxx' -e 'OPENVPN_VERSION'='2.5' -e 'OPENVPN_VERBOSITY'='1' -e 'OPENVPN_FLAGS'='' -e 'OPENVPN_CIPHER'='' -e 'OPENVPN_AUTH'='' -e 'OPENVPN_ROOT'='no' -e 'OPENVPN_TARGET_IP'='' -e 'OPENVPN_IPV6'='off' -e 'OPENVPN_CUSTOM_CONFIG'='' -e 'OPENVPN_INTERFACE'='tun0' -e 'PORT'='' -e 'WIREGUARD_PRIVATE_KEY'='' -e 'WIREGUARD_PRESHARED_KEY'='' -e 'WIREGUARD_PUBLIC_KEY'='' -e 'WIREGUARD_ADDRESS'='' -e 'WIREGUARD_ENDPOINT_IP'='' -e 'WIREGUARD_ENDPOINT_PORT'='xxxxx' -e 'WIREGUARD_INTERFACE'='xxxxx' -e 'REGION'='xxxxxxx' -e 'COUNTRY'='' -e 'CITY'='' -e 'SERVER_HOSTNAME'='xxxxxx' -e 'FIREWALL'='on' -e 'FIREWALL_VPN_INPUT_PORTS'='' -e 'FIREWALL_INPUT_PORTS'='' -e 'FIREWALL_OUTBOUND_SUBNETS'='xxxxxxxx' -e 'FIREWALL_DEBUG'='off' -e 'LOG_LEVEL'='info' -e 'DOT'='on' -e 'DOT_PROVIDERS'='cloudflare' -e 'DOT_PRIVATE_ADDRESS'='xxxxxxxxxxxxxxxxx' -e 'DOT_VERBOSITY'='1' -e 'DOT_VERBOSITY_DETAILS'='1' -e 'DOT_VALIDATION_LOGLEVEL'='1' -e 'DOT_CACHING'='on' -e 'DOT_IPV6'='off' -e 'BLOCK_MALICIOUS'='on' -e 'BLOCK_SURVEILLANCE'='off' -e 'BLOCK_ADS'='off' -e 'UNBLOCK'='' -e 'DNS_UPDATE_PERIOD'='24h' -e 'DNS_PLAINTEXT_ADDRESS'='' -e 'DNS_KEEP_NAMESERVER'='on' -e 'HTTPPROXY'='on' -e 'HTTPPROXY_LOG'='on' -e 'HTTPPROXY_USER'='xxxxxxxxxxx' -e 'HTTPPROXY_PASSWORD'='xxxxxxxxxx' -e 'HTTPPROXY_STEALTH'='off' -e 'SHADOWSOCKS'='on' -e 'SHADOWSOCKS_LOG'='on' -e 'SHADOWSOCKS_PASSWORD'='xxxxxxxx' -e 'SHADOWSOCKS_CIPHER'='xxxxxxxxxx' -e 'HEALTH_SERVER_ADDRESS'='xxxxxxxxxxx' -e 'HEALTH_ADDRESS_TO_PING'='github.com' -e 'HEALTH_VPN_DURATION_INITIAL'='6s' -e 'HEALTH_VPN_DURATION_ADDITION'='5s' -e 'UPDATER_PERIOD'='0' -e 'PUBLICIP_FILE'='/gluetun/ip' -e 'PUBLICIP_PERIOD'='12h' -e 'VERSION_INFORMATION'='on' -e 'HTTP_CONTROL_SERVER_LOG'='on' -e 'PUID'='99' -e 'PGID'='100' -p 'x' -p 'xxxxxxxxxx/tcp' -p 'xxxxxxx/udp' -p '9117:9117/tcp' -p 'xxxxxx/tcp' -p 'xxxxxxx/tcp' -p 'xxxxxxx/tcp' -p 'xxxxxxx/udp' -p 'xxxxxxx/tcp' -p 'xxxxxxxx/tcp' -v '/mnt/user/appdata/gluetun':'/gluetun':'rw' --cap-add=NET_ADMIN --restart always 'qmcgaw/gluetun'
cloudwhizz commented 2 years ago

I have this issue too since version 3.24 onwards

oester commented 2 years ago

The 3.24.0 docker image works for me, but the latest image produces the same error for me (just recycled this morning)

Using PIA as my provider

lpiddi commented 2 years ago

Same issue here on my Synology docker. Using surfshark

qdm12 commented 2 years ago

Oh boy looks like I messed up yesterday, sorry! Use image tag v3.25.0; I'll fix this in a few minutes...! Alternatively remove your servers.json and it might work.

monarc83 commented 2 years ago

I have the same issue since the latest upgrade of the docker.

2021/09/30 12:41:29 ERROR cannot read servers from file: json: cannot unmarshal string into Go struct field ProtonvpnServer.protonvpn.servers.exit_ip of type []net.IP

2021/09/30 12:41:29 INFO Shutdown successful
2021/09/30 12:43:03 ERROR cannot read servers from file: json: cannot unmarshal string into Go struct field ProtonvpnServer.protonvpn.servers.exit_ip of type []net.IP

2021/09/30 12:43:03 INFO Shutdown successful

I am using NordVPN

hugalafutro commented 2 years ago

Can confirm deleting servers.json worked for me. I'm using PIA. After removing the file gluetun and all depending containers in the stack came up no problem.

edit:The file got recreated with more or less same contents (I can provide both old and new servers.json if it's useful)

frepke commented 2 years ago

Can confirm deleting servers.json worked for me. I'm using PIA. After removing the file gluetun and all depending containers in the stack came up no problem.

+1 with SurfShark

But with errors:

gluetun | 2021/09/30 15:37:19 ERROR ip getter: Get "https://diagnostic.opendns.com/myip": x509: certificate signed by unknown authority gluetun | 2021/09/30 15:37:19 INFO ip getter: retrying in 5s gluetun | 2021/09/30 15:37:19 ERROR vpn: cannot get version information: commit not found: 9fc369b

rubbo898 commented 2 years ago

Oh boy looks like I messed up yesterday, sorry! Use image tag v3.25.0; I'll fix this in a few minutes...! Alternatively remove your servers.json and it might work.

Remove servers.json resolves the issue

qdm12 commented 2 years ago

I'm fixing that bug but it's harder than I thought to fix, so I removed the last (faulty) commit from the master branch so latest should be fixed soon. It should also be the exact same as v3.25.0 so feel free to use that image tag too.

For the curious, the bug was that I changed the protonvpn server model, and gluetun would not make it to read it from the servers.json file since a field changed type (from IP to array of IPs). There is a version comparison done but it's done down the execution, which now obviously is too late, so I'm moving this version comparison at the file reading stage.

rubbo898 commented 2 years ago

@frepke I'm still facing the issue with the latest commit. Deleting servers.json works anyway

qdm12 commented 2 years ago

Fixed in 1d25a0e18c15f2fed7f70a6a7ecb43e9fc48eda2 and (previously faulty) commit is re-added in a432de95a972a2c0a79476f940bb81df647d9930

So :latest should be fixed.

I also added a reference to the Docker image tags to the bug issue template, so if you are stuck with a broken :latest, you can use those whilst I fix it.