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.11k stars 374 forks source link

Bug: Docker container exit code 2 immediately on run #2163

Closed eurotransient closed 8 months ago

eurotransient commented 8 months ago

Is this urgent?

None

Host OS

Ubuntu 22.04.4 LTS

CPU arch

x86_64

VPN service provider

AirVPN

What are you using to run the container

docker-compose

What is the version of Gluetun

Running version latest built on 2024-03-18T17:49:37.003Z (commit 3d16798)

What's the problem 🤔

Gluetun container exits immediately on run with an exit code 2.

Share your logs (at least 10 lines)

2024-03-18T13:55:49-04:00 INFO [http server] http server listening on [::]:8000
2024-03-18T13:55:49-04:00 INFO [healthcheck] listening on 127.0.0.1:9999
panic: runtime error: invalid memory address or nil pointer dereference
[signal SIGSEGV: segmentation violation code=0x1 addr=0x0 pc=0x78e831]
goroutine 107 [running]:
github.com/qdm12/gluetun/internal/storage.filterServer({{0xc001e9fdd0, 0x9}, {0xc001e9faa8, 0x7}, {0xc001e9fed0, 0x6}, {0xc001e9fed6, 0x6}, {0x0, 0x0}, ...}, ...)
    github.com/qdm12/gluetun/internal/storage/filter.go:77 +0x1b1
github.com/qdm12/gluetun/internal/storage.(*Storage).FilterServers(_, {_, _}, {{0xc00002a039, 0x9}, {{0x0, 0xffff00000000}, 0xc0000a4000}, {0xc001131310, 0x1, ...}, ...})
    github.com/qdm12/gluetun/internal/storage/filter.go:33 +0x2fb
github.com/qdm12/gluetun/internal/provider/utils.GetConnection({_, _}, {_, _}, {{0xc00002a039, 0x9}, {{0x0, 0xffff00000000}, 0xc0000a4000}, {0xc001131310, ...}, ...}, ...)
    github.com/qdm12/gluetun/internal/provider/utils/connection.go:39 +0xad
github.com/qdm12/gluetun/internal/provider/airvpn.(*Provider).GetConnection(_, {{0xc00002a039, 0x9}, {{0x0, 0xffff00000000}, 0xc0000a4000}, {0xc001131310, 0x1, 0x1}, {0x0, ...}, ...}, ...)
    github.com/qdm12/gluetun/internal/provider/airvpn/connection.go:12 +0x105
github.com/qdm12/gluetun/internal/vpn.setupWireguard({_, _}, {_, _}, {_, _}, {_, _}, {{0xc00002a039, 0x9}, ...}, ...)
    github.com/qdm12/gluetun/internal/vpn/wireguard.go:20 +0xbe
github.com/qdm12/gluetun/internal/vpn.(*Loop).Run(0xc0000fcf20, {0x109d840, 0xc0004caeb0}, 0xc00008ce40?)
    github.com/qdm12/gluetun/internal/vpn/run.go:40 +0x4f5
created by main._main in goroutine 35
    ./main.go:427 +0x385a

Share your configuration

gluetun:
    image: qmcgaw/gluetun
    container_name: gluetun
    cap_add:
      - NET_ADMIN
    devices:
      - /dev/net/tun:/dev/net/tun
    ports:
      - ####:####
    volumes:
      - ./gluetun:/gluetun
    environment:
      - VPN_SERVICE_PROVIDER=airvpn
      - VPN_TYPE=wireguard
      - WIREGUARD_PRIVATE_KEY=##################################
      - WIREGUARD_PRESHARED_KEY=#################################
      - WIREGUARD_ADDRESSES=###############################
      - FIREWALL_VPN_INPUT_PORTS=######
      - TZ=America/New_York
      - UPDATER_PERIOD=24h
      - SERVER_COUNTRIES=##############
drynish commented 8 months ago

Same here

therealshiggins commented 8 months ago

Same here. Switchting to v3 tag instead of latest works

Cleanup-Crew-From-Discord commented 8 months ago

same here. change from "latest" to "v3" for now, it worked for me. hope this gets fixed soon

Bierdusche commented 8 months ago

Same here. back to qmcgaw/gluetun:v3.37

dangerouslaser commented 8 months ago

same issue. rolling back to qmcgaw/gluetun:v3.37 for now.

Saudumm commented 8 months ago

Same issue here, just rolled back to 3.37

awal1987 commented 8 months ago

rolled back to fix. thanks!

anyac1 commented 8 months ago

Same here, thank you @therealshiggins for an ez fix. had me shitting bricks since gluetun took a while for me to configure the first time and I was dreading thinking I did something wrong and never considered the obvious.

Marcosaurios commented 8 months ago

Found the same issue with an AirVPN configuration. This could be related https://github.com/qdm12/gluetun/pull/2070 as it fails exactly on this new line https://github.com/qdm12/gluetun/pull/2070/commits/af7d0673360ffbedd66bc533510601ae48e7caf4#diff-1dd30df9dc7711ac1d0340055f8090f2d0ee6818063dcb864db441707e305ed2R77

Back in previous docker image all works fine

qdm12 commented 8 months ago

🏳️ sorry everybody, bad PR, bad PR review, notifications turned off, sorry for the tunnel-interruption! 🏳️

This is fixed with 62158a17399ddbae68ad2e90ec11c8cf12439c1f

(@Marcosaurios right on point thanks!)

github-actions[bot] commented 8 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.

C0NN0RAD0 commented 2 months ago

im having the same issue? Exits immediately on run, have to go in and re-configure each container to use the gluetun container network.

Marcosaurios commented 2 months ago

@C0NN0RAD0 are you running the latest docker image? Have you checked your vpn configuration files are correct inside the docker container?

Maybe with some extra information (docker logs) we can help you better. But this issue was resolved, the container could be closing bc any other reason.