Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Docker won't start containers after win 10 shutdown and power up. #1038

Closed
relnah opened this issue Aug 25, 2017 · 102 comments
Closed

Docker won't start containers after win 10 shutdown and power up. #1038

relnah opened this issue Aug 25, 2017 · 102 comments

Comments

@relnah
Copy link

relnah commented Aug 25, 2017

Expected behavior

After shuting down win 10 normally and with a working docker running, docker should be running as normal after powering up win 10.

Actual behavior

Starting containers fails with: Error response from daemon: Cannot restart container my_container: driver failed programming external connectivity on endpoint my_container (782f444833c57027050a58f8c0302473f76d9029a50944960d13c6ed940a4392): Error starting userland proxy: mkdir /port/tcp:0.0.0.0:49161:tcp:172.17.0.2:1521: input/output error

docker compose up hangs.

Restart of docker engine will make it work again.

Information

Diagnostic ID 18D5608F-3086-460D-BD15-84F84F2C55D6/2017-08-25_08-09-32

Docker info:
Version 17.06.1-ce-win24 (13025)
Channel: stable
54dc09c

Win 10 info:
Edition: Windows 10 Enterprise x64
Version: 1703
OS Build: 15063.540
CPU: Inter Core i7-6600U 2.6GHz
RAM: 16 GB

Steps to reproduce the behavior

  1. Start windows. Start docker and check "Start docker when you login".
  2. Confirm docker is working as normal.
  3. Do normal shutdown of windows.
  4. Start up windows.
  5. Confirm that docker has started.
  6. Try starting a container. This fails with above mentioned problems.
  7. Restart Docker. Starting containers work again.
@RayDeCampo
Copy link

I have the same issue although I have observed it happening when just logging out and logging back into my OS account. A restart of the docker service is the work-around. I am on Windows 10 Pro version 10.0.15063.502.

@relnah
Copy link
Author

relnah commented Oct 26, 2017

Still having this issue after latest docker and latest Win 10. Running linux containers to keep it consistent within our organization.
Disgnostic id: 18D5608F-3086-460D-BD15-84F84F2C55D6/2017-10-26_08-42-13
Docker version:
Version 17.09.0-ce-win33 (13620)
Channel: stable
8c56a3b

Win version:
Win 10 info:
Edition: Windows 10 Enterprise x64
Version: 1709
OS Build: 16299.19
CPU: Inter Core i7-6600U 2.6GHz
RAM: 16 GB

@shillner
Copy link

Hi, having the same issue on my machine. Settings are nearly identical to the ones of @relnah.
After shutdown or logout with running Docker for Windows the next docker startup is pretty fast but containers won't start. Only restarting docker helps at this point.

@DirtyJerz
Copy link

It seems the containers are still running ($docker ps) but the ports are no longer exposed (netstat -an). This is kinda frustrating and makes a multi-user or consecutive-session scenario inoperative.

@relnah
Copy link
Author

relnah commented Jan 9, 2018

Same issue after latest update:
Version 17.09.1-ce-win42 (14687)
Channel: stable
3176a6a

diag id:
18D5608F-3086-460D-BD15-84F84F2C55D6/2018-01-09_07-41-17

@relnah
Copy link
Author

relnah commented Jan 18, 2018

And still here:
Version 17.12.0-ce-win47 (15139)
Channel: stable
9c692cd

Error response from daemon: Cannot restart container xxxxx: driver failed programming external connectivity on endpoint xxxxx (bb96658514789875b9aabda58ee4312d26cabab216c516f34bcf34075b1db9a0): Error starting userland proxy: mkdir /port/tcp:0.0.0.0:49161:tcp:172.17.0.2:1521: input/output error

Diag:
18D5608F-3086-460D-BD15-84F84F2C55D6/2018-01-18_07-58-02

@kbeaskoetxea
Copy link

Exactly the same issue here, I have to restart it whenever I shut down - power up my PC.

Docker info:
Version 17.12.0-ce-win47 (15139)
Channel: stable
9c692cd

Win 10 info:
Edition: Windows 10 Pro
Version: 1709
OS Build: 16299.192
CPU: Inter Core i5-7200U 2.5GHz
RAM: 12 GB

@fiture
Copy link

fiture commented Feb 1, 2018

Same issue.

Error response from daemon: Cannot restart container xxx: driver failed programming external connectivity on endpoint lite (b7974e1da9cef2c73e75dcb7f6452cb753675e1c63feab82a4ccb433a5c337fe): Error starting userland proxy: mkdir /port/tcp:0.0.0.0:8000:tcp:172.17.0.2:8000: input/output error

@smiron
Copy link

smiron commented Feb 9, 2018

6 months later and I still have this issue. Hope they go bankrupt FFS

Update: 6 months later and I have 7 down emojis. Sooo scarry. Thanks guys. You made my day 🥇

@jenspettersson
Copy link

Same issue here. Shutting down Windows 10 with Docker For Windows running, but not set as "Start docker on login".

After restart I start Docker for Windows manually and my containers that should start automatically starts (a RabbitMQ container). However, it's not accessable and if I try to restart I get the same "driver failed programming..." error... I have to stop Docker for Windows and start it again.

@dongshengYoung
Copy link

when i sign out docker ,then sign in, the container can't

just quit docker and restart docker ,the container goes well.

my OS is win10

maybe restarting docke is a helpful way to solve problems of windows

@Diedzz
Copy link

Diedzz commented Feb 16, 2018

same here, always have to restart docker after loging in to Win.

@LeslieMurphy
Copy link

Is this a Docker issue, or a Hyper-V issue? Not sure.

See https://forums.docker.com/t/overlay-network-broken-after-resuming-from-sleep/37376

@jannikbuschke
Copy link

same problem here

@Christowiak
Copy link

same problem here

1 similar comment
@fcavaco
Copy link

fcavaco commented Mar 1, 2018

same problem here

@ramzgt
Copy link

ramzgt commented Mar 5, 2018

I have the same issue as well. Frustrating.

@tkallevik
Copy link

I also have the same problem.

@Christowiak
Copy link

Christowiak commented Mar 5, 2018

i have found a solution on a other thread.

#573

The problem relies on the hybrid shutdown mode from the lastest win 10 updates. After disable it under energy options, the problem is solved for me.

@kkajdd
Copy link

kkajdd commented Mar 8, 2018

restart of the docker after win10 boot up worked for me.

@fiture
Copy link

fiture commented Mar 15, 2018

As @Christowiak say, Turn off fast startup works for me.
Uncheck Turn on fast startup and save. enjoy!
Control Panel > Hardware and Sound > Power Options > System Settings
windows 10 fast startup

@quayal
Copy link

quayal commented Mar 21, 2018

I have the same issue, only that I can't see any containers; docker ps returns nothing

@cchance27
Copy link

docker ps -a your containers are probably stopped still you''ll need to start them unless you set them to auto-restart

@kbeaskoetxea
Copy link

Yep. As @Christowiak said, I turn off Windows' fast startup and it goes fine.

@relnah
Copy link
Author

relnah commented Mar 21, 2018

Turning off OS features on my computer just to get Docker to work normally isn't really a soulution. A temporary workaround perhaps. So the issue is still valid.

@ruifigueira
Copy link

I couldn't find any UI to disable the hybrid shutdown mode as @Christowiak pointed out, so I went directly to regedit and created a Computer\HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows\CurrentVersion\Policies\System\DisableAutomaticRestartSignOn key (DWORD type) with value 1 and it seems to be working fine now.

More details on that property can be found in Winlogon Automatic Restart Sign-On (ARSO)
.

@mfoulds
Copy link

mfoulds commented Apr 10, 2019

@NestorDR thanks for this. If we were to disable Docker's automatic startup on login in Docker Settings, then could we run your script instead, but without having to wait for Docker to stop?

@Tiberriver256
Copy link

Easier methods for managing the "fast startup" mode via cmd.exe / PowerShell:

Turn on

REG ADD "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Power" /V HiberbootEnabled /T REG_dWORD /D 0 /F

Turn off

REG ADD "HKLM\SYSTEM\CurrentControlSet\Control\Session Manager\Power" /V HiberbootEnabled /T REG_dWORD /D 1 /F

More Information / Other methods

https://www.tenforums.com/tutorials/4189-turn-off-fast-startup-windows-10-a.html

@NestorDR
Copy link

@mfoulds The problem arises because Docker does not stop formally at shutdown Windows, so the Docker must be started, in order to stop it formally.

@StefanScherer
Copy link
Member

We're currently working on several issues and have a first edge preview to download which solves the problem with the "fast startup" mode in our test environment. It even restarts containers after a reboot and login that were started with the restart option eg. docker run -d -p 80:80 --restart always nginx.
I would love to hear your feedback if and how it helps in your environment.

@mcopjan
Copy link

mcopjan commented Jul 16, 2019

@StefanScherer Unfortunately unable to install on Microsoft Windows Server 2016 Standard (10.0.14393 Build 14393), it says" Docker Desktop requires Windows 10 Pro or Enterprise version 15063 to run." :/
Currently using 2.0.0.3 (31259)

@nrjohnstone
Copy link

nrjohnstone commented Jul 17, 2019

Downloading and trialing right now...

@nrjohnstone
Copy link

and after leaving some docker containers running, shutting down pc for 6 hours then restarting I get a crash from docker on starting (replicated multiple times)

error during connect: Get http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.40/containers/json: open //./pipe/docker_engine: The system cannot find the file specified. In the default daemon configuration on Windows, the docker client must be run elevated to connect. This error may also indicate that the docker daemon is not running.

at Docker.Backend.DockerDaemonChecker.Check(Func`1 isDaemonProcessStillRunning)
at Docker.Backend.BackendNamedPipeServer.b__8_4(Object[] args)
at Docker.Core.Pipe.NamedPipeServer.<>c__DisplayClass9_0.b__0(Object[] parameters)
at Docker.Core.Pipe.NamedPipeServer.RunAction(String action, Object[] parameters)

Lucky at this point of using docker on windows for the last 3 years I've become apathetic to announcments and new versions of docker solving anything.

@mikeparker
Copy link
Contributor

@mcopjan Docker Desktop is for developer machines, not Windows Server. For Windows Server please see Docker Enterprise for Windows Server -> https://docs.docker.com/install/windows/docker-ee/

@nrjohnstone can you confirm Docker Desktop is set to startup on boot and not disabled in the windows startup tasks. Can you then check the status of your whale icon in your systray (if its broken, it will be red. If its not started at all it won't be there.) Assuming all this is fine can you then upload your log file or a diagnostic? The error message you posted just says docker isn't running, so diagnosing that will need more info. Thanks!

@mcopjan
Copy link

mcopjan commented Jul 18, 2019

@mikeparker thanks, I installed docker EE on WS 2016, problem is I cannot switch into linux containers (I assume it is not supported?) So I am still stuck with Docker for Windows experiencing the reported issue.

@nrjohnstone
Copy link

nrjohnstone commented Jul 20, 2019

@mikeparker I can confirm the following
After the install everything works and there is a Hyper-V machine "DockerDesktop" running.
After a reboot, the Hyper-V machine is still there, and running, but Docker Desktop starts, the whale icon in the system tray does it's thing for about 2-3 minutes then I get the error with the docker daemon not running.

I have to uninstall and revert back to the build from last year that I've been running as I don't really have the time to be a beta tester for this scenario.

I have uploaded the error log though.

I guess it's back to force killing docker to restart on every windows login again.

@graham73may
Copy link

@nrjohnstone
I have this exact issue and was really hoping you were going to come back with some good news!

I don't know if you will find either of these less painful than force killing docker:

  1. Quit docker before shutting down.
    Or
  2. When you boot up... let the whale do it's thing. When it thinks it's ready, right click and hit restart docker.

The other annoying thing I've not managed to find a work around for is if I'm using docker and shut my laptop... Then open my laptop a bit later, the whole machine has effectively crashed and windows starts up from scratch instead of waking from sleep. (this only happens if docker is running, fine if it's not).

@luisbodra
Copy link

Hi, I am a user of Brazil and have experienced an error in my attempts to install [nwabap751] from the command line of my Linux container Ubuntu into Docker. The message appears on my screen:

PS C:\INST> docker run -p 8000:8000 -p 44300:44300 -p 3300:3300 -p 3200:3200 -h vhcalnplci --name nwabap751 -it nwabap751 /bin/bash
C:\Program Files\Docker\Docker\Resources\bin\docker.exe: Error response from daemon: driver failed programming external connectivity on endpoint nwabap751 (89538c9c2ae1ab2541f308b6bd64cbff4024dc4ad773aa2096026a9a28bc76f4): Error starting userland proxy: mkdir /port/tcp:0.0.0.0:44300:tcp:172.17.0.2:44300: input/output error.
PS C:\INST>

How can I solve this problem? Why it happens? Can you help me? Thanks for your help.

@wasmup
Copy link

wasmup commented Jul 31, 2019

Error:

docker:
Error response from daemon: driver failed programming external connectivity on endpoint pg1 (ee2507e963bb1effee71270ed0151d7e1c92cbb32615e0b176f4852892c4c596):
Error starting userland proxy: mkdir /port/tcp:0.0.0.0:5432:tcp:172.17.0.2:5432: input/output error.

For me: Solved by just Docker Restart (not OS).

docker version

Client: Docker Engine - Community
 Version:           18.09.2
 API version:       1.39
 Go version:        go1.10.8
 Git commit:        6247962
 Built:             Sun Feb 10 04:12:31 2019
 OS/Arch:           windows/amd64
 Experimental:      false

Server: Docker Engine - Community
 Engine:
  Version:          18.09.2
  API version:      1.39 (minimum version 1.12)
  Go version:       go1.10.6
  Git commit:       6247962
  Built:            Sun Feb 10 04:13:06 2019
  OS/Arch:          linux/amd64
  Experimental:     false

@ghost
Copy link

ghost commented Aug 2, 2019

i have found a solution on a other thread.

#573

The problem relies on the hybrid shutdown mode from the lastest win 10 updates. After disable it under energy options, the problem is solved for me.

This one worked for me.

@relnah
Copy link
Author

relnah commented Aug 16, 2019

After upgrade to latest stable Docker (2.1.0.1) my case now works without any workarounds, like disabling OS features.

I select to have Docker start on start up, I create a container with --restart unless-stopped.
Confirm that container is accessible and running ok.
Shut down windows.
Start windows.
Wait for Docker to automatically start.
Confirm that container is running ok and is accessible.

I'm running linux containers.

Version info:
{
"id": "",
"date": "2019-08-16 06:11:41.1555453 +0000 UTC",
"os": "Windows 10 Enterprise 10.0.18362",
"os_label": "win/18362",
"app_version": "2.1.0.1",
"app_channel": "stable",
"engine_version": "19.03.1",
"compose_version": "1.24.1",
"kubernetes_version": "v1.14.3",
"credhelper_version": "0.6.3",
"notary_version": "0.6.1",
"vpnkit_version": "218f01482560cba2fa863f9ad872ad51d1e717fc"
}

Thanks for the fix ;)

@leftnet
Copy link

leftnet commented Aug 16, 2019

This also seems to be working for me without workarounds in 2.1.0.1 now. Good job! 👍

@Vespira
Copy link

Vespira commented Aug 28, 2019

Restart didn't worked for me (tried multiple way to restart Docker), neither did disabling the "Experimental features" (as it were already disabled, anyway). We tried so much things, but we ended up doing a "Reset to factory" from Docker Desktop GUI, and magically, it worked again.

But man, I hate it when docker network or something have a corrupted state, it happens way too often. Plus, the issue that I have to effectivly restart Docker at each Windows start, but here, changing the shutdown strategy, like other users suggested, to "not fast startup" did the trick.

@relnah
Copy link
Author

relnah commented Aug 29, 2019

2.1.0.1 fixed it. Has been working well for a couple of weeks.

@relnah relnah closed this as completed Aug 29, 2019
@Vespira
Copy link

Vespira commented Aug 29, 2019

I'm was already in version 2.1.0.1 (build 37199) when I had the issue I described earlier. So it has to be something else. I'll create an issue if I have the problem again anyway.

@nfourniol
Copy link

Still the same issue on 2.1.0.1 (build 37199)

@Viir
Copy link

Viir commented Sep 16, 2019

docker run fails on Windows 10:

Error response from daemon: driver failed programming external connectivity on endpoint drtsgame-test-container (7597b6ceadc7356f20b918b1c46c648f1cabf99df3f82ef79093cf337d5ac9cb): Error starting userland proxy: mkdir /port/tcp:0.0.0.0:443:tcp:172.17.0.2:443: input/output error.

docker version:

Client: Docker Engine - Community
 Version:           18.09.2
 API version:       1.39
 Go version:        go1.10.8
 Git commit:        6247962
 Built:             Sun Feb 10 04:12:31 2019
 OS/Arch:           windows/amd64
 Experimental:      false

Server: Docker Engine - Community
 Engine:
  Version:          18.09.2
  API version:      1.39 (minimum version 1.12)
  Go version:       go1.10.6
  Git commit:       6247962
  Built:            Sun Feb 10 04:13:06 2019
  OS/Arch:          linux/amd64
  Experimental:     false

Note about Docker version: The docker installer keeps hanging, see #1172 (comment)

Trying to restart docker:
image
After this restart, docker run worked, so this resolved the problem.

@Illutax
Copy link

Illutax commented Nov 11, 2019

Had an similar error. Restarting the system fixed it for me.

Apparently the system tried at some point an shutdown but it was interrupted. While trying to shutdown the OS stopped some services or driver required for docker.

@andrebacaglini
Copy link

As @Christowiak say, Turn off fast startup works for me.
Uncheck Turn on fast startup and save. enjoy!
Control Panel > Hardware and Sound > Power Options > System Settings
windows 10 fast startup

Disabling fast startup worked for me!

@docker-robott
Copy link
Collaborator

Closed issues are locked after 30 days of inactivity.
This helps our team focus on active issues.

If you have found a problem that seems similar to this, please open a new issue.

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

@docker docker locked and limited conversation to collaborators Jun 23, 2020
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Projects
None yet
Development

No branches or pull requests