Docker Community Forums

Share and learn in the Docker community.

Hns failed with error : the parameter is incorrect

This error can be found with some results but I’ve found just one similar question here

I’m not so sure if the solution there is working. It’s ridiculous that the required update for Windows 10 is from 2017, it’s too old and actually my Windows 10 always gets up-to-date.

Here I describe the detailed issue again. It just relates to the command docker service create.
It becomes an issue when I provide options -p 80:80 for the command. The service can be created but somehow cannot be run with an error saying HNS failed with error : the parameter is incorrect

Actually it’s looped and switched between states of “Assigned, Preparing, Error …” and I have to use docker service rm to end that loop.

Here is the whole command: docker service create --name myService -p 80:80 myImage

Exactly similar to the question from the link above, if I use the detailed syntax for -p with mode, target and published explicitly specified, the command can run OK. But after that I cannot use docker service scale. It simply cannot scale, only one task occupies the published port and prevents all others from running.

I ask this again here and hope that this has some new solution.

Dude, you may need ANOTHER update, I know it is ridiculous :confused: If you are serious about working with Docker and Windows is not a business requirement, I suggest moving to linux. It is still far from perfect on windows. Or there is some obscure method to make it work properly and we are doing everything wrong.
In any case, can you tell me your Windows version please? (Should also be Windows 10 Pro edition I think)

Yes of course, I’m experiencing Docker on my laptop running Windows 10 Enterprise Version 1803 OS Build 17134.648
Actually it’s just for convenience and our team of course tend to deploy the docker to a Linux container. I still hope that this is just a Windows-related issue and should work OK for Linux.

While waiting for a solution, I’m trying to setup a Linux environment to work with instead. Really I’m new to Linux and setting-up a similar environment to what I currently have in Windows is really hard. I’ve had to learn some Linux basic commands, working with files, networking …

Thanks for your reply.

Windows version seems alright. It should be working actually, maybe you aren’t using the vip mode? Also try deploying a stack rather than creating services one by one.

If your team prefers Linux, I’d definitely suggest giving a try to it. It would be more convenient for you as well (You would miss Visual Studio though, I get it :/) Powershell is not terrible but nowhere near user-friendly than Linux shells. The basic commands are easy to use anyway.

Thanks for your recommendations. Actually I’m tired with this error and switched to Linux. Docker seems more compatible with Linux than Windows. I hope there will be some update in Windows in future (or maybe from Docker).

Actually we just use Linux as the host machine, we still use Windows to develop everything =)) of course with the help of .NET core.