7

Using portainer, I created a macvlan configuration network. Now, I want to remove this network. However, for some reason, I can't. I do receive the following error msg: Error response from daemon: error while removing network: configuration network "my_macvlan_config" is in use. The weird thing is that I don't think that the network is in use. There is no container attached to it. When inspecting the network, I get the following results:

~$ sudo docker network inspect my_macvlan_config
[
    {
        "Name": "my_macvlan_config",
        "Id": "5d95270684516484632c4505e15ba8253bbe8d780b2c41a84a07fbbe09d7a9b6",
        "Created": "2020-05-18T20:59:03.472260896+02:00",
        "Scope": "local",
        "Driver": "null",
        "EnableIPv6": false,
        "IPAM": {
            "Driver": "default",
            "Options": null,
            "Config": [
                {
                    "Subnet": "192.168.13.0/24",
                    "IPRange": "192.168.13.200/29",
                    "Gateway": "192.168.13.1"
                }
            ]
        },
        "Internal": false,
        "Attachable": false,
        "Ingress": false,
        "ConfigFrom": {
            "Network": ""
        },
        "ConfigOnly": true,
        "Containers": {},
        "Options": {
            "parent": "eth0"
        },
        "Labels": {}
    }
]

Docker itself is running on my Synology Diskstation, fwiw.

EDIT: There's another network called macvlan that is connected to my_macvlan_config.

~$ sudo docker network inspect macvlan
[
    {
        "Name": "macvlan",
        "Id": "8a831afa776475b01ca240f4b6b2434c820b8a03910b402760e3cd988e7ddb5c",
        "Created": "2020-05-23T23:11:17.738229138+02:00",
        "Scope": "local",
        "Driver": "macvlan",
        "EnableIPv6": false,
        "IPAM": {
            "Driver": "default",
            "Options": null,
            "Config": [
                {
                    "Subnet": "192.168.13.0/24",
                    "IPRange": "192.168.13.210/29",
                    "Gateway": "192.168.13.1"
                }
            ]
        },
        "Internal": false,
        "Attachable": false,
        "Ingress": false,
        "ConfigFrom": {
            "Network": "macvlan_config"
        },
        "ConfigOnly": false,
        "Containers": {
            "6f025749fe99a22fa3729bebfa72d6329b363fe8f6589d9147d0d58a9934dd42": {
                "Name": "tvheadend",
                "EndpointID": "bc827cb2fddc4374fde7634534efd0c8c110af5a70aa9b16a319b770dfe7a0f2",
                "MacAddress": "02:42:c0:a8:0d:d3",
                "IPv4Address": "192.168.13.211/24",
                "IPv6Address": ""
            }
        },
        "Options": {
            "parent": "eth0"
        },
        "Labels": {}
    }
]

And there's one more network, which is apparently unrelated.

~$ sudo docker network inspect macvlan_config
[
    {
        "Name": "macvlan_config",
        "Id": "644a15c6b9e653ec3f48c4a2e290f996b41361170d5ab63053b87a301168345f",
        "Created": "2020-05-23T23:10:54.880348491+02:00",
        "Scope": "local",
        "Driver": "null",
        "EnableIPv6": false,
        "IPAM": {
            "Driver": "default",
            "Options": null,
            "Config": [
                {
                    "Subnet": "192.168.13.0/24",
                    "IPRange": "192.168.13.210/29",
                    "Gateway": "192.168.13.1"
                }
            ]
        },
        "Internal": false,
        "Attachable": false,
        "Ingress": false,
        "ConfigFrom": {
            "Network": ""
        },
        "ConfigOnly": true,
        "Containers": {},
        "Options": {
            "parent": "eth0"
        },
        "Labels": {}
    }
]

I then removed the tvheadend container. I was then able to delete all networks but my_macvlan_config.

Andi
  • 3,196
  • 2
  • 24
  • 44
  • 2
    probably you have a stopped container using that network, check all the containers if the network is set with: `for i in $(docker ps -a | awk '/^[a-z0-9]/ {print $NF}'); do if [ ! -z "$(docker inspect $i | grep my_macvlan_config)" ]; then echo $i; fi; done;` – Motakjuq May 18 '20 at 22:02
  • @Motakjuq I never attached any container to that network. The output of your command is empty. – Andi May 19 '20 at 06:00
  • same problem here. did you ever solved it? – The Chris Sep 10 '20 at 14:29
  • Is there any other networks built over this macvlan network (using the parameter `--config-from`)? I'm asking that because the flag `ConfigOnly` is set to `true`. Try inspecting other networks and see if there's any related to it in the `ConfigFrom` key – Gustavo Kawamoto Sep 15 '20 at 10:47
  • @GustavoKawamoto You're right, there's another network. I edited my original question. – Andi Oct 24 '20 at 20:39
  • I was thinking like @Motakjuq. What about restarting `dockerd`, followed by a `docker network rm` ? – MadJlzz Dec 24 '20 at 08:38
  • I'm also having this issue with a `--config-only` network - I can't delete it: `Error response from daemon: error while removing network: configuration network "netconfig-vpn-adq" is in use` but I've dropped all containers and networks... only happening on 2 out of 3 of my Docker Swarm nodes. – Ashley Nov 10 '22 at 16:26

0 Answers0