End of Stream encountered before parsing was completed

Expected behavior

Docker runs.

Actual behavior

Docker fails to run. Shows error in toast: End of Stream encountered before parsing was completed.

Steps to reproduce the behavior

  1. Download Docker for Windows Beta 13
  2. Install
  3. Run
  4. Wait for it…

Information

  • Already tried uninstalling, restart and reinstalling.
  • VM exists.
  • DockerNAT exists.
  • All Docker-related firewall entries allowed.

Log

Docker log

[21:05:15.251][Program        ][Info   ] Version 1.11.1-beta13 (build: 3441)
[21:05:15.251][Program        ][Info   ] Starting on: 5/25/2016 21:05:15
[21:05:15.251][Program        ][Info   ] Resources: C:\Program Files\Docker\Docker\Resources
[21:05:15.251][Program        ][Info   ] OS: Windows 10 Pro N
[21:05:15.251][Program        ][Info   ] Edition: ProfessionalN
[21:05:15.251][Program        ][Info   ] Id: 1511
[21:05:15.251][Program        ][Info   ] Build: 10586
[21:05:15.256][Program        ][Info   ] BuildLabName: 10586.306.amd64fre.th2_release_sec.160422-1850
[21:05:15.257][Program        ][Info   ] Mixpanel Id: 750A7C18-F78B-432F-A452-C1CB9D66D76B
[21:05:15.258][Program        ][Info   ] Sha1: 5307146e79f6a634960d05da93adc33cf602d1f1
[21:05:15.258][Program        ][Info   ] You can send feedback, including this log file, at https://forums.docker.com/c/docker-for-windows
[21:05:15.421][Mixpanel       ][Info   ] Tracking: appLaunched
[21:05:16.029][NamedPipeClient][Info   ] Sending Version()...
[21:05:16.054][NamedPipeClient][Info   ] Received response for Version
[21:05:16.061][Mixpanel       ][Info   ] Tracking: heartbeat
[21:02:26.913][BackendServer  ][Info   ] Started
[21:05:16.044][NamedPipeServer][Info   ] Version()
[21:05:16.049][NamedPipeServer][Info   ] Version done.
[21:05:16.216][NamedPipeClient][Info   ] Sending CheckInstallation()...
[21:05:16.216][NamedPipeServer][Info   ] CheckInstallation()
[21:05:16.216][HyperV         ][Info   ] Check Hyper-V Windows optional feature
[21:05:16.241][PowerShell     ][Info   ] Run script...
[21:05:18.051][HyperV         ][Info   ] Hyper-V Windows feature is enabled
[21:05:18.051][NamedPipeServer][Info   ] CheckInstallation done.
[21:05:18.051][NamedPipeClient][Info   ] Received response for CheckInstallation
[21:05:18.051][NamedPipeClient][Info   ] Sending CheckHyperVState()...
[21:05:18.051][NamedPipeServer][Info   ] CheckHyperVState()
[21:05:18.056][HyperV         ][Info   ] Check Hyper-V Service State
[21:05:18.069][PowerShell     ][Info   ] Run script with parameters: -Check True...
[21:05:23.018][HyperV         ][Info   ] Hyper-V is running and responding
[21:05:23.023][HyperV         ][Info   ] Hyper-V is running
[21:05:23.023][NamedPipeServer][Info   ] CheckHyperVState done.
[21:05:23.023][NamedPipeClient][Info   ] Received response for CheckHyperVState
[21:05:23.223][Authentication ][Info   ] Checking token
[21:05:23.314][Authentication ][Info   ] Token is valid
[21:05:23.468][Notifications  ][Info   ] Docker is Initializing...
[21:05:23.473][Updater        ][Info   ] Checking for updates on channel Beta...
[21:05:23.488][NamedPipeClient][Info   ] Sending Stop()...
[21:05:23.488][NamedPipeServer][Info   ] Stop()
[21:05:23.488][HyperV         ][Info   ] Stop
[21:05:23.488][PowerShell     ][Info   ] Run script with parameters: -Stop True...
[21:05:24.267][Updater        ][Info   ] Found remote version. Version = 1.11.1.3441
[21:05:24.268][Updater        ][Info   ] Local version is up to date.
[21:05:24.279][Updater        ][Info   ] Check for updates done.
[21:05:26.845][HyperV         ][Info   ] Kill VM MobyLinuxVM...
[21:05:26.875][HyperV         ][Info   ] VM MobyLinuxVM is stopped
[21:05:26.885][Firewall       ][Info   ] Closing ports...
[21:05:26.885][PowerShell     ][Info   ] Run script...
[21:05:28.926][Firewall       ][Info   ] Ports are closed
[21:05:28.931][HyperVGuids    ][Info   ] Removing GUIDs...
[21:05:28.931][HyperVGuids    ][Info   ] GUIDs removed
[21:05:28.931][NamedPipeClient][Info   ] Received response for Stop
[21:05:28.931][NamedPipeServer][Info   ] Stop done.
[21:05:29.051][NamedPipeClient][Info   ] Sending Start(2, 2048, auto, 10.0.75.0, 24)...
[21:05:29.051][NamedPipeServer][Info   ] Start(2, 2048, auto, 10.0.75.0, 24)
[21:05:29.056][HyperVGuids    ][Info   ] Installing GUIDs...
[21:05:29.056][HyperVGuids    ][Info   ] GUIDs installed
[21:05:29.061][Firewall       ][Info   ] Opening ports for C:\Program Files\Docker\Docker\Resources\com.docker.proxy.exe and C:\Program Files\Docker\Docker\com.docker.service...
[21:05:29.061][PowerShell     ][Info   ] Run script...
[21:05:30.636][Firewall       ][Info   ] Ports are opened
[21:05:30.641][HyperV         ][Info   ] Create
[21:05:30.641][PowerShell     ][Info   ] Run script with parameters: -Create True -SwitchSubnetAdress 10.0.75.0 -SwitchSubnetMaskSize 24 -CPUs 2 -Memory 2048 -IsoFile C:\Program Files\Docker\Docker\Resources\mobylinux.iso...
[21:05:33.712][HyperV         ][Info   ] True
[21:05:33.974][HyperV         ][Info   ] Using existing Switch: DockerNAT
[21:05:34.462][HyperV         ][Info   ] Using existing Switch IP address
[21:05:34.502][HyperV         ][Info   ] Using existing Net NAT: DockerNAT
[21:05:35.719][HyperV         ][Info   ] Using existing: MobyLinuxVM
[21:05:36.045][HyperV         ][Info   ] Setting MobyLinuxVM vm CPUs to 2 and Memory to 2048 MB
[21:05:36.045][PowerShell     ][Info   ] Run script...
[21:05:37.109][DhcpServer     ][Info   ] Dhcp starting on port 67, on interface vEthernet (DockerNAT)...
[21:05:37.164][DhcpServer     ][Info   ] Dhcp started.
[21:05:37.169][ProxyProcess   ][Info   ] Starting...
[21:05:37.169][PowerShell     ][Info   ] Run script...
[21:05:37.570][ProxyProcess   ][Info   ] Using Poison pill parent: com.docker.service
[21:05:37.575][ProxyProcess   ][Info   ] Using VM Id: 3d9ded26-4c56-4f93-8961-d33544cb8df3
[21:05:37.576][ProxyProcess   ][Info   ] Using DB path: C:\ProgramData\Docker\database
[21:05:37.576][ProxyProcess   ][Info   ] Name server: auto
[21:05:37.615][ProxyProcess   ][Info   ] Started
[21:05:37.615][HyperV         ][Info   ] Start
[21:05:37.615][PowerShell     ][Info   ] Run script with parameters: -Start True...
[21:05:37.650][ProxyProcess   ][Info   ] Start com.docker.db.exe
[21:05:37.660][ProxyProcess   ][Info   ] Start com.docker.slirp.exe
[21:05:37.681][ProxyProcess   ][Info   ] docker proxy (on deprecated port): ready
[21:05:37.683][ProxyProcess   ][Info   ] dns server: ready
[21:05:37.684][ProxyProcess   ][Info   ] poison pill com.docker.service
[21:05:37.687][ProxyProcess   ][Info   ] docker proxy: ready
[21:05:37.704][ProxyProcess   ][Info   ] Manager: connect
[21:05:37.704][ProxyProcess   ][Info   ] 
[21:05:37.705][ProxyProcess   ][Info   ] +000us Datakit     Starting com.docker.db...
[21:05:37.714][ProxyProcess   ][Info   ] Manager: configuring
[21:05:41.693][HyperV         ][Info   ] Starting VM MobyLinuxVM...
[21:05:42.429][HyperV         ][Info   ] Wait for the VM to get an IP address
[21:05:43.458][HyperV         ][Info   ] Wait for the VM to get an IP address
[21:05:44.480][HyperV         ][Info   ] Wait for the VM to get an IP address
[21:05:45.524][HyperV         ][Info   ] Wait for the VM to get an IP address
[21:05:46.570][HyperV         ][Info   ] Wait for the VM to get an IP address
[21:05:48.106][HyperV         ][Info   ] Wait for the VM to get an IP address
[21:05:49.154][HyperV         ][Info   ] Wait for the VM to get an IP address
[21:05:50.173][HyperV         ][Info   ] Wait for the VM to get an IP address
[21:05:51.189][HyperV         ][Info   ] Wait for the VM to get an IP address
[21:05:52.221][HyperV         ][Info   ] Wait for the VM to get an IP address
[21:05:53.472][DhcpServer     ][Info   ] DISCOVER received from 00:15:5D:4B:01:07
[21:05:53.481][DhcpServer     ][Info   ] Offer (10.0.75.2) to (00:15:5D:4B:01:07)...
[21:05:53.490][DhcpServer     ][Info   ] Offer sent.
[21:05:53.491][DhcpServer     ][Info   ] DISCOVER processed.
[21:05:53.516][DhcpServer     ][Info   ] REQUEST received from 00:15:5D:4B:01:07
[21:05:53.521][DhcpServer     ][Info   ] Ack (10.0.75.2) to (00:15:5D:4B:01:07)...
[21:05:53.522][IpWriter       ][Info   ] Write VM's IP (10.0.75.2) to C:\Users\Public\Documents\Hyper-V\Virtual hard disks\MobyLinuxVM.ip
[21:05:53.776][HyperV         ][Info   ] Wait for the VM to get an IP address
[21:05:54.576][DhcpServer     ][Info   ] REQUEST received from 00:15:5D:4B:01:07
[21:05:55.242][HyperV         ][Info   ] Wait for the VM to get an IP address
[21:05:55.637][DhcpServer     ][Info   ] REQUEST received from 00:15:5D:4B:01:07
[21:05:56.277][HyperV         ][Info   ] Wait for the VM to get an IP address
[21:05:56.696][DhcpServer     ][Info   ] REQUEST received from 00:15:5D:4B:01:07
[21:05:57.296][HyperV         ][Info   ] Wait for the VM to get an IP address
[21:05:57.596][DhcpServer     ][Info   ] REQUEST received from 00:15:5D:4B:01:07
[21:05:58.331][HyperV         ][Info   ] Wait for the VM to get an IP address
[21:05:59.661][HyperV         ][Info   ] Wait for the VM to get an IP address
[21:06:00.739][HyperV         ][Info   ] Wait for the VM to get an IP address
[21:06:01.757][HyperV         ][Info   ] Wait for the VM to get an IP address
[21:06:02.775][HyperV         ][Info   ] Wait for the VM to get an IP address
[21:06:03.804][HyperV         ][Info   ] Wait for the VM to get an IP address
[21:06:05.174][HyperV         ][Info   ] Wait for the VM to get an IP address
[21:06:06.195][HyperV         ][Info   ] Wait for the VM to get an IP address
[21:06:07.213][HyperV         ][Info   ] Wait for the VM to get an IP address
[21:06:08.232][HyperV         ][Info   ] Wait for the VM to get an IP address
[21:06:09.237][Notifications  ][Error  ] End of Stream encountered before parsing was completed.
[21:06:09.240][NamedPipeClient][Info   ] Sending GetDebugInfo()...
[21:06:10.227][NamedPipeClient][Info   ] Sending GetDebugInfo()...
[21:06:11.227][NamedPipeClient][Info   ] Sending GetDebugInfo()...
[21:06:12.227][NamedPipeClient][Info   ] Sending GetDebugInfo()...
[21:06:13.227][NamedPipeClient][Info   ] Sending GetDebugInfo()...
[21:06:14.227][NamedPipeClient][Info   ] Sending GetDebugInfo()...
[21:06:22.944][Program        ][Info   ] Sending Bugsnag report 5cf6ef50-6023-4206-80b6-d7c71943dcd0 ...
[21:06:23.547][Program        ][Info   ] Bugsnag report sent
[21:06:23.975][NamedPipeClient][Info   ] Sending GetVmMaxMemory()...
[21:06:24.961][NamedPipeClient][Info   ] Sending GetVmMaxMemory()...
[21:06:25.965][NamedPipeClient][Info   ] Sending GetVmMaxMemory()...
[21:06:26.965][NamedPipeClient][Info   ] Sending GetVmMaxMemory()...
[21:06:27.961][NamedPipeClient][Info   ] Sending GetVmMaxMemory()...
[21:06:28.963][NamedPipeClient][Info   ] Sending GetVmMaxMemory()...
[21:06:29.980][Program        ][Error  ] Failed to connect to dockerBackend: time out
[21:06:29.980][Program        ][Info   ] Sending Bugsnag report 345fc104-64aa-4176-a335-c497d28b6c30 ...
[21:06:30.225][Program        ][Info   ] Bugsnag report sent

Error: .NET Runtime (5/25/2016 21:05:53)

Application: com.docker.service
Framework Version: v4.0.30319
Description: The process was terminated due to an unhandled exception.
Exception Info: System.IO.DirectoryNotFoundException
   at System.IO.__Error.WinIOError(Int32, System.String)
   at System.IO.FileStream.Init(System.String, System.IO.FileMode, System.IO.FileAccess, Int32, Boolean, System.IO.FileShare, Int32, System.IO.FileOptions, SECURITY_ATTRIBUTES, System.String, Boolean, Boolean, Boolean)
   at System.IO.FileStream..ctor(System.String, System.IO.FileMode, System.IO.FileAccess, System.IO.FileShare, Int32, System.IO.FileOptions, System.String, Boolean, Boolean, Boolean)
   at System.IO.StreamWriter.CreateFile(System.String, Boolean, Boolean)
   at System.IO.StreamWriter..ctor(System.String, Boolean, System.Text.Encoding, Int32, Boolean)
   at System.IO.File.InternalWriteAllText(System.String, System.String, System.Text.Encoding, Boolean)
   at Docker.Backend.Dhcp.IpWriter.Write(System.String)
   at Docker.Backend.Dhcp.DhcpServer.SendAck(Docker.Backend.Dhcp.DhcpMessage, Docker.Backend.Dhcp.AddressLease)
   at Docker.Backend.Dhcp.DhcpServer.DhcpRequest(Docker.Backend.Dhcp.DhcpMessage)
   at Docker.Backend.Dhcp.DhcpServer.CompleteRequest(System.Object)
   at System.Threading.ExecutionContext.RunInternal(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.ExecutionContext.Run(System.Threading.ExecutionContext, System.Threading.ContextCallback, System.Object, Boolean)
   at System.Threading.QueueUserWorkItemCallback.System.Threading.IThreadPoolWorkItem.ExecuteWorkItem()
   at System.Threading.ThreadPoolWorkQueue.Dispatch()

Error: Application Error (5/25/2016 21:05:53)

Faulting application name: com.docker.service, version: 1.11.1.3441, time stamp: 0x574484d0
Faulting module name: KERNELBASE.dll, version: 10.0.10586.306, time stamp: 0x571af331
Exception code: 0xe0434352
Fault offset: 0x0000000000071f28
Faulting process id: 0x11c0
Faulting application start time: 0x01d1b6ea451776ee
Faulting application path: C:\Program Files\Docker\Docker\com.docker.service
Faulting module path: C:\WINDOWS\system32\KERNELBASE.dll
Report Id: a2cc59d0-3b33-45b1-8bc0-83c370bddc97
Faulting package full name: 
Faulting package-relative application ID: 

It seems like Docker is trying to write a file to the standard Hyper-V folder.
On my system I am using another location for the Hyper-V virtual disks and I was encountering the same error as above (End of stream…)

I solved the problem above by manually creating a folder named:
C:\Users\Public\Documents\Hyper-V\Virtual hard disks

Thanks! That worked!

But I believe this is a bug. In this case, my Users directory isn’t in C drive. I think Docker should not assume C drive in this case.