Overlay networking/ingress problem: "HNS failed with error : The parameter is incorrect. "

Greetings everyone,

I am trying to deploy services on a swarm with windows containers. I am using Windows 10 with 1709 update and docker 17.09-ce stable. I have tried deploying a stack, creating services one by one with different flags. Service containers exit with error HNS failed with error : The parameter is incorrect. My command to create the service is the following:
> docker service create --name web -p 80:80 web

The outputs of docker service ls and docker service ps web are below respectively:

ID                  NAME                MODE                REPLICAS            IMAGE               PORTS
lqqj8bl14dyc        web                 replicated          0/1                 web:latest          *:80->80/tcp

No container is connected to ingress. I also tried to create the service by specifying --network connecting it to my overlay network named network1.
> docker service create --name web -p 80:80 --network network1 web
It causes the same error. And containers are not attached to the network as they cannot be created. I tried using docker stack with the file:

version: '3'

services:
  web:
    image: web
    environment:
      - ASPNETCORE_ENVIRONMENT=Development
    ports:
      - "80":"80"
    volumes:
      - d:/workspace/data/uploads/:c:/inetpub/wwwroot/uploads/
    networks:
      - back-tier
networks:
  back-tier:
    external:
       name: network1

This gives the same error.

Weird thing is that I can get a service up when i use:
> docker service create --name web --publish mode=host,target=80 web
However port is not accessible, nor listed in docker service ls:

ID                  NAME                MODE                REPLICAS            IMAGE               PORTS
u9bqmzpijtkz        web                 replicated          1/1                 web:latest

You can see the result of docker service ps web below. The port is listed in here.,

ID                  NAME                IMAGE               NODE                DESIRED STATE       CURRENT STATE           ERROR               PORTS
5rmb0zmd4p4t        web.1               web:latest          DESKTOP-G8PR5TJ     Running             Running 3 minutes ago                       *:80->80/tcp

I can connect to this container by using the container’s ip on nat. (172.x.x.x) Using localhost does not work. Obviously, ingress load balancing won’t work either, and i cannot scale the service as the port is already bound in one container. Container is automatically added to nat.

Everything works fine on linux containers by the way. These issues are supposed to be solved with windows 1709 update. Am I missing something? Is it because I am using windows 10, are these issues solved in Windows Server 2016 update 1709?

Thank you and have a great day :slight_smile:

I had the same issue while deploying a Docker Swarm service based on a native Docker Windows Container on Windows Server 2016 Core/Datacenter 1709 (Fall Creators Update):

HNS failed with error : The parameter is incorrect.

After lots of experiments I finally installed the latest Updates via PSWindowsUpdate, especially the Novembers cumulative Update package, including the KB4048955:

And now the error is gone and I´am finally able to deploy the native Docker Windows Image as a Docker Swarm service:

TLDR: Try to install the newest updates! :slight_smile: