docker / compose

Define and run multi-container applications with Docker
https://docs.docker.com/compose/
Apache License 2.0
33.73k stars 5.19k forks source link

docker networking hellp #7376

Closed ghost closed 4 years ago

ghost commented 4 years ago

ran compose, it's breaking down on create network and the reason for which it is supposedly breaking down seems wrong because the request it sends simply returns a 404, nothing to indicate that it's unable to create network:

docker-compose --verbose up -d
compose.config.config.find: Using configuration files: ./docker-compose.yml
docker.utils.config.find_config_file: Trying paths: ['/home/toor/.docker/config.json', '/home/toor/.dockercfg']
docker.utils.config.find_config_file: No config file found
docker.utils.config.find_config_file: Trying paths: ['/home/toor/.docker/config.json', '/home/toor/.dockercfg']
docker.utils.config.find_config_file: No config file found
docker.utils.config.find_config_file: Trying paths: ['/home/toor/.docker/config.json', '/home/toor/.dockercfg']
docker.utils.config.find_config_file: No config file found
urllib3.connectionpool._make_request: http://localhost:None "GET /v1.25/version HTTP/1.1" 200 857
compose.cli.docker_client.get_client: docker-compose version 1.26.0dev, build unknown
docker-py version: 4.2.0
CPython version: 2.7.17
OpenSSL version: OpenSSL 1.1.1d  10 Sep 2019
compose.cli.docker_client.get_client: Docker base_url: http+docker://localhost
compose.cli.docker_client.get_client: Docker version: KernelVersion=5.3.18-lp152.10-default, Components=[{u'Version': u'19.03.5', u'Name': u'Engine', u'Details': {u'KernelVersion': u'5.3.18-lp152.10-default', u'Os': u'linux', u'BuildTime': u'2019-12-12T12:00:00.000000000+00:00', u'ApiVersion': u'1.40', u'MinAPIVersion': u'1.12', u'GitCommit': u'633a0ea838f1', u'Arch': u'amd64', u'Experimental': u'false', u'GoVersion': u'go1.12.12'}}, {u'Version': u'v1.2.10', u'Name': u'containerd', u'Details': {u'GitCommit': u'b34a5c8af56e510852c35414db4c1f4fa6172339'}}, {u'Version': u'1.0.0-rc8+dev', u'Name': u'runc', u'Details': {u'GitCommit': u'3e425f80a8c931f88e6d94a8c831b9d5aa481657'}}, {u'Version': u'0.1.3_catatonit', u'Name': u'docker-init', u'Details': {u'GitCommit': u''}}], Arch=amd64, BuildTime=2019-12-12T12:00:00.000000000+00:00, ApiVersion=1.40, Platform={u'Name': u''}, Version=19.03.5, MinAPIVersion=1.12, GitCommit=633a0ea838f1, Os=linux, GoVersion=go1.12.12
compose.cli.verbose_proxy.proxy_callable: docker inspect_network <- (u'mongodb_my-network-name')
urllib3.connectionpool._make_request: http://localhost:None "GET /v1.25/networks/mongodb_my-network-name HTTP/1.1" 404 56
compose.cli.verbose_proxy.proxy_callable: docker info <- ()
urllib3.connectionpool._make_request: http://localhost:None "GET /v1.25/info HTTP/1.1" 200 None
compose.cli.verbose_proxy.proxy_callable: docker info -> {u'Architecture': u'x86_64',
 u'BridgeNfIp6tables': True,
 u'BridgeNfIptables': True,
 u'CPUSet': True,
 u'CPUShares': True,
 u'CgroupDriver': u'cgroupfs',
 u'ClusterAdvertise': u'',
 u'ClusterStore': u'',
 u'ContainerdCommit': {u'Expected': u'b34a5c8af56e510852c35414db4c1f4fa6172339',
                       u'ID': u'b34a5c8af56e510852c35414db4c1f4fa6172339'},
...
compose.cli.verbose_proxy.proxy_callable: docker inspect_network <- (u'mongodb_my-network-name')
urllib3.connectionpool._make_request: http://localhost:None "GET /v1.25/networks/mongodb_my-network-name HTTP/1.1" 404 56
compose.network.ensure: Creating network "mongodb_my-network-name" with the default driver
compose.cli.verbose_proxy.proxy_callable: docker create_network <- (name=u'mongodb_my-network-name', enable_ipv6=None, ipam=None, labels={u'com.docker.compose.version': u'1.26.0dev', u'com.docker.compose.project': u'mongodb', u'com.docker.compose.network': 'my-network-name'}, driver=None, check_duplicate=True, options=None, internal=None, attachable=True)
urllib3.connectionpool._make_request: http://localhost:None "POST /v1.25/networks/create HTTP/1.1" 404 121
ERROR: compose.cli.errors.log_api_error: could not find an available, non-overlapping IPv4 address pool among the defaults to assign to the network

this should work, if this isn't permissive enough what is

DOCKER_OPTS="--storage-driver btrfs --bip=172.16.0.1/16 --default-address-pool base=172.16.0.0/12,size=24"
27: docker0: <BROADCAST,MULTICAST,UP,LOWER_UP> mtu 1500 qdisc noqueue state UNKNOWN group default qlen 1000
    link/ether f6:43:47:31:ed:8c brd ff:ff:ff:ff:ff:ff
    inet 172.16.0.1/16 brd 172.16.255.255 scope global docker0
       valid_lft forever preferred_lft forever
    inet6 fe80::f443:47ff:fe31:ed8c/64 scope link 
       valid_lft forever preferred_lft forever

I really can't relate to that error it seems there should be pleeeenty of networks avail:

docker network ls
NETWORK ID          NAME                DRIVER              SCOPE
81187b228ddd        bridge              bridge              local
44b56f9b43bd        host                host                local
4ff25745d221        none                null                local
❯ docker network inspect 81
[
    {
        "Name": "bridge",
        "Id": "81187b228ddd15cbc6652190efab6b056294553bbaa5f60c47b9dff244fc9ca6",
        "Created": "2020-04-16T17:39:43.554401355Z",
        "Scope": "local",
        "Driver": "bridge",
        "EnableIPv6": false,
        "IPAM": {
            "Driver": "default",
            "Options": null,
            "Config": [
                {
                    "Subnet": "172.16.0.0/16",
                    "Gateway": "172.16.0.1"
                }
            ]
        },
        "Internal": false,
        "Attachable": false,
        "Ingress": false,
        "ConfigFrom": {
            "Network": ""
        },
        "ConfigOnly": false,
        "Containers": {},
        "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": {}
    }
]
ghost commented 4 years ago
❯ docker-compose up
WARNING: The SESSION_NAME variable is not set. Defaulting to a blank string.
WARNING: The SERVER_MAP variable is not set. Defaulting to a blank string.
WARNING: The SERVER_PASSWORD variable is not set. Defaulting to a blank string.
WARNING: The ADMIN_PASSWORD variable is not set. Defaulting to a blank string.
WARNING: The MAX_PLAYERS variable is not set. Defaulting to a blank string.
WARNING: The UPDATE_ON_START variable is not set. Defaulting to a blank string.
WARNING: The BACKUP_ON_STOP variable is not set. Defaulting to a blank string.
WARNING: The PRE_UPDATE_BACKUP variable is not set. Defaulting to a blank string.
WARNING: The WARN_ON_STOP variable is not set. Defaulting to a blank string.
WARNING: The COMPOSE_PROJECT_NAME variable is not set. Defaulting to a blank string.
WARNING: The CONTAINERVOLUME variable is not set. Defaulting to a blank string.
WARNING: The Docker Engine you're using is running in swarm mode.

Compose does not use swarm mode to deploy services to multiple nodes in a swarm. All containers will be scheduled on the current node.

To deploy your application across the swarm, use `docker stack deploy`.

Creating network "ark-server_default" with the default driver
ERROR: could not find an available, non-overlapping IPv4 address pool among the defaults to assign to the network
❯ docker network create thisshitdontmakenosense -d overlay
r90kxsthnkfi93u9vc6dxh2z1
❯ docker network inspect r90
[
    {
        "Name": "thisshitdontmakenosense",
        "Id": "r90kxsthnkfi93u9vc6dxh2z1",
        "Created": "2020-04-16T20:04:55.661693173Z",
        "Scope": "swarm",
        "Driver": "overlay",
        "EnableIPv6": false,
        "IPAM": {
            "Driver": "default",
            "Options": null,
            "Config": [
                {
                    "Subnet": "10.202.2.0/24",
                    "Gateway": "10.202.2.1"
                }
            ]
        },
        "Internal": false,
        "Attachable": false,
        "Ingress": false,
        "ConfigFrom": {
            "Network": ""
        },
        "ConfigOnly": false,
        "Containers": null,
        "Options": {
            "com.docker.network.driver.overlay.vxlanid_list": "4098"
        },
        "Labels": null
    }
]
ghost commented 4 years ago

❯ dockerd --version Docker version 19.03.5, build 633a0ea838f1

ghost commented 4 years ago
Docker version 19.03.5, build 633a0ea838f1
❯ docker version
Client:
 Version:           19.03.5
 API version:       1.40
 Go version:        go1.12.12
 Git commit:        633a0ea838f1
 Built:             Thu Dec 12 12:00:00 2019
 OS/Arch:           linux/amd64
 Experimental:      false

Server:
 Engine:
  Version:          19.03.5
  API version:      1.40 (minimum version 1.12)
  Go version:       go1.12.12
  Git commit:       633a0ea838f1
  Built:            Thu Dec 12 12:00:00 2019
  OS/Arch:          linux/amd64
  Experimental:     false
 containerd:
  Version:          v1.2.10
  GitCommit:        b34a5c8af56e510852c35414db4c1f4fa6172339
 runc:
  Version:          1.0.0-rc8+dev
  GitCommit:        3e425f80a8c931f88e6d94a8c831b9d5aa481657
 docker-init:
  Version:          0.1.3_catatonit
  GitCommit:        
ghost commented 4 years ago

using a very intuitive approach I determined that I should prob be using v1.40 ❯ export DOCKER_HOST=127.0.0.1:2377 ❯ docker network create fuck -d overlay

   127.0.0.1.55812 > 127.0.0.1.2377: Flags [P.], cksum 0xffc4 (incorrect -> 0x5b98), seq 1:413, ack 1, win 11, options [nop,nop,TS val 732376965 ecr 732376962], length 412
        0x0000:  4500 01d0 ae66 4000 4006 8cbf 7f00 0001  E....f@.@.......
        0x0010:  7f00 0001 da04 0949 8ef1 5e1a 692d 7629  .......I..^.i-v)
        0x0020:  8018 000b ffc4 0000 0101 080a 2ba7 2f85  ............+./.
        0x0030:  2ba7 2f82 504f 5354 202f 7631 2e34 302f  +./.POST./v1.40/
        0x0040:  6e65 7477 6f72 6b73 2f63 7265 6174 6520  networks/create.
        0x0050:  4854 5450 2f31 2e31 0d0a 486f 7374 3a20  HTTP/1.1..Host:.
        0x0060:  3132 372e 302e 302e 313a 3233 3737 0d0a  127.0.0.1:2377..
        0x0070:  5573 6572 2d41 6765 6e74 3a20 446f 636b  User-Agent:.Dock
        0x0080:  6572 2d43 6c69 656e 742f 3139 2e30 332e  er-Client/19.03.
        0x0090:  3520 286c 696e 7578 290d 0a43 6f6e 7465  5.(linux)..Conte
        0x00a0:  6e74 2d4c 656e 6774 683a 2032 3534 0d0a  nt-Length:.254..
        0x00b0:  436f 6e74 656e 742d 5479 7065 3a20 6170  Content-Type:.ap
        0x00c0:  706c 6963 6174 696f 6e2f 6a73 6f6e 0d0a  plication/json..
        0x00d0:  0d0a 7b22 4368 6563 6b44 7570 6c69 6361  ..{"CheckDuplica
        0x00e0:  7465 223a 7472 7565 2c22 4472 6976 6572  te":true,"Driver
        0x00f0:  223a 226f 7665 726c 6179 222c 2253 636f  ":"overlay","Sco
        0x0100:  7065 223a 2222 2c22 456e 6162 6c65 4950  pe":"","EnableIP
        0x0110:  7636 223a 6661 6c73 652c 2249 5041 4d22  v6":false,"IPAM"
        0x0120:  3a7b 2244 7269 7665 7222 3a22 6465 6661  :{"Driver":"defa
        0x0130:  756c 7422 2c22 4f70 7469 6f6e 7322 3a7b  ult","Options":{
        0x0140:  7d2c 2243 6f6e 6669 6722 3a5b 5d7d 2c22  },"Config":[]},"
        0x0150:  496e 7465 726e 616c 223a 6661 6c73 652c  Internal":false,
        0x0160:  2241 7474 6163 6861 626c 6522 3a66 616c  "Attachable":fal
        0x0170:  7365 2c22 496e 6772 6573 7322 3a66 616c  se,"Ingress":fal
        0x0180:  7365 2c22 436f 6e66 6967 4f6e 6c79 223a  se,"ConfigOnly":
        0x0190:  6661 6c73 652c 2243 6f6e 6669 6746 726f  false,"ConfigFro
        0x01a0:  6d22 3a6e 756c 6c2c 224f 7074 696f 6e73  m":null,"Options
        0x01b0:  223a 7b7d 2c22 4c61 6265 6c73 223a 7b7d  ":{},"Labels":{}
        0x01c0:  2c22 4e61 6d65 223a 2266 7563 6b22 7d0a  ,"Name":"fuck"}.
ghost commented 4 years ago

I dont even know man, I don't know who decided I needed to be running a git build of docker for suse 15.2, really isn't very bright but this api versioning is really broken and somebody might want to revisit this at some point because its wasted a bunch of my time just to figure out that its got nothing to do with my networking configuration and it just doesn't know what to do when it gets a 404, on create/POST so it just says what it thinks is most likely the problem

ghost commented 4 years ago

I know I'm right tho

❯ docker-compose up
WARNING: The SESSION_NAME variable is not set. Defaulting to a blank string.
WARNING: The SERVER_MAP variable is not set. Defaulting to a blank string.
WARNING: The SERVER_PASSWORD variable is not set. Defaulting to a blank string.
WARNING: The ADMIN_PASSWORD variable is not set. Defaulting to a blank string.
WARNING: The MAX_PLAYERS variable is not set. Defaulting to a blank string.
WARNING: The UPDATE_ON_START variable is not set. Defaulting to a blank string.
WARNING: The BACKUP_ON_STOP variable is not set. Defaulting to a blank string.
WARNING: The PRE_UPDATE_BACKUP variable is not set. Defaulting to a blank string.
WARNING: The WARN_ON_STOP variable is not set. Defaulting to a blank string.
WARNING: The COMPOSE_PROJECT_NAME variable is not set. Defaulting to a blank string.
WARNING: The CONTAINERVOLUME variable is not set. Defaulting to a blank string.
WARNING: The Docker Engine you're using is running in swarm mode.

Compose does not use swarm mode to deploy services to multiple nodes in a swarm. All containers will be scheduled on the current node.

To deploy your application across the swarm, use `docker stack deploy`.

Creating network "ark-server_default" with the default driver
ERROR: could not find an available, non-overlapping IPv4 address pool among the defaults to assign to the network
❯ docker network create ark-server_default -d overlay
sv721kqfs6cssohy7pzdor5mj
❯ docker-compose up
WARNING: The SESSION_NAME variable is not set. Defaulting to a blank string.
WARNING: The SERVER_MAP variable is not set. Defaulting to a blank string.
WARNING: The SERVER_PASSWORD variable is not set. Defaulting to a blank string.
WARNING: The ADMIN_PASSWORD variable is not set. Defaulting to a blank string.
WARNING: The MAX_PLAYERS variable is not set. Defaulting to a blank string.
WARNING: The UPDATE_ON_START variable is not set. Defaulting to a blank string.
WARNING: The BACKUP_ON_STOP variable is not set. Defaulting to a blank string.
WARNING: The PRE_UPDATE_BACKUP variable is not set. Defaulting to a blank string.
WARNING: The WARN_ON_STOP variable is not set. Defaulting to a blank string.
WARNING: The COMPOSE_PROJECT_NAME variable is not set. Defaulting to a blank string.
WARNING: The CONTAINERVOLUME variable is not set. Defaulting to a blank string.
WARNING: The Docker Engine you're using is running in swarm mode.

Compose does not use swarm mode to deploy services to multiple nodes in a swarm. All containers will be scheduled on the current node.

To deploy your application across the swarm, use `docker stack deploy`.

Creating volume "ark-server_ark-data" with local-persist driver