for-win icon indicating copy to clipboard operation
for-win copied to clipboard

Docker container network ID changes on server reboot/docker restart

Open andrew-morgalla opened this issue 8 years ago • 23 comments

  • [X] I have tried with the latest version of my channel (Stable or Edge)
  • [ ] I have uploaded Diagnostics
  • Diagnostics ID:

Expected behavior

Network ID should not change when the server or docker service is restarted

Actual behavior

Network ID changes and the container endpoint ID is lost along with other network settings. This has only started to occur after upgrading from 17.06.2-ee-16.

  • Windows Version: Windows Server 2016 Datacenter with Containers
  • Docker for Windows Version: 18.03.1-ee-3

Steps to reproduce the behavior

  1. docker inspect output before the server is rebooted [ { "Id": "4b777ec7a74a44159cedc4c5eb2d5ded4ab40b8ac3459c52cc2837950746739b", "Created": "2018-09-11T13:59:49.9946947Z", "Path": "powershell.exe", "Args": [ "c:\bootstrap\bootstrap.ps1" ], "State": { "Status": "running", "Running": true, "Paused": false, "Restarting": false, "OOMKilled": false, "Dead": false, "Pid": 5336, "ExitCode": 0, "Error": "", "StartedAt": "2018-09-11T14:00:00.1726788Z", "FinishedAt": "0001-01-01T00:00:00Z" }, "Image": "sha256:5db1463cc87a16570e52763017a88d2c280bfb6a6152bb8e61897522369e5f2a", "ResolvConfPath": "", "HostnamePath": "", "HostsPath": "", "LogPath": "C:\ProgramData\docker\containers\4b777ec7a74a44159cedc4c5eb2d5ded4ab40b8ac3459c52cc2837950746739b\4b777ec7a74a44159cedc4c5eb2d5ded4ab40b8ac3459c52cc2837950746739b-json.log", "Name": "/app-10", "RestartCount": 0, "Driver": "windowsfilter", "Platform": "windows", "MountLabel": "", "ProcessLabel": "", "AppArmorProfile": "", "ExecIDs": null, "HostConfig": { "Binds": null, "ContainerIDFile": "", "LogConfig": { "Type": "json-file", "Config": {} }, "NetworkMode": "default", "PortBindings": null, "RestartPolicy": { "Name": "always", "MaximumRetryCount": 0 }, "AutoRemove": false, "VolumeDriver": "", "VolumesFrom": null, "CapAdd": null, "CapDrop": null, "Dns": null, "DnsOptions": null, "DnsSearch": null, "ExtraHosts": null, "GroupAdd": null, "IpcMode": "", "Cgroup": "", "Links": null, "OomScoreAdj": 0, "PidMode": "", "Privileged": false, "PublishAllPorts": false, "ReadonlyRootfs": false, "SecurityOpt": null, "UTSMode": "", "UsernsMode": "", "ShmSize": 0, "ConsoleSize": [ 0, 0 ], "Isolation": "process", "CpuShares": 0, "Memory": 0, "NanoCpus": 0, "CgroupParent": "", "BlkioWeight": 0, "BlkioWeightDevice": null, "BlkioDeviceReadBps": null, "BlkioDeviceWriteBps": null, "BlkioDeviceReadIOps": null, "BlkioDeviceWriteIOps": null, "CpuPeriod": 0, "CpuQuota": 0, "CpuRealtimePeriod": 0, "CpuRealtimeRuntime": 0, "CpusetCpus": "", "CpusetMems": "", "Devices": null, "DeviceCgroupRules": null, "DiskQuota": 0, "KernelMemory": 0, "MemoryReservation": 0, "MemorySwap": 0, "MemorySwappiness": null, "OomKillDisable": null, "PidsLimit": 0, "Ulimits": null, "CpuCount": 0, "CpuPercent": 0, "IOMaximumIOps": 0, "IOMaximumBandwidth": 0 }, "GraphDriver": { "Data": { "dir": "C:\ProgramData\docker\windowsfilter\4b777ec7a74a44159cedc4c5eb2d5ded4ab40b8ac3459c52cc2837950746739b" }, "Name": "windowsfilter" }, "Mounts": [], "Config": { "Hostname": "app-10", "Domainname": "", "User": "", "AttachStdin": false, "AttachStdout": false, "AttachStderr": false, "Tty": true, "OpenStdin": false, "StdinOnce": false, "Env": [ "COMPLUS_NGenProtectedProcess_FeatureEnabled=0" ], "Cmd": null, "Image": "XXXX", "Volumes": null, "WorkingDir": "C:\app", "Entrypoint": [ "powershell.exe", "c:\bootstrap\bootstrap.ps1" ], "OnBuild": null, "Labels": { "Default": "90100" } }, "NetworkSettings": { "Bridge": "", "SandboxID": "4b777ec7a74a44159cedc4c5eb2d5ded4ab40b8ac3459c52cc2837950746739b", "HairpinMode": false, "LinkLocalIPv6Address": "", "LinkLocalIPv6PrefixLen": 0, "Ports": {}, "SandboxKey": "4b777ec7a74a44159cedc4c5eb2d5ded4ab40b8ac3459c52cc2837950746739b", "SecondaryIPAddresses": null, "SecondaryIPv6Addresses": null, "EndpointID": "b6ec5791a62a2d8156238781d63497ac895a7b6f527d668cd817e886a5d6b1ef", "Gateway": "10.0.1.1", "GlobalIPv6Address": "", "GlobalIPv6PrefixLen": 0, "IPAddress": "10.0.1.110", "IPPrefixLen": 24, "IPv6Gateway": "", "MacAddress": "00:15:5d:4e:f9:1f", "Networks": { "bridge": { "IPAMConfig": { "IPv4Address": "10.0.1.110" }, "Links": null, "Aliases": [ "4b777ec7a74a" ], "NetworkID": "8d13c30ed5607bbee2487a4e8b1107d2e09e7379e317012c60dbb15e9d9d4acd", "EndpointID": "b6ec5791a62a2d8156238781d63497ac895a7b6f527d668cd817e886a5d6b1ef", "Gateway": "10.0.1.1", "IPAddress": "10.0.1.110", "IPPrefixLen": 24, "IPv6Gateway": "", "GlobalIPv6Address": "", "GlobalIPv6PrefixLen": 0, "MacAddress": "00:15:5d:4e:f9:1f", "DriverOpts": null } } } } ]

  2. docker inspect out put after server is rebooted [ { "Id": "4b777ec7a74a44159cedc4c5eb2d5ded4ab40b8ac3459c52cc2837950746739b", "Created": "2018-09-11T13:59:49.9946947Z", "Path": "powershell.exe", "Args": [ "c:\bootstrap\bootstrap.ps1" ], "State": { "Status": "exited", "Running": false, "Paused": false, "Restarting": false, "OOMKilled": false, "Dead": false, "Pid": 0, "ExitCode": 4294967295, "Error": "network 8d13c30ed5607bbee2487a4e8b1107d2e09e7379e317012c60dbb15e9d9d4acd not found", "StartedAt": "2018-09-11T14:00:00.1726788Z", "FinishedAt": "2018-09-11T15:02:34.164563+01:00" }, "Image": "sha256:5db1463cc87a16570e52763017a88d2c280bfb6a6152bb8e61897522369e5f2a", "ResolvConfPath": "", "HostnamePath": "", "HostsPath": "", "LogPath": "C:\ProgramData\docker\containers\4b777ec7a74a44159cedc4c5eb2d5ded4ab40b8ac3459c52cc2837950746739b\4b777ec7a74a44159cedc4c5eb2d5ded4ab40b8ac3459c52cc2837950746739b-json.log", "Name": "/app-10", "RestartCount": 0, "Driver": "windowsfilter", "Platform": "windows", "MountLabel": "", "ProcessLabel": "", "AppArmorProfile": "", "ExecIDs": null, "HostConfig": { "Binds": null, "ContainerIDFile": "", "LogConfig": { "Type": "json-file", "Config": {} }, "NetworkMode": "default", "PortBindings": null, "RestartPolicy": { "Name": "always", "MaximumRetryCount": 0 }, "AutoRemove": false, "VolumeDriver": "", "VolumesFrom": null, "CapAdd": null, "CapDrop": null, "Dns": [], "DnsOptions": [], "DnsSearch": [], "ExtraHosts": null, "GroupAdd": null, "IpcMode": "", "Cgroup": "", "Links": null, "OomScoreAdj": 0, "PidMode": "", "Privileged": false, "PublishAllPorts": false, "ReadonlyRootfs": false, "SecurityOpt": null, "UTSMode": "", "UsernsMode": "", "ShmSize": 0, "ConsoleSize": [ 0, 0 ], "Isolation": "process", "CpuShares": 0, "Memory": 0, "NanoCpus": 0, "CgroupParent": "", "BlkioWeight": 0, "BlkioWeightDevice": null, "BlkioDeviceReadBps": null, "BlkioDeviceWriteBps": null, "BlkioDeviceReadIOps": null, "BlkioDeviceWriteIOps": null, "CpuPeriod": 0, "CpuQuota": 0, "CpuRealtimePeriod": 0, "CpuRealtimeRuntime": 0, "CpusetCpus": "", "CpusetMems": "", "Devices": null, "DeviceCgroupRules": null, "DiskQuota": 0, "KernelMemory": 0, "MemoryReservation": 0, "MemorySwap": 0, "MemorySwappiness": null, "OomKillDisable": null, "PidsLimit": 0, "Ulimits": null, "CpuCount": 0, "CpuPercent": 0, "IOMaximumIOps": 0, "IOMaximumBandwidth": 0 }, "GraphDriver": { "Data": { "dir": "C:\ProgramData\docker\windowsfilter\4b777ec7a74a44159cedc4c5eb2d5ded4ab40b8ac3459c52cc2837950746739b" }, "Name": "windowsfilter" }, "Mounts": [], "Config": { "Hostname": "app-10", "Domainname": "", "User": "", "AttachStdin": false, "AttachStdout": false, "AttachStderr": false, "Tty": true, "OpenStdin": false, "StdinOnce": false, "Env": [ "COMPLUS_NGenProtectedProcess_FeatureEnabled=0" ], "Cmd": null, "Image": "XXXX", "Volumes": null, "WorkingDir": "C:\app", "Entrypoint": [ "powershell.exe", "c:\bootstrap\bootstrap.ps1" ], "OnBuild": null, "Labels": { "Default": "90100" } }, "NetworkSettings": { "Bridge": "", "SandboxID": "4b777ec7a74a44159cedc4c5eb2d5ded4ab40b8ac3459c52cc2837950746739b", "HairpinMode": false, "LinkLocalIPv6Address": "", "LinkLocalIPv6PrefixLen": 0, "Ports": {}, "SandboxKey": "4b777ec7a74a44159cedc4c5eb2d5ded4ab40b8ac3459c52cc2837950746739b", "SecondaryIPAddresses": null, "SecondaryIPv6Addresses": null, "EndpointID": "", "Gateway": "", "GlobalIPv6Address": "", "GlobalIPv6PrefixLen": 0, "IPAddress": "", "IPPrefixLen": 0, "IPv6Gateway": "", "MacAddress": "", "Networks": { "bridge": { "IPAMConfig": { "IPv4Address": "10.0.1.110" }, "Links": null, "Aliases": [ "4b777ec7a74a" ], "NetworkID": "8d13c30ed5607bbee2487a4e8b1107d2e09e7379e317012c60dbb15e9d9d4acd", "EndpointID": "", "Gateway": "", "IPAddress": "", "IPPrefixLen": 0, "IPv6Gateway": "", "GlobalIPv6Address": "", "GlobalIPv6PrefixLen": 0, "MacAddress": "", "DriverOpts": null } } } } ]

andrew-morgalla avatar Sep 11 '18 14:09 andrew-morgalla

Second this issue, seems like this should be a high priority- as it makes any custom network configuration disappear on reboot and all containers set to restart using those networks fail.

Updated with more details:

Windows Version: Windows Server 2019 Desktop Experience Docker for Windows Version: 18.03.1-ee-3

Create a test network, Create a container using this network, set to always restart Restart system Container is now in failed state and did not start

Docker Inspect network settings before restart: ... "NetworkSettings": { "Bridge": "", "SandboxID": "e8715287333d6a22a2ca2468996b3c4361ba4ce9d7ce74df987ee3a2ecf68d96", "HairpinMode": false, "LinkLocalIPv6Address": "", "LinkLocalIPv6PrefixLen": 0, "Ports": { "80/tcp": null }, "SandboxKey": "e8715287333d6a22a2ca2468996b3c4361ba4ce9d7ce74df987ee3a2ecf68d96", "SecondaryIPAddresses": null, "SecondaryIPv6Addresses": null, "EndpointID": "", "Gateway": "", "GlobalIPv6Address": "", "GlobalIPv6PrefixLen": 0, "IPAddress": "", "IPPrefixLen": 0, "IPv6Gateway": "", "MacAddress": "", "Networks": { "test": { "IPAMConfig": null, "Links": null, "Aliases": [ "e8715287333d" ], "NetworkID": "4bdde1c67a60b01f3ae7bba38216b1d967120900b83697361ebd0f294b113b37", "EndpointID": "c9df29b0c0ed728171170d643a7e949af2887049ddfeafaff72943b59de64b9d", "Gateway": "172.28.208.1", "IPAddress": "172.28.208.62", "IPPrefixLen": 16, "IPv6Gateway": "", "GlobalIPv6Address": "", "GlobalIPv6PrefixLen": 0, "MacAddress": "00:15:5d:30:ed:22", "DriverOpts": null } } } ....

Docker Inspect network settings after restart:

... "NetworkSettings": { "Bridge": "", "SandboxID": "e8715287333d6a22a2ca2468996b3c4361ba4ce9d7ce74df987ee3a2ecf68d96", "HairpinMode": false, "LinkLocalIPv6Address": "", "LinkLocalIPv6PrefixLen": 0, "Ports": {}, "SandboxKey": "e8715287333d6a22a2ca2468996b3c4361ba4ce9d7ce74df987ee3a2ecf68d96", "SecondaryIPAddresses": null, "SecondaryIPv6Addresses": null, "EndpointID": "", "Gateway": "", "GlobalIPv6Address": "", "GlobalIPv6PrefixLen": 0, "IPAddress": "", "IPPrefixLen": 0, "IPv6Gateway": "", "MacAddress": "", "Networks": { "test": { "IPAMConfig": null, "Links": null, "Aliases": [ "e8715287333d" ], "NetworkID": "4bdde1c67a60b01f3ae7bba38216b1d967120900b83697361ebd0f294b113b37", "EndpointID": "", "Gateway": "", "IPAddress": "", "IPPrefixLen": 0, "IPv6Gateway": "", "GlobalIPv6Address": "", "GlobalIPv6PrefixLen": 0, "MacAddress": "", "DriverOpts": null } } } ...

sandersonatlatitude avatar Oct 22 '18 17:10 sandersonatlatitude

Issues go stale after 90d of inactivity. Mark the issue as fresh with /remove-lifecycle stale comment. Stale issues will be closed after an additional 30d of inactivity.

Prevent issues from auto-closing with an /lifecycle frozen comment.

If this issue is safe to close now please do so.

Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows. /lifecycle stale

docker-robott avatar Jan 20 '19 02:01 docker-robott

Please do not close this issue. It's Mission critical!!!

JoergBrugman avatar Jan 20 '19 07:01 JoergBrugman

This problem is still existing. I ran the compose config. Then Docker Desktop was restarted. The difference between default network before and after restart (docker network inspect):

  • Id
  • Created
  • IPAM.Config[0].Subnet (0.0.0.0/0 ->172.27.128.0/20)
  • Attachable (true -> false)
  • Containers ( { ...my runned containers } -> {} empty)
  • Labels ( { ...labels} -> {} empty) inspect default network showed me

Will it be fixed?

yakovenkoroman1993 avatar Feb 21 '19 07:02 yakovenkoroman1993

According to this moby/moby#38358 (comment) we now have a fix that is backported and also a workaround by setting a reg key

tfenster avatar Feb 22 '19 06:02 tfenster

My workaround is reconnecting of all containers using docker network connect my_network my_container. After it, every container reference to existing network id how docker inspect show

yakovenkoroman1993 avatar Feb 22 '19 17:02 yakovenkoroman1993

According to this moby/moby#38358 (comment) we now have a fix that is backported and also a workaround by setting a reg key

There are actually two issues mentioned there. The reg key workaround doesn't seem to keep the IDs from changing or from them getting rewired back to the containers properly. According to the issue you referenced we will need to wait for 18.09.3 for that part.

wtigotw avatar Feb 23 '19 17:02 wtigotw

On Windows Server 2019 [Version 10.0.17763.379] with Docker 18.09.04 the created networks are no longer available after a reboot.

cukal avatar Apr 03 '19 10:04 cukal

Issues go stale after 90d of inactivity. Mark the issue as fresh with /remove-lifecycle stale comment. Stale issues will be closed after an additional 30d of inactivity.

Prevent issues from auto-closing with an /lifecycle frozen comment.

If this issue is safe to close now please do so.

Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows. /lifecycle stale

docker-robott avatar Jul 02 '19 01:07 docker-robott

Please do not close this issue. It's Mission critical!!! I would find it really customer friendly if Microsoft would deal with troubleshooting after such a long time!

JoergBrugman avatar Jul 02 '19 11:07 JoergBrugman

/remove-lifecycle stale

tfenster avatar Jul 02 '19 12:07 tfenster

Please don't close this, its a real issue. It has to be fixed.

jorioux avatar Aug 26 '19 18:08 jorioux

Issues go stale after 90d of inactivity. Mark the issue as fresh with /remove-lifecycle stale comment. Stale issues will be closed after an additional 30d of inactivity.

Prevent issues from auto-closing with an /lifecycle frozen comment.

If this issue is safe to close now please do so.

Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows. /lifecycle stale

docker-robott avatar Nov 24 '19 01:11 docker-robott

That @docker-desktop-robot is a real jerk!

Dmitry1987 avatar Feb 04 '20 00:02 Dmitry1987

Hey @docker-desktop-robot ! The issue wasn't fixed. What docker version fixes it actually?

Dmitry1987 avatar Feb 04 '20 00:02 Dmitry1987

/remove-lifecycle stale

mat007 avatar Feb 04 '20 05:02 mat007

Issues go stale after 90d of inactivity. Mark the issue as fresh with /remove-lifecycle stale comment. Stale issues will be closed after an additional 30d of inactivity.

Prevent issues from auto-closing with an /lifecycle frozen comment.

If this issue is safe to close now please do so.

Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows. /lifecycle stale

docker-robott avatar May 04 '20 01:05 docker-robott

/remove-lifecycle stale

JoergBrugman avatar May 05 '20 03:05 JoergBrugman

/lifecycle frozen

JoergBrugman avatar May 05 '20 03:05 JoergBrugman

Still, huh? Same happens in Synology's DSM docker application

diomidis avatar May 26 '20 13:05 diomidis