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

Docker Fails to Start/Unable to write to the Database

Open ghost opened this issue 9 years ago • 11 comments

Expected behavior

Docker Startup

Actual behavior

Docker Fails with error: Unable to write to the database. Exit code: 1 at Docker.Backend.ContainerEngine.Linux.DoStart(Settings settings) at Docker.Backend.ContainerEngine.Linux.Restart(Settings settings) at Docker.Core.Pipe.NamedPipeServer.<>c__DisplayClass9_0.b__0(Object[] parameters) at Docker.Core.Pipe.NamedPipeServer.RunAction(String action, Object[] parameters)

log.txt

Information

  • Diagnostic ID: 53C4B077-9C84-4132-A5B9-FCC5A51C883C/2017-06-29_17-15-48
  • Windows 10 Pro

Steps to reproduce the behavior

  1. Open Docker or Restart Docker

ghost avatar Jun 29 '17 22:06 ghost

Hi @Pirion This is due to a recent issue we discovered with the way we read computer names on startup, if your computer name is longer than 12 characters Docker will fail. We are working on it, but I don't have a specific timeframe for the fix. If you're able to - shorten your computer name and that should take care of it.

Here is the error from the logs:

[16:55:47.956][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 computer 'KAINE-ADAMS-HOM' could not be resolved. Make sure you typed the machine name correctly and that you have network access. at New-MobyLinuxVM, : line 222

jasonbivins avatar Jun 30 '17 15:06 jasonbivins

Thanks @jasonbivins - I've renamed the machine to 11 characters, however looks like startup is still having some of the same errors.

I updated to the edge version since the error and last attempt was logged as: 53C4B077-9C84-4132-A5B9-FCC5A51C883C/2017-06-30_10-52-50

ghost avatar Jun 30 '17 15:06 ghost

@Pirion Can you use the Reset feature under settings in the Gui and try again?

jasonbivins avatar Jun 30 '17 15:06 jasonbivins

I’m afraid still looks the same.

New Log: 53C4B077-9C84-4132-A5B9-FCC5A51C883C/2017-06-30_11-12-18

From: Jason Bivins [mailto:[email protected]] Sent: Friday, June 30, 2017 10:47 AM To: docker/for-win [email protected] Cc: Pirion [email protected]; Mention [email protected] Subject: Re: [docker/for-win] Docker Fails to Start/Unable to write to the Database (#871)

Hi @Pirion https://github.com/pirion This is due to a recent issue we discovered with the way we read computer names on startup, if your computer name is longer than 12 characters Docker will fail. We are working on it, but I don't have a specific timeframe for the fix. If you're able to - shorten your computer name and that should take care of it.

Here is the error from the logs:

[16:55:47.956][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 computer 'KAINE-ADAMS-HOM' could not be resolved. Make sure you typed the machine name correctly and that you have network access. at New-MobyLinuxVM, : line 222

— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/docker/for-win/issues/871#issuecomment-312302978 , or mute the thread https://github.com/notifications/unsubscribe-auth/AH2o-jsUO5cX1oUyFDmtzB3PnOlrC3OPks5sJRhYgaJpZM4OJ7-u . https://github.com/notifications/beacon/AH2o-mv5qPwCljcowSOQud5QTP2kcwg6ks5sJRhYgaJpZM4OJ7-u.gif

ghost avatar Jun 30 '17 16:06 ghost

Hi @Pirion I don't see the Hostname error - but now I only see Uncaught exception errors. What is your computer name currently set ot?

Let's completely remove docker - then try to reinstall - this is the script I use in testing when I want to completely wipe docker from my system: $ErrorActionPreference = "SilentlyContinue"

kill -force -processname 'Docker for Windows', com.docker.db, vpnkit, com.docker.proxy, com.docker.9pdb, moby-diag-dl, dockerd

try { ./MobyLinux.ps1 -Destroy } Catch {}

$service = Get-WmiObject -Class Win32_Service -Filter "Name='com.docker.service'" if ($service) { $service.StopService() } if ($service) { $service.Delete() } Start-Sleep -s 5 Remove-Item -Recurse -Force "~/AppData/Local/Docker" Remove-Item -Recurse -Force "~/AppData/Roaming/Docker" if (Test-Path "C:\ProgramData\Docker") { takeown.exe /F "C:\ProgramData\Docker" /R /A /D Y } if (Test-Path "C:\ProgramData\Docker") { icacls "C:\ProgramData\Docker" /T /C /grant Administrators:F } Remove-Item -Recurse -Force "C:\ProgramData\Docker" Remove-Item -Recurse -Force "C:\Program Files\Docker" Remove-Item -Recurse -Force "C:\ProgramData\Microsoft\Windows\Start Menu\Programs\Docker" Remove-Item -Force "C:\Users\Public\Desktop\Docker for Windows.lnk" Get-ChildItem HKLM:\software\microsoft\windows\currentversion\uninstall | % {Get-ItemProperty $.PSPath} | ? { $.DisplayName -eq "Docker" } | Remove-Item -Recurse -Force Get-ChildItem HKLM:\software\classes\installer\products | % {Get-ItemProperty $.pspath} | ? { $.ProductName -eq "Docker" } | Remove-Item -Recurse -Force Get-Item 'HKLM:\software\Docker Inc.' | Remove-Item -Recurse -Force Get-ItemProperty HKCU:\software\microsoft\windows\currentversion\Run -name "Docker for Windows" | Remove-Item -Recurse -Force #Get-ItemProperty HKCU:\software\microsoft\windows\currentversion\UFH\SHC | ForEach-Object {Get-ItemProperty $.PSPath} | Where-Object { $.ToString().Contains("Docker for Windows.exe") } | Remove-Item -Recurse -Force $.PSPath #Get-ItemProperty HKCU:\software\microsoft\windows\currentversion\UFH\SHC | Where-Object { $(Get-ItemPropertyValue $) -Contains "Docker" }

jasonbivins avatar Jun 30 '17 18:06 jasonbivins

I've removed/ran the script and installed the new version. No change in behavior.

New Name is PIRION-HOME.

53C4B077-9C84-4132-A5B9-FCC5A51C883C/2017-06-30_14-50-23

ghost avatar Jun 30 '17 19:06 ghost

MY computer name is 9 characters and docker crashes on load. See 52F7C608-A276-4EFF-96B7-481E6E6473FE/2017-07-03_20-24-12

chassq avatar Jul 04 '17 00:07 chassq

Hello,

I have the very same issue when switching to Linux Containers on Windows 2016

This is the log:

[10:09:16.946][HyperVGuids ][Info ] GUIDs removed [10:09:17.134][NamedPipeServer][Error ] Unable to execute Start: Unable to write to the database. Exit code: 1 at Docker.Backend.ContainerEngine.Linux.DoStart(Settings settings) in C:\gopath\src\github.com\docker\pinata\win\src\Docker.Backend\ContainerEngine\Linux.cs:line 247 at Docker.Backend.ContainerEngine.Linux.Start(Settings settings) in C:\gopath\src\github.com\docker\pinata\win\src\Docker.Backend\ContainerEngine\Linux.cs:line 123 at Docker.Core.Pipe.NamedPipeServer.<>c__DisplayClass9_0.b__0(Object[] parameters) in C:\gopath\src\github.com\docker\pinata\win\src\Docker.Core\pipe\NamedPipeServer.cs:line 47 at Docker.Core.Pipe.NamedPipeServer.RunAction(String action, Object[] parameters) in C:\gopath\src\github.com\docker\pinata\win\src\Docker.Core\pipe\NamedPipeServer.cs:line 145 [10:09:17.149][NamedPipeClient][Error ] Unable to send Start: Unable to write to the database. Exit code: 1 [10:09:17.155][Notifications ][Error ] Unable to write to the database. Exit code: 1 [10:09:17.200][CrashReport ][Info ] Preparing package to send with the diagnostics

Please help!

My computer name has 15 characters, however changing to less than 12 does not work.

Thank you.

rliberoff avatar Jul 04 '17 08:07 rliberoff

I the length-of-name problem likely to be fixed?

Mattacks avatar Jul 26 '17 10:07 Mattacks

the latest version of Docker for Windows no longer use the database. Closing

rn avatar Mar 08 '18 17:03 rn

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-robott avatar Jun 02 '21 03:06 docker-robott