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.

Home Page:https://hub.docker.com/r/qmcgaw/gluetun

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

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

abu-marwa opened this issue Β· comments

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.

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

This is a duplicate of #2244

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

Fixed just a few minutes ago πŸ˜‰ Sorry about that!

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.

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!