Skip to content
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

HNS failed with error on Windows 10 #4024

Closed
khaale opened this issue Oct 9, 2016 · 19 comments
Closed

HNS failed with error on Windows 10 #4024

khaale opened this issue Oct 9, 2016 · 19 comments
Labels

Comments

@khaale
Copy link

khaale commented Oct 9, 2016

Hi, I have the following error while trying docker-compose up on Windows 10 (with Russian language pack, don't be afraid of cyrillic symbols). I'm using the latest build of docker-compose:

docker-compose.exe --verbose up
compose.config.config.find: Using configuration files: .\docker-compose.yml
docker.auth.auth.find_config_file: Trying paths: ['C:\Users\Aleksander.docker\config.json', 'C:\Users\Aleksander.dockercfg']
docker.auth.auth.find_config_file: No config file found
compose.cli.command.get_client: docker-compose version 1.9.0dev, build 9248298
docker-py version: 1.10.3
CPython version: 2.7.10
OpenSSL version: OpenSSL 1.0.2a 19 Mar 2015
compose.cli.command.get_client: Docker base_url: http://127.0.0.1:2375
compose.cli.command.get_client: Docker version: KernelVersion=10.0 14393 (14393.206.amd64fre.rs1_release.160915-0644), Os=windows, BuildTime=2016-09-23T20:50:29.300867400+00:00, ApiVersion=1.25, Version=1.12.2-cs2-ws-beta-rc1, GitCommit=62d9ff9, Arch=amd64, GoVersion=go1
.7.1
compose.cli.verbose_proxy.proxy_callable: docker info <- ()
compose.cli.verbose_proxy.proxy_callable: docker info -> {u'Architecture': u'x86_64',
u'BridgeNfIp6tables': True,
u'BridgeNfIptables': True,
u'CPUSet': False,
u'CPUShares': False,
u'CgroupDriver': u'',
u'ClusterAdvertise': u'',
u'ClusterStore': u'',
u'Containers': 34,
u'ContainersPaused': 0,
...
compose.cli.verbose_proxy.proxy_callable: docker inspect_network <- (u'docker_default')
compose.network.ensure: Creating network "docker_default" with the default driver
compose.cli.verbose_proxy.proxy_callable: docker create_network <- (ipam=None, internal=False, driver=None, options=None, name=u'docker_default')
ERROR: compose.cli.errors.log_api_error: HNS failed with error : Параметр задан неверно.

The Параметр задан неверно means Parameter is set incorrectly.

@khaale
Copy link
Author

khaale commented Oct 9, 2016

It seems like the issue is caused by some WinNAT limitations, see moby/moby#23314.

I found some possible workarounds:

  • run get-containernetwork | remove-containernetwork to drop existing docker nat, so that compose will be able to create a new network.
  • specify external network in a docker-compose.yml

Unfortunately, both options causes network issues inside of container.

@shin-
Copy link

shin- commented Oct 10, 2016

Hi!

Correct me if I am wrong, but I believe that is a duplicate of #3252 ?

@khaale
Copy link
Author

khaale commented Oct 10, 2016

Hi!

Sorry, I've missed that issues, it looks very close.

However, as far as I understood, #3252 is (or will be) fixed on Windows Server 2016, so I am just concerned with the fix for Windows 10.

@khaale
Copy link
Author

khaale commented Oct 22, 2016

@brenkehoe, it works fine with external network = nat. See https://blog.docker.com/2016/09/build-your-first-docker-windows-server-container/ for example (I checked it and it worked fine on my Win10 environment).

@brenkehoe
Copy link

@khaale as soon as I add a static IP to any container I get the error. Best I seem to be able to do is external nat on a subnet of the main one without static ips. But in this instance, the containers don't appear able to communicate with each other unless I am doing something wrong.

@abergs
Copy link

abergs commented Jan 24, 2017

Is there any new regarding this? I'm desperately trying to start a number of services using docker-compose and running external network = "nat" makes it hard/Impossible to assign a known IP to a container and it also seems to break the internal network between the containers.

@lodrantl
Copy link

lodrantl commented Jul 4, 2017

I am also still getting this error running Windows 2016 and latest docker-compose 1.14.0.

Creating network "myapp_default" with the default driver ERROR: HNS failed with error : The parameter is incorrect.

This is the simplest compose file I could imagine:

version: "3.2"

services:
  backend:
    restart: always
    image: myapp/backend
    ports:
     - 8081:8080
  gui:
    restart: always
    image: myapp/gui
    ports:
     - 8082:8080

Setting an external nat network solves the problem, but is not a really pretty fix. Is there something I am missing? Examples say this should work now.

@nikoo56
Copy link

nikoo56 commented Jul 13, 2017

Any update on this issue? I am getting this error when I try to run musicstore sample as docker-compose -f .\docker-compose.windows.yml up or even inside VS.

@ansariwn
Copy link

Any update on this issue? I am getting this issue on Windows Server 2016. Adding the following to the compose file fixes the issue but need to know why is this happening.

networks:
  default:
    external:
      name: nat

@darkshade9
Copy link

darkshade9 commented Aug 15, 2017

This happens to me occasionally and then clears itself up if I try again, seems to be a transient issue at least for us. Causing many headaches with VSTS...

`
Client:
Version: 17.03.1-ee-3
API version: 1.27
Go version: go1.7.5
Git commit: 3fcee33
Built: Thu Mar 30 19:31:22 2017
OS/Arch: windows/amd64

Server:
Version: 17.03.1-ee-3
API version: 1.27 (minimum version 1.24)
Go version: go1.7.5
Git commit: 3fcee33
Built: Thu Mar 30 19:31:22 2017
OS/Arch: windows/amd64
Experimental: false
`

2017-08-15T17:41:43.8513005Z ##[error]C:\Program Files\Docker\docker.exe: Error response from daemon: failed to create endpoint confident_mclean on network nat: HNS failed with error : Unspecified error.

@mrichman
Copy link

mrichman commented Nov 3, 2017

@ansariwn I am trying something similar, and getting this error:

ERROR: for studentwebclient  Cannot start service studentwebclient: failed to create endpoint docker_studentwebclient_1 on network nat: HNS failed with error : The object already exists.

@ansariwn
Copy link

ansariwn commented Nov 4, 2017

@mrichman Not sure. Try
docker/for-win#335

@PradeepSubbaiyan
Copy link

Hi when I type Get-ContainerNetwork in powershell, I am getting the following issue,
PS C:\Users\Pradeep> Get-ContainerNetwork
Get-ContainerNetwork : The term 'Get-ContainerNetwork' is not recognized as the name of a cmdlet, function, script
file, or operable program. Check the spelling of the name, or if a path was included, verify that the path is correct
and try again.
At line:1 char:1

  • Get-ContainerNetwork
  •   + CategoryInfo          : ObjectNotFound: (Get-ContainerNetwork:String) [], CommandNotFoundException
      + FullyQualifiedErrorId : CommandNotFoundException
    
    

I also tried with lower case as well get-containernetwork. The issue is same. Kindly help me on this issue,

@cveld
Copy link

cveld commented Dec 1, 2017

@guidoffm
Copy link

guidoffm commented Feb 15, 2018

Run this in Admin powershell:

Stop-Service docker

Get-ContainerNetwork | Remove-ContainerNetwork

Start-Service docker

@wadoodrahimi
Copy link

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

@Dinah2Grace
Copy link

@wadoodrahimi did you finally get any solution to this, facing the same issue

khs1994 added a commit to khs1994-docker/lnmp that referenced this issue Jun 30, 2019
@stale
Copy link

stale bot commented Oct 9, 2019

This issue has been automatically marked as stale because it has not had recent activity. It will be closed if no further activity occurs. Thank you for your contributions.

@stale stale bot added the stale label Oct 9, 2019
@stale
Copy link

stale bot commented Oct 16, 2019

This issue has been automatically closed because it had not recent activity during the stale period.

@stale stale bot closed this as completed Oct 16, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests