7

I am trying the Docker Get Started tutorial, Part 3 (Services). So the part where I need to init a swarm and deploy a stack, all my service status is rejected:

enter image description here

The full error (using --no-trunc) is:

hnsCall failed in Win32: The parameter is incorrect. (0x57)

Here are the steps I am doing:

  • Ensure my image is correct (the docker run works well, I accessed localhost:4000 successfully). Then I stopped the container to make sure it does not interfere.

  • When I init the swarm, it says I have multiple addresses, so I chose a random one (I tried with either of them, same result) using --advertise-addr.

  • docker stack deploy works, but when I check the status with docker service ps, none of them are up. localhost:4000 has no listener.

  • Note: I switched Docker to a Windows container.

I am new to Docker and this is beyond me. Can anyone please suggest a solution/debug way?

Luke Vo
  • 17,859
  • 21
  • 105
  • 181
  • Do you execute the `docker run` inside the windows container? – Sven Hakvoort Dec 08 '18 at 19:12
  • @SvenHakvoort sorry not sure what you mean by "inside". I run all the above commands from my real PC. And yes, it's a Windows, with Docker set to Windows container. – Luke Vo Dec 09 '18 at 06:19
  • What do you mean by a docker container? A vm? Or are you running docker on your pc and then starting a windows container inside it where you run docker again? – Sven Hakvoort Dec 09 '18 at 08:10
  • Sorry, let me explain again: I am running a Windows PC (real one, no VM or anything). When Docker runs, there is an icon in the system tray, I use that to run the option "Switch to Windows container" (so now, Docker is running on Windows mode and the option now shows "Switch to Linux container") – Luke Vo Dec 10 '18 at 04:01
  • Which system are you running on? I tried to reproduce this on my pc (windows 10) and it runs fine if I do the exact same thing you do – Sven Hakvoort Dec 10 '18 at 10:39
  • This is my full PC specs (from DxDiag): http://pasted.co/de0e3628 . I am running it on Windows. – Luke Vo Dec 10 '18 at 11:37
  • Hmm that is almost the same as my specs, could you try it with swarm address 127.0.0.1? That is the advertized address i used – Sven Hakvoort Dec 10 '18 at 11:39
  • @SvenHakvoort I am able to init a swarm but still have the same problem... Maybe something with the network/HyperV? Note that my current Internet is wifi, not LAN (I do have a disconnected cable network card) – Luke Vo Dec 10 '18 at 13:46
  • Ok, I tried using Linux container instead (still running on Windows, but didn't switch to Windows container). It works... That's weird. Will it affect my apps on Windows? – Luke Vo Dec 10 '18 at 14:27
  • 1
    That depends, what is your use case why you wanted to use the windows container? – Sven Hakvoort Dec 10 '18 at 14:27
  • Not for now. It's just I am quite familiar with Windows environment (because I have never worked with Linux before), I thought it would prevent trouble if I run Windows container for now. My stack (.NET Core) supports Linux but I have never tried before. – Luke Vo Dec 10 '18 at 14:51
  • I'm currently seeing this same issue. I documented my steps to reproduce and things tried under this Github issues https://github.com/moby/moby/issues/40621#issuecomment-655701105 – Winston Henke Jul 19 '20 at 15:21

1 Answers1

4

I tried everything but cannot get it to run on a Windows container so I switched to Linux container. The Get Started part 3 runs well.

Luke Vo
  • 17,859
  • 21
  • 105
  • 181