Install on docker with ipv6 only

Describe the issue/error/question

I’m migrating a docker from a server where there was an ipv4 to a new one that only has an ipv6 (no ipv4) with NAT64 DNS.

Docker runs without problem, the networks are up too. The ipv6 is well forwarded to the host.

The problem is that n8n sends a request and the remote server returns an ipv4 (example in a node in http (the server is in ipv6 only but with a Cloudflare proxy which offers him an ipv4 automatically) get :

{"status":"rejected","reason":{"message":"connect ENETUNREACH 172.67.209.10:443","name":"Error","stack":"Error: connect ENETUNREACH 172.67.209.10:443\n at TCPConnectWrap.afterConnect [as oncomplete] (node:net:1278:16)","code":"ENETUNREACH"}}

A simple get on an http request on an IPV6 directly works.

Docker Version :
Docker version 20.10.22, build 3a2c30b
Docker Compose version v2.14.1

Docker-compose yml :

version: "3"

services:
  traefik:
    image: "traefik"
    restart: always
    network_mode: "bridge"
    command:
      - "--api=true"
      - "--api.insecure=true"
      - "--providers.docker=true"
      - "--providers.docker.exposedbydefault=false"
      - "--entrypoints.websecure.address=:443"
      - "--certificatesresolvers.mytlschallenge.acme.tlschallenge=true"
      - "--certificatesresolvers.mytlschallenge.acme.email=${SSL_EMAIL}"
      - "--certificatesresolvers.mytlschallenge.acme.storage=/letsencrypt/acme.json"
    ports:
      - "443:443"
    volumes:
      - ${DATA_FOLDER}/letsencrypt:/letsencrypt
      - /var/run/docker.sock:/var/run/docker.sock:ro

  n8n:
    image: n8nio/n8n
    restart: always
    network_mode: "bridge"
    ports:
      - "5678:5678"
    labels:
      - traefik.enable=true
      - traefik.http.routers.n8n.rule=Host(`${SUBDOMAIN}.${DOMAIN_NAME}`)
      - traefik.http.routers.n8n.tls=true
      - traefik.http.routers.n8n.entrypoints=websecure
      - traefik.http.routers.n8n.tls.certresolver=mytlschallenge
      - traefik.http.middlewares.n8n.headers.SSLRedirect=true
      - traefik.http.middlewares.n8n.headers.STSSeconds=315360000
      - traefik.http.middlewares.n8n.headers.browserXSSFilter=true
      - traefik.http.middlewares.n8n.headers.contentTypeNosniff=true
      - traefik.http.middlewares.n8n.headers.forceSTSHeader=true
      - traefik.http.middlewares.n8n.headers.SSLHost=${DOMAIN_NAME}
      - traefik.http.middlewares.n8n.headers.STSIncludeSubdomains=true
      - traefik.http.middlewares.n8n.headers.STSPreload=true
    environment:
      - N8N_BASIC_AUTH_ACTIVE=true
      - N8N_BASIC_AUTH_USER
      - N8N_BASIC_AUTH_PASSWORD
      - N8N_HOST=${SUBDOMAIN}.${DOMAIN_NAME}
      - N8N_PORT=5678
      - N8N_PROTOCOL=https
      - NODE_ENV=production
      - WEBHOOK_TUNNEL_URL=https://${SUBDOMAIN}.${DOMAIN_NAME}/
      - GENERIC_TIMEZONE=${GENERIC_TIMEZONE}
      - DB_SQLITE_VACUUM_ON_STARTUP=true
      - EXECUTIONS_DATA_SAVE_ON_ERROR=all
      - EXECUTIONS_DATA_SAVE_ON_SUCCESS=none
      - EXECUTIONS_DATA_SAVE_ON_PROGRESS=true
      - EXECUTIONS_DATA_SAVE_MANUAL_EXECUTIONS=false
      - EXECUTIONS_DATA_PRUNE=true
      - EXECUTIONS_DATA_MAX_AGE=90
    volumes:
      - /home/data/n8n/.n8n:/home/node/.n8n

Docker network

    {
        "Name": "bridge",
        "Id": "48b10b81b6895db57c9a6c39aeb1c27147ab08a99d85400cbecb8f0ef0273603",
        "Created": "2022-12-27T09:29:39.880654899+01:00",
        "Scope": "local",
        "Driver": "bridge",
        "EnableIPv6": true,
        "IPAM": {
            "Driver": "default",
            "Options": null,
            "Config": [
                {
                    "Subnet": "172.17.0.0/16",
                    "Gateway": "172.17.0.1"
                },
                {
                    "Subnet": "2001:db8:1::/64",
                    "Gateway": "2001:db8:1::1"
                }
            ]
        },
        "Internal": false,
        "Attachable": false,
        "Ingress": false,
        "ConfigFrom": {
            "Network": ""
        },
        "ConfigOnly": false,
        "Containers": {
            "eee0dc09b950c2605ee7a583d6448c34d2d09ee6e8d0076411a61733fb282d6b": {
                "Name": "n8n_traefik_1",
                "EndpointID": "29d3308090b0e8b7da98cf9fefaa057c1f71bf45c18df006b1b80cefae1193e8",
                "MacAddress": "02:42:ac:11:00:02",
                "IPv4Address": "172.17.0.2/16",
                "IPv6Address": "2001:db8:1::242:ac11:2/64"
            },
            "fab2e698b4ba89f74a9d8e700a6c357e502f6160bb5c2d12f750dfce4a1573dd": {
                "Name": "n8n_n8n_1",
                "EndpointID": "dcccbb8d6b5216d90ba525e11dc09a59ee71453a49803ed052c7525d6b69c58e",
                "MacAddress": "02:42:ac:11:00:03",
                "IPv4Address": "172.17.0.3/16",
                "IPv6Address": "2001:db8:1::242:ac11:3/64"
            }
        },
        "Options": {
            "com.docker.network.bridge.default_bridge": "true",
            "com.docker.network.bridge.enable_icc": "true",
            "com.docker.network.bridge.enable_ip_masquerade": "true",
            "com.docker.network.bridge.host_binding_ipv4": "0.0.0.0",
            "com.docker.network.bridge.name": "docker0",
            "com.docker.network.driver.mtu": "1500"
        },
        "Labels": {}
    }

Information on your n8n setup

  • n8n version: 0.209.2
  • Database you’re using (default: SQLite): SQLite
  • Running n8n via [Docker, npm, n8n.cloud, desktop app]: Docker

If you have an idea, I’m interested!

Thanks for your help n8n community!

Edit: I am not sure I’ve fully understood this - are you saying you are getting an error message because your DNS setup would provide IPv4 addresses for certain HTTP Requests? I am not sure this is something n8n would be able to handle influence. Are you able to send curl requests to the URL causing the problem for you from inside your n8n docker container? I am just trying to understand what exactly is causing the problem here

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.