HNS Error - cannot deploy Stack to Swarm - services rejected
I am very new to docker for windows. I have a Windows executable that I can run in a single container using: docker build and docker run However, when I try to create multiple instances using docker compose and deploying the services to the stack, it is rejecting them due to an HNS error. I have never had these issues on Docker for Linux so I thought I'd reach out.
I have tried Get-NetNat | Remove-NetNat
I have tried the:
networks:
default:
external:
name: nat
And I have tried to stop HNS, delete the data and start again to no avail.
Expected behavior
docker swarm init
Docker stack deploy -c docker-compose.yml mytest
Should deploy two services to the swarm
Actual behavior
Docker stack ps mytest
returns HNS error: The parameter is incorrect and rejects the creation of the services.
Information
Output of PowerShell
PS C:\Users\Daniel\Desktop\mytest> docker stack deploy -c docker-compose.yml mytest
Creating network mytest_default
Creating service mytest_simulation2
Creating service mytest_simulation1
PS C:\Users\Daniel\Desktop\mytest> docker stack ps mytest
ID NAME IMAGE NODE DESIRED STATE CURRENT STATE ERROR PORTS
cf7trfozcoj2 mytest_simulation1.1 mytest:latest DESKTOP-RC3GF46 Ready Rejected less than a second ago "HNS failed with error : The p…"
m97m31px7dy2 mytest_simulation2.1 mytest:latest DESKTOP-RC3GF46 Ready Rejected 1 second ago "HNS failed with error : The p…"
lxujginin86c mytest_simulation1.1 mytest:latest DESKTOP-RC3GF46 Shutdown Rejected 5 seconds ago "HNS failed with error : The p…"
b75l5oz1o5br mytest_simulation2.1 mytest:latest DESKTOP-RC3GF46 Shutdown Rejected 5 seconds ago "HNS failed with error : The p…"
cy97inqzw5ov mytest_simulation1.1 mytest:latest DESKTOP-RC3GF46 Shutdown Rejected 6 seconds ago "HNS failed with error : The p…"
44h16s0mqm07 mytest_simulation2.1 mytest:latest DESKTOP-RC3GF46 Shutdown Rejected 6 seconds ago "HNS failed with error : The p…"
PS C:\Users\Daniel\Desktop\mytest>
@daniel-l-burkhart Thank you for your report. Is this Docker for Windows (on Windows 10), or Docker EE for Windows Server?
If the former, then please upload a Diagnostics bundle and include the ID here.
If the latter, then support is provided by Microsoft: see https://success.docker.com/article/where-to-get-help-with-windows.
Hi @stephen-turner , thanks for responding. I am using Docker for Windows. I uploaded a diagnostic with the id: 2C8080C3-7148-4A64-A5AB-451AB3A6E681/2018-04-26_15-10-49
Thanks, that's helpful. So to confirm, you're using Docker for Windows on Bootcamp, and you're running Windows containers. And "docker run" works but "docker stack" commands are failing with HNS errors. Correct?
I think this must be an upstream bug, so I've cloned it to moby/moby#36963. Let's follow the progress there.
Yes, that's correct. Thank you so much.
getting same behavior windows 10 1709 and 1803 , latest edge,
windows containers
PS C:\workdir\tcdevenvs> docker stack ps tc1 ID NAME IMAGE NODE DESIRED STATE CURRENT STATE ERROR PORTS u30fov09imgs tc1_hello.1 gitlab.industrysoftware.automation.siemens.com:4567/tcmicroserviceframework/samples/hello_service.windows:0.1.4 laptop1 Running Preparing 39 seconds ago 5lq9nslbsu08 tc1_eureka1.1 gitlab.industrysoftware.automation.siemens.com:4567/tcmicroserviceframework/eureka_server.windows:1.6.1_0.1.1 laptop1 Running Preparing 55 seconds ago svbkhyziwtsy tc1_hello.1 gitlab.industrysoftware.automation.siemens.com:4567/tcmicroserviceframework/samples/hello_service.windows:0.1.4 laptop1 Shutdown Rejected 39 seconds ago "HNS failed with error : Unspe…" ipgn4i0r457z tc1_service_dispatcher.1 gitlab.industrysoftware.automation.siemens.com:4567/tcmicroserviceframework/service_dispatcher.windows:0.1.2 laptop1 Running Preparing 55 seconds ago
-------------------------- from docker log ------------------------------------------ [00:40:56.514][WindowsDaemon ][Info ] debug: (*Agent).UpdateTaskStatus [module=node/agent node.id=ew1lttm4u17jp97krhs8ek5yf task.id=8br3cpm6t4rmuxfwfqr4nakhj] [00:40:56.514][WindowsDaemon ][Info ] debug: state changed [node.id=ew1lttm4u17jp97krhs8ek5yf task.id=8epw7ags9uhcxknp8yzhyl3z1 service.id=jvl103d7g73fnejo8d71vvi6f state.transition=ACCEPTED->PREPARING state.desired=READY module=node/agent/taskmanager] [00:40:56.514][WindowsDaemon ][Info ] debug: dispatcher committed status update to store [task.id=f9ao75zpgsjkrcnovwp0q0qu9 module=dispatcher node.id=ew1lttm4u17jp97krhs8ek5yf state.transition=ASSIGNED->ACCEPTED method=(*Dispatcher).processUpdates] [00:40:56.514][WindowsDaemon ][Info ] debug: dispatcher committed status update to store [module=dispatcher node.id=ew1lttm4u17jp97krhs8ek5yf method=(*Dispatcher).processUpdates task.id=8epw7ags9uhcxknp8yzhyl3z1 state.transition=ASSIGNED->ACCEPTED] [00:40:56.528][WindowsDaemon ][Info ] debug: task status reported [module=node/agent node.id=ew1lttm4u17jp97krhs8ek5yf] [00:40:56.528][WindowsDaemon ][Info ] debug: (*Agent).UpdateTaskStatus [node.id=ew1lttm4u17jp97krhs8ek5yf module=node/agent task.id=s94ub8ydjoquj0lt8karwrp6m] [00:40:56.528][WindowsDaemon ][Info ] debug: task status reported [module=node/agent node.id=ew1lttm4u17jp97krhs8ek5yf] [00:40:56.528][WindowsDaemon ][Info ] debug: (*Agent).UpdateTaskStatus [module=node/agent node.id=ew1lttm4u17jp97krhs8ek5yf task.id=f9ao75zpgsjkrcnovwp0q0qu9] [00:40:56.528][WindowsDaemon ][Info ] debug: task status reported [module=node/agent node.id=ew1lttm4u17jp97krhs8ek5yf] [00:40:56.529][WindowsDaemon ][Info ] debug: (*Agent).UpdateTaskStatus [module=node/agent node.id=ew1lttm4u17jp97krhs8ek5yf task.id=8epw7ags9uhcxknp8yzhyl3z1] [00:40:56.529][WindowsDaemon ][Info ] debug: task status reported [module=node/agent node.id=ew1lttm4u17jp97krhs8ek5yf] [00:40:56.529][WindowsDaemon ][Info ] debug: Allocating IPv4 pools for network ingress (9pjbnzl4ugmqbrfdummyecndz) [00:40:56.529][WindowsDaemon ][Info ] debug: RequestPool(LocalDefault, 10.255.0.0/16, , map[], false) [00:40:56.529][WindowsDaemon ][Info ] debug: Received set for ordinal 0, start 0, end 0, any false, release false, serial:false curr:0
[00:40:56.529][WindowsDaemon ][Info ] debug: Received set for ordinal 65535, start 0, end 0, any false, release false, serial:false curr:0
[00:40:56.530][WindowsDaemon ][Info ] debug: RequestAddress(LocalDefault/10.255.0.0/16, 10.255.0.1, map[RequestAddressType:com.docker.network.gateway]) [00:40:56.530][WindowsDaemon ][Info ] debug: Received set for ordinal 1, start 0, end 0, any false, release false, serial:false curr:0
[00:40:56.530][WindowsDaemon ][Info ] HNSNetwork Request ={"Name":"9pjbnzl4ugmqbrfdummyecndz","Type":"overlay","Subnets":[{"AddressPrefix":"10.255.0.0/16","GatewayAddress":"10.255.0.1","Policies":[{"Type":"VSID","VSID":4096}]}],"AutomaticDNS":true} [00:40:56.530][WindowsDaemon ][Info ] debug: [POST]=>[/networks/] Request : {"Name":"9pjbnzl4ugmqbrfdummyecndz","Type":"overlay","Subnets":[{"AddressPrefix":"10.255.0.0/16","GatewayAddress":"10.255.0.1","Policies":[{"Type":"VSID","VSID":4096}]}],"AutomaticDNS":true} [00:40:56.530][WindowsDaemon ][Info ] debug: Allocating IPv4 pools for network tc1_default (yhtnbrfy1zf10h4rk5kubecw1) [00:40:56.530][WindowsDaemon ][Info ] debug: RequestPool(LocalDefault, 10.0.0.0/24, , map[], false) [00:40:56.531][WindowsDaemon ][Info ] debug: Received set for ordinal 0, start 0, end 0, any false, release false, serial:false curr:0
[00:40:56.531][WindowsDaemon ][Info ] debug: Received set for ordinal 255, start 0, end 0, any false, release false, serial:false curr:0
[00:40:56.531][WindowsDaemon ][Info ] debug: RequestAddress(LocalDefault/10.0.0.0/24, 10.0.0.1, map[RequestAddressType:com.docker.network.gateway]) [00:40:56.531][WindowsDaemon ][Info ] debug: Received set for ordinal 1, start 0, end 0, any false, release false, serial:false curr:0
[00:40:56.532][WindowsDaemon ][Info ] HNSNetwork Request ={"Name":"yhtnbrfy1zf10h4rk5kubecw1","Type":"overlay","Subnets":[{"AddressPrefix":"10.0.0.0/24","GatewayAddress":"10.0.0.1","Policies":[{"Type":"VSID","VSID":4098}]}],"AutomaticDNS":true} [00:40:56.532][WindowsDaemon ][Info ] debug: [POST]=>[/networks/] Request : {"Name":"yhtnbrfy1zf10h4rk5kubecw1","Type":"overlay","Subnets":[{"AddressPrefix":"10.0.0.0/24","GatewayAddress":"10.0.0.1","Policies":[{"Type":"VSID","VSID":4098}]}],"AutomaticDNS":true} [00:40:56.532][WindowsDaemon ][Info ] debug: releasing IPv4 pools from network ingress (9pjbnzl4ugmqbrfdummyecndz) [00:40:56.532][WindowsDaemon ][Info ] debug: ReleaseAddress(LocalDefault/10.255.0.0/16, 10.255.0.1) [00:40:56.532][WindowsDaemon ][Info ] debug: Received set for ordinal 1, start 0, end 0, any false, release true, serial:false curr:0
[00:40:56.533][WindowsDaemon ][Info ] debug: releasing IPv4 pools from network tc1_default (yhtnbrfy1zf10h4rk5kubecw1) [00:40:56.533][WindowsDaemon ][Info ] debug: ReleasePool(LocalDefault/10.255.0.0/16) [00:40:56.533][WindowsDaemon ][Info ] debug: ReleaseAddress(LocalDefault/10.0.0.0/24, 10.0.0.1) [00:40:56.533][WindowsDaemon ][Error ] fatal task error [error=HNS failed with error : An adapter was not found. service.id=z9nt3wigh94knf5u4mqmtqq5v node.id=ew1lttm4u17jp97krhs8ek5yf module=node/agent/taskmanager task.id=s94ub8ydjoquj0lt8karwrp6m] [00:40:56.533][WindowsDaemon ][Info ] debug: Allocating IPv4 pools for network ingress (9pjbnzl4ugmqbrfdummyecndz) [00:40:56.533][WindowsDaemon ][Info ] debug: state changed [service.id=z9nt3wigh94knf5u4mqmtqq5v node.id=ew1lttm4u17jp97krhs8ek5yf module=node/agent/taskmanager task.id=s94ub8ydjoquj0lt8karwrp6m state.desired=READY state.transition=PREPARING->REJECTED] [00:40:56.534][WindowsDaemon ][Info ] debug: Received set for ordinal 1, start 0, end 0, any false, release true, serial:false curr:0
[00:40:56.534][WindowsDaemon ][Info ] debug: RequestPool(LocalDefault, 10.255.0.0/16, , map[], false) [00:40:56.534][WindowsDaemon ][Info ] debug: ReleasePool(LocalDefault/10.0.0.0/24) [00:40:56.534][WindowsDaemon ][Error ] fatal task error [error=HNS failed with error : An adapter was not found. module=node/agent/taskmanager node.id=ew1lttm4u17jp97krhs8ek5yf task.id=f9ao75zpgsjkrcnovwp0q0qu9 service.id=jogrgbdfesljbsliroz1y9977] [00:40:56.535][WindowsDaemon ][Info ] debug: (*Agent).UpdateTaskStatus [node.id=ew1lttm4u17jp97krhs8ek5yf module=node/agent task.id=s94ub8ydjoquj0lt8karwrp6m] [00:40:56.535][WindowsDaemon ][Info ] debug: Received set for ordinal 0, start 0, end 0, any false, release false, serial:false curr:0
Note: the HHS error went away when I upated to windows 1803. Containers now spin up ok, but can't communication over overlay network, either from ingress or stack private
Can anyone help me please! I run docker CE on Window 10 pro version 1803 I activate the Swarm mode. I can create service but I cant connect to Overlay Network. docker service create -d --name web --endpoint-mode dnsrr --publish mode=host,target=80,published=80 microsoft/iis it works! but if I connect to an Overlay Network it fails docker service create -d --name web --endpoint-mode dnsrr --publish mode=host,target=80,published=80 --network nginx-net microsoft/iis the error is: hns failed with error : an adapter was not found
Here are the Networks: NETWORK ID NAME DRIVER SCOPE d1d1547a5d5e Standardswitch ics local b3ad81976542 host transparent local b5i0zkys9nsj ingress overlay swarm 5d0212aab409 nat nat local ydkbf4vfnkqh nginx-net overlay swarm 039bdb7cc276 none null local
Hello evryone,
I ran docker CE version 18.09.1 stable on Window 10 pro version 1809 and I activated the Swarm mode. I can create service but I can not connect to Overlay Network.
docker service create -d --name web --endpoint-mode dnsrr --publish mode=host,target=80,published=80 microsoft/iis
it works!
but if I try to connect to an Overlay Network it fails
docker service create -d --name web --endpoint-mode dnsrr --publish mode=host,target=80,published=80 --network my-net microsoft/iis
The error is: Hns failed with error : an adapter was not found
Here are the Networks:
NETWORK ID NAME DRIVER SCOPE
d1d1547a5d5e Standardswitch ics local
b3ad81976542 host transparent local
b5i0zkys9nsj ingress overlay swarm
5d0212aab409 nat nat local
ydkbf4vfnkqh my-net overlay swarm
039bdb7cc276 none null local
Closed issues are locked after 30 days of inactivity. This helps our team focus on active issues.
If you have found a problem that seems similar to this, please open a new issue.
Send feedback to Docker Community Slack channels #docker-for-mac or #docker-for-windows. /lifecycle locked