New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Windows Server 2019 publish ports in swarm not working #39191
Comments
Looks like this is very similar to #39065 |
@daschott PTAL is this actually broken again on Win Srv 2019? |
Thanks @olljanat & @darrensteadman we will take a look at this and related bugs. @pradipd FYI |
can anyone say how can solution of ''hnscall failed an adapter was not found'' I cannot run portrainer and stefanscherer/traefik-windows in my docker swarm.. I waste two days about this. |
@olljanat my friend ım following your pieces of advice that you say my after a few weeks ago, for my company. ı have new issues as ı says above.. ı cannot use portrainer and stefanscherer/traefik-windows ım trying your new advices right now ı hope ı can deploy the stack.. |
@olljanat can you share some example compose-file include portrainer(ubuntu 18.03 worker) and portrainer agent(windowsserver 2019 master) please .. |
/cc @ddebroy |
@olljanat ım very confused I just would like to use portrainer not agent just portrainer an traefik for windows for modern reverse proxy and let's encrypt on my swarm . For now, I have nothing on my hand, treafik says "hnscall fail in win32 .an adapter was not found" portrainer says same too if run it my master (windows). This is my situation please give me an advice which way should I use? |
if ı use docker run command will portrainer as been part of the swarm ? and should I use this workaround for use traefik? I want to run it in master node. How can I specified node placement in run command like . "--placement-pref spread=node.labels.win treafik " ? |
@93Kamuran this is not right place to discuss about it. Plz contact me on Docker community or Portainer Slack! I removed my unrelated to keep this clear. Plz do same. |
Just an update. I've updated my VM to the latest of everything this morning and still no difference.
Any chance any progress has been made on this? |
In a multi-node Swarm cluster ingress routing only seems to work if you do not access it from localhost! |
After some more playing around I can confirm that while nothing works if you try to access the swarm from the host machine it appears that accessing the machine from an external address works. So if I take the above setup and expose it to the internet in azure then hit the external IP it works ok. It would appear there is just a problem with communication from/to the local host machine. |
One really nice benefit of accessing a service on localhost is running a Docker registry that all engines in the Swarm can access via the localhost insecure registry configuration. Since this doesn't work you have to expose one using the host port option and either add it as an insecure registry or copy a certificate around. |
@drnybble: In Windows, we made a design decision to not allow the host to access the overlay network (swarm). |
@pradipd Any news on host to overlay network connectivity? |
@Schneereich @drnybble Besides accessing a local container registry, can you outline any additional of your scenarios that rely on localhost access for overlay services in Docker Swarm? As @pradipd indicated, we made this scenario light up in Kubernetes first here, but not in Docker Swarm yet. Based on your feedback, we will prioritize working on this against other feature requests. Thank you in advance! |
@daschott Thank you for including this feature in your priorities.
Probably there are more scenarios but this came into my mind. Thank you! |
@darrensteadman try to upgrade to docker 19.03. it works fine for me. |
@darrensteadman @vitaliy-leschenko @daschott I just spun up a VM on Azure and stack deployed the following compose to a single node Win2019 server with containers.
Whilst I did not test the port access issue @darrensteadman reported, I was more interested in the error
On the azure VM the service and task start just fine. However on a fully patched Win10 desktop with docker desktop community 19.03.05 the single node swarm service continually terminates the task and attempts to restart it every 5 seconds, citing the error above. @daschott Will whatever fixed this in Enterprise trickle down to community version ? |
@pradipd @daschott I am also interested if this is ever resolved in Windows 10 Docker Desktop Community. I cannot deploy any docker stack as I get the dreaded "hnsCall failed in Win32: An adapter was not found. (0x803b0006)" for each container. Everything works fine on Windows Server 2019/Docker EE. All of this talk about adding and removing network adapters and bindings and so forth really confuses me so if there is an answer to all of this and if anyone is willing to hold my hand and walk me through it like I'm a 6-year old, then I'd surely welcome it. Thanks!
|
@djarvis there is no difference on code between CE and EE. But there is big difference on default settings between desktop and server version because on Win 10 default isolation mode is hyper-v and on server it is process. So if you want to be able test same way than on server you need use --isolation=process switch on docker run (or change default behavior from daemon.json). NOTE that OS build must match which means ltsc2019 tagged image can only run on 1809 build of Win 10. |
@olljanat Thanks, every little bit helps. I can run my images normally using docker run, so I know the image is OK. I tried adding additional network adapters to the DockerDesktopVM HyperV instance but that didn't seem to do anything. When I leave my swarm and try to do just a plain "docker swarm init" it comes back with "Error response from daemon: could not find the system's IP address - specify one with --advertise-addr". Now something I read suggests that I shouldn't have to specify an --advertise-addr. Is the fact that this error is coming back indicating something is generally awry? When I do specify --advertise-addr with my IP address, it works but when I deploy a simple swarm I get the "hnsCall failed in Win32: An adapter was not found. (0x803b0006)" when I "docker ps xx --no-trunc". |
HNS network creates vSwitch. vSwitch needs network adapter. This error means you have no available adapter to create vswitch. Likely you have a Vswitch already present. Can you run:
|
Hi! I did step #1. Left the node, all is well. Error response from daemon: could not choose an IP address to advertise since this system has multiple addresses on different interfaces (10.234.202.141 on Ethernet and 192.168.0.129 on vEthernet (Default Switch)) - specify one with --advertise-addr So, this is different behavior, which is promising. When I choose my ethernet adapter (--advertise-addr=10.234.202.141) and deploy the stack, things are better, I can see my one container starting, but then it fails, and it tries to start it again, and then it fails, and then it tries to start it again, etc. until I remove the stack. |
Can you re-run the steps above again and during init step #4 ensure you use syntax: Before doing so please also make sure that following ports are open: |
Hi @daschott I opened up the ports in the fire wall and re-ran the steps. When I remove all hnsnetworks and get them all again, it shows none, but only for like 5 seconds or so. Then the "Default Switch" network gets recreated again. Nonetheless I init the swarm with the aforementioned advertise/listen parameters and deploy the simple stack. The same thing happens- the container gets created, then 10 seconds later it fails, and it creates another one. At any given time I'll have 2-4 of them running. What's noteworthy is that ever since I started messing with get-hnsnetwork and remove-hnsnetwork, my regular network shows (in the icon tray) the network intermittently coming up and going down WHILE my stack is deployed. When I bring down the stack my network shows steady on. My yaml file:
|
docker stack ps shows this for the failed containers
|
@daschott Ok here's a fun little piece of information. When I have my service like:
and I bring up the stack, my network icon disconnects for a bit then comes back up after maybe 5 seconds or so, but then the container gets created and stays up. I only ever have one container running, so all seems well now. HOWEVER, When do this:
My network my network icon disconnects for a bit then comes back up after maybe 5 seconds or so, but then I run into the multiple container fails/starts with "starting container failed: hcsshim::PrepareLayer - failed failed in Win32: Incorrect function. (0x1)". So in short when I use secrets I run into this bizarre situation. |
Nuts. I knew this too. I had OneDrive running on this particular box, which has adverse effects when building windows docker containers. Since it was the same error I figured it was the problem. I removed OneDrive, which presumably makes ExpanDrive (cbfs6.sys) not load, which no longer results in this error. So as far as I can tell everything is working as it should, albeit from the little network blips I see when deploying a swarm, but perhaps that's expected. |
I'm running 19.03.5 and still cannot access the swarm nodes locally. It's quite a nuisance. |
My next issue is that I cannot access the Internet from inside my deployed containers in Swarm mode when using a Windows Server 2019 VM in Azure. I try to init the swarm against the two adapters that I see available but still can't ping 8.8.8.8 from in a container. |
Instead of ping, can you try to curl some external site like google.com e.g. run |
No, it does not work from within an overlay network. When I do:
It works, I get a response. When I do:
I do not get a response. Neither when I use an IP address:
ipconfig /all from within the container:
I also tried this:
But that didn't change anything. ipconfig /all on the host:
So when I init the swarm I init on --advertise-addr=10.0.0.7, but I have tried the other network as well. Do I need to somehow create another hnsnetwork? Get-HnsNetwork:
|
I guess in the end what it was was the ingress network being created with conflicting subnets. Simply removing and recreating the ingress network in most cases did the trick. |
Still facing issue, any update |
1 similar comment
Still facing issue, any update |
Description
When running a container in a single node swarm on Windows Server 2019 you can not access the published ports.
Steps to reproduce the issue:
docker stack deploy -c .\service_test.yml service_test
http://localhost:8000
orhttp://local ip of machine:8000
Describe the results you received:
The browser sits there forever and never makes a connection. If you look in the resource monitor in Windows you see that dockerd.exe is listening on port 8000 on all interfaces.
When you point a browser at that port you can see in resource monitor that dockerd has accepted a connection on port 8000 but it just doesn't appear to be doing anything with it.
If you just run the command
docker run -it --rm -p 8000:80 --name aspnetcore_sample mcr.microsoft.com/dotnet/core/samples:aspnetapp
I.E just run is as a container by itself and not on the swarm then everything works fine.
If I do the same steps using the following yml
It still fails but this time I don't see any listening ports for dockerd in resource monitor.
If I restart the docker service I find that the following events are logged in event viewer
HNSNetwork Request ={"Name":"uzjewd94ge9hi38jqzpseo0zx","Type":"overlay","Subnets":[{"AddressPrefix":"10.255.0.0/16","GatewayAddress":"10.255.0.1","Policies":[{"Type":"VSID","VSID":4096}]}],"AutomaticDNS":true}
followed by
Failed creating ingress network: hnsCall failed in Win32: An adapter was not found. (0x803b0006)
I found some comments online indicating this had something to do with only one physical network adapter being available on the machine so I added another network adapter in Azure and this error disappears but I still can't access the container when it is in a swarm.
Describe the results you expected:
I'd expect to be able to access the website inside the container.
Additional information you deem important (e.g. issue happens only occasionally):
Output of
docker version
:Output of
docker info
:Additional environment details (AWS, VirtualBox, physical, etc.):
Azure
The text was updated successfully, but these errors were encountered: