Docker Community Forums

Share and learn in the Docker community.

Cannot delete networks : Error: in use

Hi all

quite new to docker, but i currently run into a problem when trying to delete networks created

Docker version 18.03.1-ce, build 9ee9f40
running in rancher on freenas

[rancher@rancher ~]$ docker network list
NETWORK ID          NAME                DRIVER              SCOPE
1458853cb4c1        bridge              bridge              local
df82bb163538        host                host                local
cc8a6dccec7c        iob_public          macvlan             local
ae1275e260c5        iob_public_conf     null                local
1ea961a0dc4d        iobroker_public     null                local
b3d3c90a3cd9        none                null                local
9f1c237bbf5d        sql_public_conf     null                local

I would like to delete the networks 1ea961a0dc4d and 9f1c237bbf5d but I always get an error:

[rancher@rancher ~]$ docker network rm iobroker_public

Error response from daemon: configuration network "iobroker_public" is in use

Docker network inspect gives me:

[rancher@rancher ~]$ docker network inspect iobroker_public
[
    {
        "Name": "iobroker_public",
        "Id": "1ea961a0dc4d8f6b14563c9e3cb893b72b5f2485a8edf77e385bb7e86139c32e",
        "Created": "2020-05-09T06:57:39.351474095Z",
        "Scope": "local",
        "Driver": "null",
        "EnableIPv6": false,
        "IPAM": {
            "Driver": "default",
            "Options": null,
            "Config": [
                {
                    "Subnet": "192.168.119.0/24",
                    "IPRange": "192.168.119.26/32",
                    "Gateway": "192.168.119.1"
                }
            ]
        },
        "Internal": false,
        "Attachable": false,
        "Ingress": false,
        "ConfigFrom": {
            "Network": ""
        },
        "ConfigOnly": true,
        "Containers": {},
        "Options": {
            "parent": "em0"
        },
        "Labels": {}
    }
]
[rancher@rancher ~]$ 

there are no containers connected to these networks.

how can I get rid of them? What means “in use”?

I created them as configs and then tried to “create” the network which is when the trouble started. Network config “iobroker_public” has the worng network interface, so the network was not created.
Network sql_public_config" was moaning about the address 192.168.119.1 (the gateway) already being in use???

thanks a lot in advance