soxfor / qbittorrent-natmap

The objective of this container is to run a script that requests a port forward (via NAT-PMP) from the VPN provider and upon success changes the listening port of the qBittorrent client when running in Docker
149 stars 18 forks source link

[Bug?]Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running? Waiting for gluetun healthy state.. #21

Closed defconxt closed 9 months ago

defconxt commented 10 months ago

Hello,

I seem to be having an issue with my qbittorrent-natmap. If I login to the container itself it is erroring (for over 10k lines now in logs):

Cannot connect to the Docker daemon at unix:///var/run/docker.sock. Is the docker daemon running? 

Waiting for gluetun healthy state..

If I connect to gluetun, it appears it is all well there? No issues, I am connected.

2023-11-21T02:27:40-07:00 INFO [routing] default route found: interface eth0, gateway 172.21.0.1, assigned IP 172.21.0.11 and family v4
2023-11-21T02:27:40-07:00 INFO [routing] adding route for 0.0.0.0/0
2023-11-21T02:27:40-07:00 INFO [firewall] setting allowed subnets...
2023-11-21T02:27:40-07:00 INFO [routing] default route found: interface eth0, gateway 172.21.0.1, assigned IP 172.21.0.11 and family v4
2023-11-21T02:27:40-07:00 INFO [dns] using plaintext DNS at address 1.1.1.1
2023-11-21T02:27:40-07:00 INFO [http server] http server listening on [::]:8000
2023-11-21T02:27:40-07:00 INFO [firewall] allowing VPN connection...
2023-11-21T02:27:40-07:00 INFO [healthcheck] listening on 127.0.0.1:9999
2023-11-21T02:27:40-07:00 INFO [wireguard] Using available kernelspace implementation
2023-11-21T02:27:40-07:00 INFO [wireguard] Connecting to <VPN IP REDACTED>:51820
2023-11-21T02:27:40-07:00 INFO [wireguard] Wireguard setup is complete. Note Wireguard is a silent protocol and it may or may not work, without giving any error message. Typically i/o timeout errors indicate the Wireguard connection is not working.
2023-11-21T02:27:40-07:00 INFO [dns] downloading DNS over TLS cryptographic files
2023-11-21T02:27:41-07:00 INFO [dns] downloading hostnames and IP block lists
2023-11-21T02:27:41-07:00 INFO [healthcheck] healthy!
2023-11-21T02:27:44-07:00 INFO [dns] init module 0: validator
2023-11-21T02:27:44-07:00 INFO [dns] init module 1: iterator
2023-11-21T02:27:44-07:00 INFO [dns] start of service (unbound 1.17.1).
2023-11-21T02:27:44-07:00 INFO [dns] generate keytag query _ta-4a5c-4f66. NULL IN
2023-11-21T02:27:44-07:00 INFO [dns] generate keytag query _ta-4a5c-4f66. NULL IN
2023-11-21T02:27:44-07:00 INFO [dns] ready
2023-11-21T02:27:44-07:00 INFO [ip getter] Public IP address is <REDACTED>
2023-11-21T02:27:44-07:00 INFO [vpn] You are running 3 commits behind the most recent latest
2023-11-21T03:28:03-07:00 INFO [dns] generate keytag query _ta-4a5c-4f66. NULL IN
2023-11-21T04:44:24-07:00 INFO [dns] generate keytag query _ta-4a5c-4f66. NULL IN
2023-11-21T05:58:03-07:00 INFO [dns] generate keytag query _ta-4a5c-4f66. NULL IN
2023-11-21T07:40:58-07:00 INFO [dns] generate keytag query _ta-4a5c-4f66. NULL IN

Let's check QBITTORRENT:

------------------------------------------------------------
| Cleaning files in /themepark for any translation text... |
------------------------------------------------------------
[custom-init] No custom files found, skipping...
WebUI will be started shortly after internal preparations. Please wait...
Connection to localhost (127.0.0.1) 8080 port [tcp/http-alt] succeeded!
[ls.io-init] done.

Looks like we're all good there too.

Let's check my private tracker:

1.8 weeks to go qBittorrent/4.6.1   [PUBLIC VPN IP REDACTED]
1.8 weeks to go qBittorrent/4.6.1   [PUBLIC VPN IP REDACTED]

Yep, we're connected and properly seeding from Qbittorrent.

Docker compose YML file for the stack:

  gluetun:
      image: qmcgaw/gluetun
      container_name: gluetun
      cap_add:
        - NET_ADMIN
      devices:
        - /dev/net/tun:/dev/net/tun
      volumes:
        - /home/defcon/data/config/gluetun:/gluetun
      environment:
        - TZ=America/Denver
      # - FIREWALL_OUTBOUND_SUBNETS=10.10.60.0/24 #Do I need this? Is this my Docker local subnet, or my Ubuntu VM running the 
                                                                                           #stacks CIDR range?
        - VPN_SERVICE_PROVIDER=custom
        - VPN_TYPE=wireguard
        - VPN_ENDPOINT_IP=PUBLIC IP REDACTED
        - VPN_ENDPOINT_PORT=51820
      # - VPN_PORT_FORWARDING_PROVIDER=protonvpn
      # - VPN_PORT_FORWARDING=on
        - WIREGUARD_PUBLIC_KEY=REDACTED
        - WIREGUARD_PRIVATE_KEY=REDACTED
        - WIREGUARD_ADDRESSES=10.2.0.2/32
      ports:
        - 8080:8080 # Qbittorrent
        - 8888:8888/tcp # HTTP proxy
        - 8388:8388/tcp # Shadowsocks
        - 8388:8388/udp # Shadowsocks
        - 6881:6881/tcp #Qbit Torrent TCP
        - 6881:6881/udp #Qbit UDP
      # - 34803:34803/udp #From what I've read - is the port that proton wireguard will assign after deployment if using 
                                         #VPN_PORT_FORWARDING_PROVIDER=protonvpn settings
                                         #To confirm & see the port that proton Wireguard assigns, you can run: docker exec -it gluetun cat #/tmp/gluetun/forwarded_port
      networks:
        - media-network
      restart: unless-stopped
      logging:
        driver: json-file
        options:
          max-size: "10m"
          max-file: "5"

  qbittorrent:
    image: lscr.io/linuxserver/qbittorrent:latest
    container_name: qbittorrent
    ## Do Not Change Network for qBittorrent
    ## qBittorrent MUST always use a VPN.
    network_mode: "service:gluetun"
    environment:
      - PUID=1000
      - PGID=1000
      - TZ=America/Denver
      - WEBUI_PORT=8080
      - DOCKER_MODS=ghcr.io/gilbn/theme.park:qbittorrent
      - TP_THEME=overseerr
    volumes:
      - /etc/localtime:/etc/localtime:ro
      - /home/defcon/data/config/qbittorrent:/config
      - /home/defcon/data/torrents:/data/torrents
    depends_on:
      gluetun:
       condition: service_healthy
    restart: unless-stopped
    logging:
      driver: json-file
      options:
        max-size: "10m"
        max-file: "5"

  qbittorrent-natmap:
    image: ghcr.io/soxfor/qbittorrent-natmap:latest
    environment:
      - TZ=America/Denver
      - QBITTORRENT_SERVER=10.2.0.2
      - VPN_GATEWAY=10.2.0.1
      - QBITTORRENT_PORT=8080
      - QBITTORRENT_USER=REDACTED
      - QBITTORRENT_PASS=REDACTED
    container_name: qbittorrent-natmap
    restart: unless-stopped
    volumes:
      - /var/rundocker.sock:/var/run/docker.sock:ro
    network_mode: "service:gluetun"
    depends_on:
      gluetun:
        condition: service_healthy
      qbittorrent:
        condition: service_started
    logging:
      driver: json-file
      options:
        max-size: "10m"
        max-file: "5"

The things with # in front are currently not in used and stuff I was thinking about modifying / trying out if I couldn't get qbitmap natmap to work or stop erroring. Although it seems to be working, not sure what the spam is about the container not being healthy as it is currently healthy in the portainer dashboard and no issues.