docker / for-win

Bug reports for Docker Desktop for Windows
https://www.docker.com/products/docker#/windows
1.86k stars 288 forks source link

Unable to create: The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: The object already exists. #599

Open charany1 opened 7 years ago

charany1 commented 7 years ago

Expected behavior

Docker should run .

Actual behavior

Fails.

Information

Steps to reproduce the behavior

1.start docker

Logs :

Version: 17.03.0-ce-win1 (10296) Channel: stable Sha1: e5a07a1a69a5123c71e24ca2aa9e6f875fa26d08 Started on: 2017/03/21 17:47:40.846 Resources: C:\Program Files\Docker\Docker\Resources OS: Windows 10 Enterprise Edition: Enterprise Id: 1511 Build: 10586 BuildLabName: 10586.839.amd64fre.th2_release.170303-1605 File: C:\Users\danchara\AppData\Local\Docker\log.txt CommandLine: "C:\Program Files\Docker\Docker\Docker for Windows.exe" You can send feedback, including this log file, at https://github.com/docker/for-win/issues [17:47:41.010][GUI ][Info ] Starting... [17:47:41.456][Tracking ][Info ] Crash report and usage statistics are enabled [17:47:41.465][SegmentApi ][Info ] Usage statistic: appLaunched [17:47:41.605][NamedPipeClient][Info ] Sending Version()... [17:47:41.621][NamedPipeClient][Info ] Received response for Version [17:47:41.622][SegmentApi ][Info ] Usage statistic: heartbeat [17:46:27.058][BackendServer ][Info ] Started [17:47:41.619][NamedPipeServer][Info ] Version() [17:47:41.619][NamedPipeServer][Info ] Version done in 00:00:00. [17:47:41.968][Updater ][Info ] Checking for updates on channel stable... [17:47:41.971][NamedPipeClient][Info ] Sending Start(Docker.Core.Settings)... [17:47:41.976][NamedPipeServer][Info ] Start(Docker.Core.Settings) [17:47:41.980][PowerMode ][Info ] Stop [17:47:41.989][HyperV ][Info ] Stop [17:47:42.004][Updater ][Info ] Local build 10296 is as good as the remote 10296 on channel stable [17:47:42.001][PowerShell ][Info ] Run script with parameters: -Stop True... [17:47:42.003][PowerShell ][Info ] Creating a Runspace Pool... [17:47:42.727][PowerShell ][Info ] Runspace Pool created (Min=1, Max=2) [17:47:42.788][HyperV ][Info ] Script started at 17:47:42.779 [17:47:50.309][HyperV ][Info ] Module loaded at 17:47:50.309 [17:47:51.144][HyperV ][Info ] VM MobyLinuxVM does not exist [17:47:51.145][HyperV ][Debug ] [stop] took 00:00:09.1534788 to run [17:47:51.145][OptimizeDisk ][Info ] Optimize [17:47:51.146][PowerShell ][Info ] Run script... [17:47:51.204][Moby ][Info ] Stop [17:47:51.246][HyperVGuids ][Info ] Installing GUIDs... [17:47:51.246][PowerMode ][Info ] Start [17:47:51.252][Firewall ][Info ] Removing all existing rules... [17:47:51.252][HyperV ][Info ] Create [17:47:51.257][PowerShell ][Info ] Run script with parameters: -Create True -VhdPathOverride -SwitchSubnetAddress 10.0.75.0 -SwitchSubnetMaskSize 24 -CPUs 2 -Memory 2048 -IsoFile C:\Program Files\Docker\Docker\Resources\mobylinux.iso... [17:47:51.270][HyperV ][Info ] Script started at 17:47:51.269 [17:47:51.285][HyperVGuids ][Info ] GUIDs installed [17:47:51.311][Firewall ][Info ] All existing rules are removed. [17:47:51.311][Firewall ][Info ] Opening ports for C:\Program Files\Docker\Docker\Resources\com.docker.proxy.exe... [17:47:51.368][Firewall ][Info ] Opening ports for SMB... [17:47:51.427][Firewall ][Info ] Ports are opened [17:47:51.470][HyperV ][Info ] Module loaded at 17:47:51.470 [17:47:52.401][HyperV ][Info ] Enabled workaround for Build 10586 VMSwitch issue [17:48:14.671][HyperV ][Info ] Creating Switch: DockerNAT... [17:48:20.130][HyperV ][Info ] Switch created. [17:48:21.578][Linux ][Error ] Failed to start: Unable to create: The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: The object already exists.

. Let's retry [17:48:21.579][PowerShell ][Info ] Run script... [17:48:28.056][HyperV ][Info ] Hyper-V is running [17:48:28.056][PowerMode ][Info ] Stop [17:48:28.056][HyperV ][Info ] Stop [17:48:28.056][PowerShell ][Info ] Run script with parameters: -Stop True... [17:48:28.056][HyperV ][Info ] Script started at 17:48:28.056 [17:48:28.125][HyperV ][Info ] Module loaded at 17:48:28.125 [17:48:28.141][HyperV ][Info ] VM MobyLinuxVM does not exist [17:48:28.141][HyperV ][Debug ] [stop] took 00:00:00.0846582 to run [17:48:28.141][OptimizeDisk ][Info ] Optimize [17:48:28.141][PowerShell ][Info ] Run script... [17:48:28.157][Moby ][Info ] Stop [17:48:28.157][HyperV ][Info ] Destroy [17:48:28.157][PowerShell ][Info ] Run script with parameters: -Destroy True -KeepVolume True... [17:48:28.172][HyperV ][Info ] Script started at 17:48:28.172 [17:48:28.241][HyperV ][Info ] Module loaded at 17:48:28.241 [17:48:28.241][HyperV ][Info ] VM MobyLinuxVM does not exist [17:48:28.241][HyperV ][Info ] Destroying Switch DockerNAT... [17:48:35.746][HyperV ][Info ] Removing VM MobyLinuxVM... [17:48:35.765][HyperV ][Debug ] [destroy] took 00:00:07.6088805 to run [17:48:35.766][Firewall ][Info ] Closing ports... [17:48:35.766][Firewall ][Info ] Removing all existing rules... [17:48:35.888][Firewall ][Info ] All existing rules are removed. [17:48:35.888][Firewall ][Info ] Ports are closed [17:48:35.888][HyperVGuids ][Info ] Removing GUIDs... [17:48:35.894][HyperVGuids ][Info ] GUIDs removed [17:48:35.894][HyperV ][Info ] Create [17:48:35.895][PowerShell ][Info ] Run script with parameters: -Create True -VhdPathOverride -SwitchSubnetAddress 10.0.75.0 -SwitchSubnetMaskSize 24 -CPUs 2 -Memory 2048 -IsoFile C:\Program Files\Docker\Docker\Resources\mobylinux.iso... [17:48:35.903][HyperV ][Info ] Script started at 17:48:35.902 [17:48:35.996][HyperV ][Info ] Module loaded at 17:48:35.995 [17:48:36.100][HyperV ][Info ] Enabled workaround for Build 10586 VMSwitch issue [17:48:43.832][HyperV ][Info ] Creating Switch: DockerNAT... [17:48:48.290][HyperV ][Info ] Switch created. [17:48:48.909][PowerMode ][Info ] Stop [17:48:48.909][HyperV ][Info ] Stop [17:48:48.909][PowerShell ][Info ] Run script with parameters: -Stop True... [17:48:48.921][HyperV ][Info ] Script started at 17:48:48.921 [17:48:49.022][HyperV ][Info ] Module loaded at 17:48:49.021 [17:48:49.047][HyperV ][Info ] VM MobyLinuxVM does not exist [17:48:49.047][HyperV ][Debug ] [stop] took 00:00:00.1385207 to run [17:48:49.047][OptimizeDisk ][Info ] Optimize [17:48:49.047][PowerShell ][Info ] Run script... [17:48:49.064][Moby ][Info ] Stop [17:48:49.071][HyperV ][Info ] Destroy [17:48:49.072][PowerShell ][Info ] Run script with parameters: -Destroy True -KeepVolume True... [17:48:49.084][HyperV ][Info ] Script started at 17:48:49.083 [17:48:49.184][HyperV ][Info ] Module loaded at 17:48:49.184 [17:48:49.201][HyperV ][Info ] VM MobyLinuxVM does not exist [17:48:49.202][HyperV ][Info ] Destroying Switch DockerNAT... [17:48:52.022][HyperV ][Info ] Removing VM MobyLinuxVM... [17:48:52.060][HyperV ][Debug ] [destroy] took 00:00:02.9883251 to run [17:48:52.060][Firewall ][Info ] Closing ports... [17:48:52.060][Firewall ][Info ] Removing all existing rules... [17:48:52.090][Firewall ][Info ] All existing rules are removed. [17:48:52.090][Firewall ][Info ] Ports are closed [17:48:52.090][HyperVGuids ][Info ] Removing GUIDs... [17:48:52.090][HyperVGuids ][Info ] GUIDs removed [17:48:52.096][NamedPipeServer][Error ] Unable to execute Start: Unable to create: The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: The object already exists.

at Docker.Backend.HyperV.RunScript(String action, Dictionary`2 parameters)

at Docker.Backend.ContainerEngine.Linux.Start(Settings settings) at Docker.Core.Pipe.NamedPipeServer.<>c__DisplayClass8_0.b__0(Object[] parameters) at Docker.Core.Pipe.NamedPipeServer.RunAction(String action, Object[] parameters) [17:48:52.271][NamedPipeClient][Error ] Unable to send Start: Unable to create: The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: The object already exists.

[17:48:52.273][Notifications ][Error ] Unable to create: The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: The object already exists.

[18:44:56.818][ErrorReportWindow][Info ] Open logs [18:47:02.521][SegmentApi ][Info ] Usage statistic: eventElectedForFeature [18:47:02.524][SegmentApi ][Info ] Usage statistic: stateFeatureEnabled [18:47:08.380][SegmentApi ][Info ] Usage statistic: actionMenuFeedback [18:47:08.645][NamedPipeClient][Info ] Sending GetDefaultVhdxPath()... [18:47:08.651][NamedPipeServer][Info ] GetDefaultVhdxPath() [18:47:08.769][NamedPipeServer][Info ] GetDefaultVhdxPath done in 00:00:00.1190006. [18:47:08.771][NamedPipeClient][Info ] Received response for GetDefaultVhdxPath [18:47:15.869][SegmentApi ][Info ] Usage statistic: actionRestart [18:47:15.873][Notifications ][Info ] Docker is restarting... [18:47:15.906][NamedPipeClient][Info ] Sending Restart(Docker.Core.Settings)... [18:47:15.908][NamedPipeServer][Info ] Restart(Docker.Core.Settings) [18:47:15.910][PowerMode ][Info ] Stop [18:47:15.910][HyperV ][Info ] Stop [18:47:15.913][PowerShell ][Info ] Run script with parameters: -Stop True... [18:47:15.961][HyperV ][Info ] Script started at 18:47:15.959 [18:47:16.160][HyperV ][Info ] Module loaded at 18:47:16.159 [18:47:16.183][HyperV ][Info ] VM MobyLinuxVM does not exist [18:47:16.184][HyperV ][Debug ] [stop] took 00:00:00.2740009 to run [18:47:16.184][OptimizeDisk ][Info ] Optimize [18:47:16.184][PowerShell ][Info ] Run script... [18:47:16.196][Moby ][Info ] Stop [18:47:16.202][PowerMode ][Info ] Stop [18:47:16.202][HyperV ][Info ] Stop [18:47:16.203][PowerShell ][Info ] Run script with parameters: -Stop True... [18:47:16.216][HyperV ][Info ] Script started at 18:47:16.215 [18:47:16.320][HyperV ][Info ] Module loaded at 18:47:16.320 [18:47:16.336][HyperV ][Info ] VM MobyLinuxVM does not exist [18:47:16.337][HyperV ][Debug ] [stop] took 00:00:00.1341345 to run [18:47:16.337][OptimizeDisk ][Info ] Optimize [18:47:16.337][PowerShell ][Info ] Run script... [18:47:16.355][Moby ][Info ] Stop [18:47:16.362][HyperV ][Info ] Create [18:47:16.363][PowerMode ][Info ] Start [18:47:16.363][PowerShell ][Info ] Run script with parameters: -Create True -VhdPathOverride -SwitchSubnetAddress 10.0.75.0 -SwitchSubnetMaskSize 24 -CPUs 2 -Memory 2048 -IsoFile C:\Program Files\Docker\Docker\Resources\mobylinux.iso... [18:47:16.364][HyperVGuids ][Info ] Installing GUIDs... [18:47:16.364][Firewall ][Info ] Removing all existing rules... [18:47:16.379][HyperV ][Info ] Script started at 18:47:16.377 [18:47:16.398][HyperVGuids ][Info ] GUIDs installed [18:47:16.409][Firewall ][Info ] All existing rules are removed. [18:47:16.409][Firewall ][Info ] Opening ports for C:\Program Files\Docker\Docker\Resources\com.docker.proxy.exe... [18:47:16.420][Firewall ][Info ] Opening ports for SMB... [18:47:16.437][Firewall ][Info ] Ports are opened [18:47:16.475][HyperV ][Info ] Module loaded at 18:47:16.475 [18:47:16.551][HyperV ][Info ] Enabled workaround for Build 10586 VMSwitch issue [18:47:23.116][HyperV ][Info ] Creating Switch: DockerNAT... [18:47:28.700][HyperV ][Info ] Switch created. [18:47:29.853][NamedPipeClient][Error ] Unable to send Restart: Unable to create: The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: The object already exists.

[18:47:29.854][Notifications ][Error ] Unable to create: The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: The object already exists.

[18:47:29.822][NamedPipeServer][Error ] Unable to execute Restart: Unable to create: The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: The object already exists.

at Docker.Backend.ContainerEngine.Linux.DoStart(Settings settings)

at Docker.Backend.ContainerEngine.Linux.Restart(Settings settings) at Docker.Core.Pipe.NamedPipeServer.<>c__DisplayClass8_0.b__0(Object[] parameters) at Docker.Core.Pipe.NamedPipeServer.RunAction(String action, Object[] parameters) [18:47:41.716][SegmentApi ][Info ] Usage statistic: heartbeat [18:50:27.621][ErrorReportWindow][Info ] Open logs [18:50:55.748][CrashReport ][Info ] Preparing package to send with the diagnostics [18:50:55.752][NamedPipeClient][Info ] Sending DownloadVpnKitLogs(C:\Users\danchara\AppData\Local\Temp\a2l1mesw.ykl\pcap.tar)... [18:50:55.753][NamedPipeClient][Info ] Sending GetDebugInfo()... [18:50:55.764][NamedPipeClient][Info ] Sending DownloadVmLogs(C:\Users\danchara\AppData\Local\Temp\a2l1mesw.ykl\mobyLogs.tar)... [18:50:55.767][NamedPipeClient][Info ] Sending DownloadWinContainersDebugInfo(C:\Users\danchara\AppData\Local\Temp\a2l1mesw.ykl\win_containers)... [18:50:56.725][NamedPipeServer][Info ] GetDebugInfo() [18:50:56.727][NamedPipeServer][Info ] DownloadWinContainersDebugInfo(C:\Users\danchara\AppData\Local\Temp\a2l1mesw.ykl\win_containers) [18:50:56.728][NamedPipeServer][Info ] DownloadVpnKitLogs(C:\Users\danchara\AppData\Local\Temp\a2l1mesw.ykl\pcap.tar) [18:50:56.730][NamedPipeServer][Info ] DownloadVmLogs(C:\Users\danchara\AppData\Local\Temp\a2l1mesw.ykl\mobyLogs.tar) [18:50:56.736][NamedPipeClient][Info ] Received response for DownloadVpnKitLogs [18:50:56.735][VpnKit ][Warning] Unable to download logs: The operation has timed out. [18:50:56.735][NamedPipeServer][Info ] DownloadVpnKitLogs done in 00:00:00.0070001. [18:50:56.761][PowerShell ][Info ] Run script '(Get-VM MobyLinuxVM).Id.Guid'... [18:50:56.785][NamedPipeClient][Info ] Received response for DownloadVmLogs [18:50:56.784][HyperV ][Warning] Unable to download logs: The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: Hyper-V was unable to find a virtual machine with name "MobyLinuxVM". [18:50:56.784][NamedPipeServer][Info ] DownloadVmLogs done in 00:00:00.0540007. [18:51:15.075][NamedPipeClient][Info ] Received response for DownloadWinContainersDebugInfo [18:51:15.075][NamedPipeServer][Info ] DownloadWinContainersDebugInfo done in 00:00:18.3476661. [18:51:28.215][NamedPipeServer][Info ] GetDebugInfo done in 00:00:31.4896089. [18:51:28.217][NamedPipeClient][Info ] Received response for GetDebugInfo [18:51:29.170][CrashReport ][Info ] Uploading diagnostics... [18:51:33.865][CrashReport ][Info ] Diagnostics successfully uploaded (F99F3A73-FF98-4CC7-BBF5-F0799AE39122/2017-03-21_18-50-55) [18:51:33.896][GUI ][Info ] Sending Bugsnag report 50d29af0-fbb2-40e6-a870-0741687d718f... [18:51:35.002][GUI ][Info ] Bugsnag report 50d29af0-fbb2-40e6-a870-0741687d718f sent [18:53:25.152][ErrorReportWindow][Info ] Open logs

output of docker version :

$ docker version Client: Version: 17.03.0-ce API version: 1.26 Go version: go1.7.5 Git commit: 60ccb22 Built: Thu Feb 23 10:40:59 2017 OS/Arch: windows/amd64 error during connect: Get http://%2F%2F.%2Fpipe%2Fdocker_engine/v1.26/version: 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.

N-Andronopoulos commented 7 years ago

I fixed this problem by deleting a line in MobyLinux.ps1 @ ~164 line. (If you have installed Docker before) $networkAdapter | New-NetIPAddress -AddressFamily IPv4 -IPAddress $switchAddress -PrefixLength ($SwitchSubnetMaskSize) -ea Stop | Out-Null

You can run this file with powershell.\MobyLinux.ps1 -IsoFile .\mobylinux.iso -Create The file is under C:\Program Files\Docker\Docker\resources

charany1 commented 7 years ago

I am using Docker Toolbox , at least it works.

sherryhw commented 7 years ago

Here is my solution:

Device manager --> Network Adapters --> delete all the Hyper-V Virtual Ethernet Adapters. Restart the docker and it will automatically create an Hyper-V Virtual Ethernet Adapters. Keep an eyes on the device manager and make sure there is only one Hyper-V adapter. After this I think it should be allset for this issue. Thought sometime I will end up with another issue like "Docker hv-sock proxy (vsudd) is not reachable". However, each time when we uninstall and reinstall the docker, we should keep an eye on that Hyper-V adapters and make sure there is only one.

RehanSaeed commented 7 years ago

I've also been getting this error with the latest 17.09-CE update. I've tried all workarounds on this issue and tried reinstalling multiple times but to no avail as of yet. Docker is great but so many bugs...

pfluegs commented 6 years ago

Any update on this issue? Have not been able to find a suitable workaround and would love to get Docker up and running!

mboorstin commented 6 years ago

I just had some troubles with this bug as well. Yesterday (12/13/2017), Docker started throwing a The object already exists. error. Following this issue and similar ones I found a broken Hyper-V network adapter and deleted it from Device Manager, and confirmed that it was gone from Device Manager, but Docker kept throwing the error. I then tried the usual Docker factory reset, Docker uninstall / reinstall, and Hyper-V disable / re-enable (at some point during this all of Docker's VM's were removed from Hyper-V's listing, which presumably also cleaned up their network adapters), but none of those actions fixed it.

@N-Andronopoulos's solution of commenting out a line in MobyLinux.ps1 did fix the issue (for me it was line 166), but I'm a little sketched out by modifying Docker's internal scripts.

It is worth noting that there were 3 Windows Updates installed yesterday (KB890830, KB4053579, KB4053577). KB4053579 is a "Cumulative Update for Windows 10", and the timing certainly is suspicious, but it looks like this is a fairly old issue so I'm reluctant to blame it for the issue (updates ran without a hitch on 11/30/2017, so we presumably didn't install something yesterday that was causing problems in March, when this issue was opened).

I'm running Docker 17.09.1-ce-win42 (14687), stable, 3176a6a, on Windows 10 x64.

cc @benweissmann @aranair

AirLancer commented 6 years ago

Edit: Further Windows updates have resolved my issues.

Original Post: @mboorstin: Same here. Yesterday everything worked fine. When I left work last night I installed Windows updates and a Docker update (today). Now I have this issue. Docker Version 17.09.1-ce-win42 (14687), stable on Windows 10 Enterprise x64 Windows updates installed were: KB4053577 KB4053580 (cumulative) KB4011575 KB4011095

ghost commented 6 years ago

I had the same issue. Used @sherryhw 's solution and it worked perfectly. From control panel. >> Network and internet >> View Network Status >> Change adapter settings Look for Hyper-V adapters and disable or remove them, then reset Docker to factory settings and restart.

chamath commented 6 years ago

Few days before I updated windows 10 pro. After that docker is not starting properly. following error pops up.

Unable to create: The running command stopped because the preference variable "ErrorActionPreference" or common parameter is set to Stop: The object already exists.

at Docker.Core.Pipe.NamedPipeClient.Send(String action, Object[] parameters) in C:\gopath\src\github.com\docker\pinata\win\src\Docker.Core\pipe\NamedPipeClient.cs:line 36 at Docker.Actions.DoStart(SynchronizationContext syncCtx, Boolean showWelcomeWindow, Boolean executeAfterStartCleanup) in C:\gopath\src\github.com\docker\pinata\win\src\Docker.Windows\Actions.cs:line 67 at Docker.Actions.<>cDisplayClass14_0.b0() in C:\gopath\src\github.com\docker\pinata\win\src\Docker.Windows\Actions.cs:line 51 at Docker.WPF.TaskQueue.<>cDisplayClass19_0.<.ctor>b1() in C:\gopath\src\github.com\docker\pinata\win\src\Docker.WPF\TaskQueue.cs:line 59

Crash report id - 8F2B878B-5FE7-4061-9840-EBBB033237E3/2018-05-29_21-57-32

Please let us know if there any good solution for this? Searched everywhere. But found temporary or system specific solutions.

michaelsync commented 6 years ago

Yes. I am having the same issue after the windows update.

ericis commented 6 years ago

Tried to remove network switches directly from Hyper-V, although it failed to remove a Private network, so I disabled the associated network adapters for that network. Then I was able to switch to Linux containers. However, now I can't use Hyper-V 👎

Sicaine commented 6 years ago

Had the same issue, what worked was this script: https://github.com/MicrosoftDocs/Virtualization-Documentation/tree/live/windows-server-container-tools/CleanupContainerHostNetworking which is linked in a similiar post on my google search results below this one.

docker-robott commented 6 years ago

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

kevinhooke commented 5 years ago

Same issue, after Windows 10 update. Deleting all the broken and unused Hyper-V network connections did the trick for me, but I had to remove from the Control Panel Devices page as an admin, I couldn't delete them directions from the Network Connection (delete option was grayed out for me). Instructions to delete here: https://blogs.msdn.microsoft.com/jjameson/2011/03/14/removing-stale-network-adapters-in-hyper-v-vm/ Restarted Docker and it recreated what it needed at startup, all good

mikeparker commented 5 years ago

/lifecycle frozen

mikeparker commented 5 years ago

/remove-lifecycle stale