Docker Community Forums

Share and learn in the Docker community.

Failure to install Docker 3.1.0 (51484) - Failed to register product: The handle is invalid

Hello, I hope someone here is able to assist me. I’m posting this here as it seems the most likely starting point from my many hours of searching. If this isn’t the right place though please do say.

The week before last my Docker for Windows installation killed itself during an upgrade. I cleaned up using this script:

$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/Local/Docker Desktop Installer"
Remove-Item -Recurse -Force "~/AppData/Roaming/Docker"
Remove-Item -Recurse -Force "~/AppData/Roaming/Docker Desktop"
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:\ProgramData\DockerDesktop"
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-Item 'HKLM:\software\Microsoft\Windows\CurrentVersion\Uninstall\Docker Desktop' | 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" }

I’ve now attempted several re-installs and all fail in the same way. This is install-log.0.txt

Started on: 2021/02/17 13:18:35.384
File: C:\Users\<user id>\AppData\Local\Docker\install-log.txt
CommandLine: "C:\Users\<user id>\Downloads\Docker Desktop Installer.exe" install
[13:18:35.402][ManifestAndExistingInstallationLoader] No install path specified, looking for default installation registry key
[13:18:35.404][Program] No installation found
[13:18:35.757][InstallWorkflow] Using package: res:DockerDesktop
[13:18:35.765][InstallWorkflow] Downloading
[13:18:37.924][InstallWorkflow] Extracting manifest
[13:18:40.464][InstallWorkflow] Manifest found: version=51484, displayVersion=3.1.0, channelUrl=https://desktop.docker.com/win/stable/appcast.xml
[13:18:40.493][InstallWorkflow] Checking prerequisites
[13:18:41.182][InstallWorkflow] Prompting for optional features
[13:18:45.611][InstallWorkflow] Unpacking artifacts
[13:20:45.231][InstallWorkflow] Deploying component CommunityInstaller.CreateGroupAction
[13:20:45.777][InstallWorkflow] Deploying component CommunityInstaller.AddToGroupAction
[13:20:45.804][InstallWorkflow] Deploying component CommunityInstaller.EnableFeaturesAction
[13:20:47.577][InstallWorkflow] Deploying component CommunityInstaller.ServiceAction
[13:20:47.581][InstallWorkflow-ServiceAction] Removing service
[13:20:47.584][InstallWorkflow-ServiceAction] Creating service
[13:20:49.361][InstallWorkflow] Deploying component CommunityInstaller.ShortcutAction
[13:20:49.447][InstallWorkflow-ShortcutAction] Creating shortcut: C:\ProgramData\Microsoft\Windows\Start Menu\Docker Desktop.lnk/Docker Desktop
[13:20:49.532][InstallWorkflow] Deploying component CommunityInstaller.ShortcutAction
[13:20:49.537][InstallWorkflow-ShortcutAction] Creating shortcut: C:\Users\<user id>\Desktop\Docker Desktop.lnk/Docker Desktop
[13:20:49.542][InstallWorkflow] Deploying component CommunityInstaller.AutoStartAction
[13:20:49.546][InstallWorkflow] Deploying component CommunityInstaller.PathAction
[13:20:50.271][InstallWorkflow] Deploying component CommunityInstaller.PathAction
[13:20:50.993][InstallWorkflow] Deploying component CommunityInstaller.ExecAction

And this is install-log.txt:

Version: 3.1.0 (51484)
Sha1: 04f280b1648e29845ae5734cfcc14796c92f3de2
Started on: 2021/02/17 13:20:51.779
Resources: C:\Program Files\Docker\Docker\resources
OS: Windows 10 Enterprise
Edition: Enterprise
Id: 1809
Build: 17763
BuildLabName: 17763.1.amd64fre.rs5_release.180914-1434
File: C:\Users\<user id>\AppData\Local\Docker\install-log.txt
CommandLine: "C:\Program Files\Docker\Docker\InstallerCli.exe" -i
You can send feedback, including this log file, at https://github.com/docker/for-win/issues
[13:20:51.975][ComponentVersions ][Info   ] Edition community
[13:20:51.996][Installer         ][Info   ] Preparing upgrade...
[13:20:52.059][HyperV            ][Info   ] Destroy
[13:20:53.117][Installer         ][Info   ] Prepare upgrade completed successfully
[13:20:53.118][Installer         ][Info   ] Fixing permissions...
[13:20:53.118][Installer         ][Info   ] Directory C:\ProgramData\DockerDesktop\version-bin does not exist
[13:20:53.118][Installer         ][Info   ] Directory C:\ProgramData\Docker\cli-plugins does not exist
[13:20:53.219][Installer         ][Info   ] Permissions should be fixed.
[13:20:53.219][Installer         ][Info   ] Fixing permissions...
[13:20:53.219][Installer         ][Info   ] Deleting directory C:\ProgramData\DockerDesktop\version-bin
[13:20:53.220][Installer         ][Info   ] Deleting directory C:\ProgramData\Docker\cli-plugins
[13:20:53.228][Installer         ][Info   ] Permissions should be fixed.
[13:20:53.291][InstallWorkflow] Registering product
[13:20:53.304][InstallWorkflow] Cancel pending background download
[13:20:53.336][InstallWorkflow] Installation failed
Exception type: System.Exception, Exception message: Failed to register product: The handle is invalid. (Exception from HRESULT: 0x80070006 (E_HANDLE)), StackTrace:
   at CommunityInstaller.InstallWorkflow.<DoHandleD4WPackageAsync>d__29.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at CommunityInstaller.InstallWorkflow.<DoProcessAsync>d__23.MoveNext()
[13:20:53.340][InstallWorkflow] Rollbacking component CommunityInstaller.ExecAction
[13:20:53.343][InstallWorkflow] Rollbacking component CommunityInstaller.PathAction
[13:20:54.008][InstallWorkflow] Rollbacking component CommunityInstaller.PathAction
[13:20:54.665][InstallWorkflow] Rollbacking component CommunityInstaller.AutoStartAction
[13:20:54.669][InstallWorkflow] Rollbacking component CommunityInstaller.ShortcutAction
[13:20:54.673][InstallWorkflow] Rollbacking component CommunityInstaller.ShortcutAction
[13:20:54.676][InstallWorkflow] Rollbacking component CommunityInstaller.ServiceAction
[13:20:55.686][InstallWorkflow] Rollbacking component CommunityInstaller.EnableFeaturesAction
[13:20:55.689][InstallWorkflow] Rollbacking component CommunityInstaller.AddToGroupAction
[13:20:55.692][InstallWorkflow] Rollbacking component CommunityInstaller.CreateGroupAction
[13:20:55.694][InstallWorkflow] Rollbacking component CommunityInstaller.UnpackArtifactsStep
[13:20:55.705][FileSystem] Deleting C:\Program Files\Docker\Docker
[13:20:56.549][FileSystem] Deleted C:\Program Files\Docker\Docker successfully
[13:20:56.551][InstallWorkflow] Rollbacking component CommunityInstaller.ExtractManifestStep
[13:20:56.554][InstallWorkflow] Rollbacking component CommunityInstaller.DownloadStep

Thanks for your assistance!