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.69k stars 359 forks source link

Bug: Control Server unreachable. "unversioned API: requested URI not found" #2031

Closed erphise closed 9 months ago

erphise commented 9 months ago

Is this urgent?

No

Host OS

Unraid OS 6.12.4

CPU arch

x86_64

VPN service provider

ProtonVPN

What are you using to run the container

docker-compose

What is the version of Gluetun

Running version latest built on 2024-01-01T18:24:19.221Z (commit c826707)

What's the problem 🤔

Unable to access Control Server on http://<your-docker-host-ip>:8000. Error: unversioned API: requested URI not found

Share your logs (at least 10 lines)

On the WebGUI:
"unversioned API: requested URI not found"

Share your configuration

version: "3"
services:
  gluetun:
    image: qmcgaw/gluetun:latest
    container_name: gluetun
    network_mode: bridge
    cap_add:
      - NET_ADMIN
    devices:
      - /dev/net/tun:/dev/net/tun
    ports:
      - 8888:8888/tcp # HTTP proxy
      - 8388:8388/tcp # Shadowsocks
      - 8388:8388/udp # Shadowsocks
      - 8080:8080/tcp # qBittorrent
    volumes:
      - /mnt/user/appdata/gluetun/config:/gluetun
    environment:
      - VPN_SERVICE_PROVIDER=custom
      - VPN_TYPE=wireguard
      - WIREGUARD_PUBLIC_KEY=XXXXXXXX
      - WIREGUARD_PRIVATE_KEY=XXXXXXXX
      - WIREGUARD_ADDRESSES=XXXXXXXX
      - VPN_ENDPOINT_IP=XXXXXXXX
      - VPN_ENDPOINT_PORT=XXXXXXXX
      - VPN_DNS_ADDRESS=XXXXXXXX
      - VPN_PORT_FORWARDING=on
      - VPN_PORT_FORWARDING_PROVIDER=protonvpn
      - TZ=Europe/Madrid
      - HTTPPROXY=off
      - SHADOWSOCKS=off
      - UPDATER_PERIOD=24h
    restart: unless-stopped
bnhf commented 9 months ago

@erphise

You haven't opened port 8000 in your list of ports:

    ports:
      - 8888:8888/tcp # HTTP proxy
      - 8388:8388/tcp # Shadowsocks
      - 8388:8388/udp # Shadowsocks
      - 8080:8080/tcp # qBittorrent

Also, if you're using Portainer for your docker-compose, you'll probably want to map port 8000 to something else, since Portainer typically uses 8000.

Mine looks like this:

    ports:
      - 8100:8000 # Remote Control VPN
erphise commented 9 months ago

I just did exactly that and still same issue. Nothing changed 😕 Not using Portainer btw.

bnhf commented 9 months ago

@erphise

I just did exactly that and still same issue. Nothing changed 😕

What does docker ps show? If the port isn't mapped, you have a conflict elsewhere. Here's mine -- and I just tried a GET to confirm it's working:

screenshot-nuc10-ct-2024 01 03-03_31_39

And are you doing an actual GET and not just the partial you posted above? Something like:

http://server:8000/v1/dns/status

As described here:

https://github.com/qdm12/gluetun-wiki/blob/main/setup/advanced/control-server.md

bnhf commented 9 months ago

@erphise

Not making an actual API call would result in an error like you're seeing. You can't just use http://server:8000. The control server is described in the Wiki -- as linked to above.

erphise commented 9 months ago

Sorry for my ignorance, but I am not sure how to do this 😅 I guess I have to go to the command line on unraid and then type docker ps?

frepke commented 9 months ago

Sorry for my ignorance, but I am not sure how to do this 😅 I guess I have to go to the command line on unraid and then type docker ps?

That's right.

bnhf commented 9 months ago

@erphise

I guess I have to go to the command line on unraid and then type docker ps?

Yes, although Unraid may have some way to see if ports are actually being mapped in their container WebUI too.

erphise commented 9 months ago

Sorry I could not respond sooner. This is what pops up on docker ps: imagen Also, when I do that GET thing, it shows: {"status":"running"}

bnhf commented 9 months ago

@erphise

Also, when I do that GET thing, it shows: {\"status\":\"running\"}

That's the correct response -- so it's working as designed.

erphise commented 9 months ago

Then I don't understand why I can not see anything when going to the webGUI.

bnhf commented 9 months ago

@erphise

Then I don't understand why I can not see anything when going to the webGUI.

Gluetun doesn't have a WebUI.

erphise commented 9 months ago

Well, I know, I was refering to the Control Server. The place where I am supposed to see the forwarded port that was assigned to me. I just want that.

bnhf commented 9 months ago

@erphise

Well, I know, I was refering to the Control Server. The place where I am supposed to see the forwarded port that was assigned to me. I just want that.

The control sever is just a basic API that does what's defined in the Wiki I linked to you earlier. You can get the public IP assigned to you -- if that's what you're after.

If you're looking for a randomly forwarded port that's assigned to you by a VPN provider -- that's a more involved topic, and is specific to your VPN provider. There are other issues and discussions around port forwarding, and you should search for one regarding your specific provider. And, of course, before all else, check the Wiki to see if there's any guidance available for your VPN provider.

erphise commented 9 months ago

I am aware of all of that, and I already did that. As I stated on this issue, my provider is ProtonVPN. GlueTUN says in their wiki how to properly set it up with custom providers, and also says that you then can check the port on the Control Server. Here says:

You can enable it with VPN_PORT_FORWARDING=on. The forwarded port can be accessed: through the control server through the file written at /tmp/gluetun/forwarded_port (will be deprecated in v4.0.0 release)

I did all of that. Followed all the wiki properly and all the steps. So I am here asking for help on how I can access the Control Server to know that forwarded port. (Since the other option is no longer available).

bnhf commented 9 months ago

@erphise

Followed all the wiki properly and all the steps. So I am here asking for help on how I can access the Control Server to know that forwarded port.

So, we fixed access to the Control Server, since you didn't have port 8000 set up. And, the control server is responding, which you proved using the GET earlier.

Have you tried querying the Control Server at the endpoint described in the Wiki?

screenshot-github com-2024 01 03-11_12_11

As in: http://<your-docker-host-ip>:8000/v1/openvpn/portforwarded

erphise commented 9 months ago

God it had to be that simple. Sorry I bothered you all for this, and thank you so much for your patience. I have 0 knowledge on programming and wasn't intuitive for me that I had to do that.