Docker containers on Windows 10: HNS failed with error : Unspecified error

I did start to work with Docker Containers on my Windows 10 machine. This is actually my development machine. It was quite a challenge to containerize some piece of legacy software. It has a desktop frontend and quite some limitations regarding performance, scalability, data management, monitoring. You may name even more.

It took some time, I had to fight against some certain specifica that is necessary for the program to run. Then I had it running expect the web frontend. Just a few ports to be opened, felt quite good. Unluckily, that didn’t last too long.

Don’t let Windows 10 with running Docker Containers run out of power supply

I have to travel quite a bit. On Wednesday, 27th of June, I was a little earlier back home. Looking forward to watch Germany against South Korea in Fifa World Cup, me and my family got together. I just had to do one thing for my wife. An usb-stick didn’t work for some reason on her mac, so I just got my laptop out of the bag, plugged that stick in, solved the issue and got back to football. Actually, the match was not worth the time we spent. It was horrible. Germany had been thrown out of the World Cup, actually due to they really deserved it. Anyway.

To make a long story short, on the next day’s morning I got back to my laptop. It had been running of out power. I plugged it in, restarted it, and went back to completing the last steps with Docker containers on Windows 10. When trying to start or create a container I got this message:

HNS failed with error : Unspecified error

I didn’t expect Docker to get into trouble when the power supply was gone. I tried some things to get it running anymore, let my google fu burn.

Actually, most of the issues suggests to remove container network or windows network configuration. While removing was successful, it just didn’t solve my issue. I tried to set up different containers with the same result. Also removing all images and their containers and starting again didn’t change anything.

Reinstalling Docker to fix the issue

Unluckily the next, and more frustated approach to fix it failed again. While uninstalling Docker, the installer just hangs. Certainly I sat in front of the screen watching, expecting the uninstallation to last at least less than a minute. After three minutes I got nervous. I checked the logfile. Last command in log file is trying to access HNS and remove a network interface.

[11:28:44.676][PowerShell     ][Info   ] Run script with parameters: -RemoveNetworks True...
[11:28:45.120][Windows        ][Error  ] Failed to delete layer: Not all privileges or groups referenced are assigned to the caller. (Exception from HRESULT: 0x80070514)
[11:28:45.127][Windows        ][Error  ] Failed to delete layer: Not all privileges or groups referenced are assigned to the caller. (Exception from HRESULT: 0x80070514)
[11:28:45.131][Windows        ][Error  ] Failed to delete layer: Not all privileges or groups referenced are assigned to the caller. (Exception from HRESULT: 0x80070514)
[11:28:45.135][Windows        ][Error  ] Failed to delete layer: Not all privileges or groups referenced are assigned to the caller. (Exception from HRESULT: 0x80070514)

Actually, windows tells there is an security issue, but actually digging deeper, Microsoft is not that helpful on that very exception message, telling:

This is probably not a problem. Try your privileged operation and see if it fails. If it does, see your administrator for help in obtaining the needed privilege.

mr-bean-loves-it

Where is my administrator to help me on that?

Solving the issue

Actually, as all the links havn’t been really helpful and I invested a significant amount of time, I started another approach, hoping for the best. As this looks like somekind of issue in Windows Kernel, there weren’t too many options that came to my mind that hadn’t been time consuming or just nerving.

Turn on and off Windows Features

As Docker for Windows runs on top of Hyper-V and Containers, I just tried to remove both before removing Docker. Actually this does work fine but needed two restarts, for whatever reason.

turn-windows-features-off

Reinstall Docker

Afterwards I was able to remove Docker also. It took quite some amount of time, even when I remove images and containers beforehand, so be patient.

Conclusio

I didn’t experience this issue with Windows Server 2016, only with Windows 10. It took quite some time to find this solution. Removing all installations actually suck, but finally it was faster than going through all the links I did found on the internet. Mostly they only partly hit the issue I had or simply didn’t work for me.

Leave a Reply

Your email address will not be published. Required fields are marked *