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
8.04k stars 371 forks source link

Gluetun doesn't work. "panic: runtime error: index out of range [0] with length 0" #2250

Closed abu-marwa closed 6 months ago

abu-marwa commented 6 months ago

Today I've started encountering an issue with gluetun. Qbittorrent that uses gluetun as a docker network won't load.

Please see the logs below:

========================================
========================================
=============== gluetun ================
========================================
=========== Made with ❤️ by ============
======= https://github.com/qdm12 =======
========================================
========================================
Running version latest built on 2024-04-30T08:08:30.634Z (commit 7e0738d)
🔧 Need help? https://github.com/qdm12/gluetun/discussions/new
🐛 Bug? https://github.com/qdm12/gluetun/issues/new
✨ New feature? https://github.com/qdm12/gluetun/issues/new
☕ Discussion? https://github.com/qdm12/gluetun/discussions/new
💻 Email? quentin.mcgaw@gmail.com
💰 Help me? https://www.paypal.me/qmcgaw https://github.com/sponsors/qdm12
2024-05-01T01:48:53Z INFO [routing] default route found: interface eth0, gateway 172.28.0.1, assigned IP 172.28.0.13 and family v4
2024-05-01T01:48:53Z INFO [routing] local ethernet link found: eth0
2024-05-01T01:48:53Z INFO [routing] local ipnet found: 172.28.0.0/27
2024-05-01T01:48:53Z INFO [firewall] enabling...
2024-05-01T01:48:53Z INFO [firewall] enabled successfully
2024-05-01T01:48:54Z INFO [storage] merging by most recent 19425 hardcoded servers and 19425 servers read from /gluetun/servers.json
2024-05-01T01:48:54Z INFO Alpine version: 3.18.6
2024-05-01T01:48:54Z INFO OpenVPN 2.5 version: 2.5.8
2024-05-01T01:48:54Z INFO OpenVPN 2.6 version: 2.6.8
2024-05-01T01:48:54Z INFO Unbound version: 1.19.3
2024-05-01T01:48:54Z INFO IPtables version: v1.8.9
2024-05-01T01:48:54Z INFO Settings summary:
├── VPN settings:
|   ├── VPN provider settings:
|   |   ├── Name: custom
|   |   ├── Server selection settings:
|   |   |   ├── VPN type: wireguard
|   |   |   ├── Target IP address: [Redacted]
|   |   |   └── Wireguard selection settings:
|   |   |       ├── Endpoint IP address: [Redacted]
|   |   |       ├── Endpoint port: [Redacted]
|   |   |       └── Server public key: [Redacted]
|   |   └── Automatic port forwarding settings:
|   |       ├── Redirection listening port: disabled
|   |       ├── Use code for provider: protonvpn
|   |       └── Forwarded port file path: /tmp/gluetun/forwarded_port
|   └── Wireguard settings:
|       ├── Private key: [Redacted]
|       ├── Interface addresses:
|       |   └── 10.2.0.2/32
|       ├── Allowed IPs:
|       |   ├── 0.0.0.0/0
|       |   └── ::/0
|       └── Network interface: tun0
|           └── MTU: 1400
├── DNS settings:
|   ├── Keep existing nameserver(s): no
|   ├── DNS server address to use: 127.0.0.1
|   └── DNS over TLS settings:
|       ├── Enabled: yes
|       ├── Update period: every 24h0m0s
|       ├── Unbound settings:
|       |   ├── Authoritative servers:
|       |   |   └── cloudflare
|       |   ├── Caching: yes
|       |   ├── IPv6: no
|       |   ├── Verbosity level: 1
|       |   ├── Verbosity details level: 0
|       |   ├── Validation log level: 0
|       |   ├── System user: root
|       |   └── Allowed networks:
|       |       ├── 0.0.0.0/0
|       |       └── ::/0
|       └── DNS filtering settings:
|           ├── Block malicious: yes
|           ├── Block ads: no
|           ├── Block surveillance: no
|           └── Blocked IP networks:
|               ├── 127.0.0.1/8
|               ├── 10.0.0.0/8
|               ├── 172.16.0.0/12
|               ├── 192.168.0.0/16
|               ├── 169.254.0.0/16
|               ├── ::1/128
|               ├── fc00::/7
|               ├── fe80::/10
|               ├── ::ffff:127.0.0.1/104
|               ├── ::ffff:10.0.0.0/104
|               ├── ::ffff:169.254.0.0/112
|               ├── ::ffff:172.16.0.0/108
|               └── ::ffff:192.168.0.0/112
├── Firewall settings:
|   └── Enabled: yes
├── Log settings:
|   └── Log level: info
├── Health settings:
|   ├── Server listening address: 127.0.0.1:9999
|   ├── Target address: cloudflare.com:443
|   ├── Duration to wait after success: 5s
|   ├── Read header timeout: 100ms
|   ├── Read timeout: 500ms
|   └── VPN wait durations:
|       ├── Initial duration: 6s
|       └── Additional duration: 5s
├── Shadowsocks server settings:
|   └── Enabled: no
├── HTTP proxy settings:
|   └── Enabled: no
├── Control server settings:
|   ├── Listening address: :8000
|   └── Logging: yes
├── OS Alpine settings:
|   ├── Process UID: 1000
|   └── Process GID: 1000
├── Public IP settings:
|   ├── Fetching: every 12h0m0s
|   ├── IP file path: /tmp/gluetun/ip
|   └── Public IP data API: ipinfo
└── Version settings:
    └── Enabled: yes
2024-05-01T01:48:54Z INFO [routing] default route found: interface eth0, gateway 172.28.0.1, assigned IP 172.28.0.13 and family v4
2024-05-01T01:48:54Z INFO [routing] adding route for 0.0.0.0/0
2024-05-01T01:48:54Z INFO [firewall] setting allowed subnets...
2024-05-01T01:48:54Z INFO [routing] default route found: interface eth0, gateway 172.28.0.1, assigned IP 172.28.0.13 and family v4
2024-05-01T01:48:54Z INFO TUN device is not available: open /dev/net/tun: no such file or directory; creating it...
2024-05-01T01:48:54Z INFO [dns] using plaintext DNS at address 1.1.1.1
2024-05-01T01:48:54Z INFO [http server] http server listening on [::]:8000
2024-05-01T01:48:54Z INFO [healthcheck] listening on 127.0.0.1:9999
panic: runtime error: index out of range [0] with length 0
goroutine 88 [running]:
github.com/qdm12/gluetun/internal/provider/custom.getWireguardConnection(...)
    github.com/qdm12/gluetun/internal/provider/custom/connection.go:60
github.com/qdm12/gluetun/internal/provider/custom.(*Provider).GetConnection(_, {{0xc000028021, 0x9}, {{0x0, 0xffffa996cc21}, 0xc0000b4000}, {0x0, 0x0, 0x0}, {0x0, ...}, ...}, ...)
    github.com/qdm12/gluetun/internal/provider/custom/connection.go:24 +0x35a
github.com/qdm12/gluetun/internal/vpn.setupWireguard({_, _}, {_, _}, {_, _}, {_, _}, {{0xc000028021, 0x9}, ...}, ...)
    github.com/qdm12/gluetun/internal/vpn/wireguard.go:20 +0xbe
github.com/qdm12/gluetun/internal/vpn.(*Loop).Run(0xc00012af20, {0x12260e0, 0xc0003feeb0}, 0xc0000a8fc0?)
    github.com/qdm12/gluetun/internal/vpn/run.go:40 +0x4df
created by main._main in goroutine 22
    ./main.go:443 +0x33d7

I noticed that there was a commit dated today, so that might've affected my gluetun.

I run the latest version of docker on the latest version of Debian.

Please let me know if you need any other info from me.

github-actions[bot] commented 6 months ago

@qdm12 is more or less the only maintainer of this project and works on it in his free time. Please:

s3rverro0m commented 6 months ago

This is a duplicate of https://github.com/qdm12/gluetun/issues/2244

dennisvanderpool commented 6 months ago

Count me in as well. I just pulled in latest version and now it's failing, worked fine with the version of 3 weeks ago.

qmcgaw/gluetun                     latest          a30667e1bbb8   24 hours ago    44.8MB => FAILING
qmcgaw/gluetun                     <none>          a9936f298323   3 weeks ago     39.7MB => OK

panic: runtime error: index out of range [0] with length 0

goroutine 102 [running]:
github.com/qdm12/gluetun/internal/provider/custom.getWireguardConnection(...)
        github.com/qdm12/gluetun/internal/provider/custom/connection.go:60
github.com/qdm12/gluetun/internal/provider/custom.(*Provider).GetConnection(_, {{0xc000028021, 0x9}, {{0x0, 0xffffb990530d}, 0xc000010018}, {0x0, 0x0, 0x0}, {0x0, ...}, ...}, ...)
        github.com/qdm12/gluetun/internal/provider/custom/connection.go:24 +0x35a
github.com/qdm12/gluetun/internal/vpn.setupWireguard({_, _}, {_, _}, {_, _}, {_, _}, {{0xc000028021, 0x9}, ...}, ...)
        github.com/qdm12/gluetun/internal/vpn/wireguard.go:20 +0xbe
github.com/qdm12/gluetun/internal/vpn.(*Loop).Run(0xc000204b00, {0x12260e0, 0xc000202aa0}, 0xc00021ecc0?)
        github.com/qdm12/gluetun/internal/vpn/run.go:40 +0x4df
created by main._main in goroutine 50
        ./main.go:443 +0x33d7

I've now added tag on the working one and referring to that one in docker-compose so I temporary stick with the working version from 3 weeks ago until fixed. If there is a way I can help out in another way please let me know.

$ sudo docker tag a9936f298323 qmcgaw/gluetun:working
$ sudo docker images | grep gluetun
qmcgaw/gluetun                     latest          a30667e1bbb8   24 hours ago    44.8MB
qmcgaw/gluetun                     working         a9936f298323   3 weeks ago     39.7MB

$ cat docker-compose.yml 
services:
  gluetun:
    image: qmcgaw/gluetun:working
qdm12 commented 6 months ago

Fixed just a few minutes ago 😉 Sorry about that!

github-actions[bot] commented 6 months ago

Closed issues are NOT monitored, so commenting here is likely to be not seen. If you think this is still unresolved and have more information to bring, please create another issue.

This is an automated comment setup because @qdm12 is the sole maintainer of this project which became too popular to monitor issues closed.

abu-marwa commented 6 months ago

Thank you so much @qdm12 ! There is nothing to be sorry about. As a community, we are grateful to you for this outstanding awesome product and continued support!