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

Open
khaale opened this Issue Oct 9, 2016 · 15 comments

Comments

Projects
None yet
@khaale

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

This comment has been minimized.

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-

This comment has been minimized.

Member

shin- commented Oct 10, 2016

Hi!

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

@khaale

This comment has been minimized.

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

This comment has been minimized.

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

This comment has been minimized.

brenkehoe commented Oct 22, 2016

@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

This comment has been minimized.

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

This comment has been minimized.

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

This comment has been minimized.

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

This comment has been minimized.

ansariwn commented Aug 11, 2017

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

This comment has been minimized.

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

This comment has been minimized.

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

This comment has been minimized.

ansariwn commented Nov 4, 2017

@PradeepSubbaiyan

This comment has been minimized.

PradeepSubbaiyan commented Nov 24, 2017

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

This comment has been minimized.

@guidoffm

This comment has been minimized.

guidoffm commented Feb 15, 2018

Run this in Admin powershell:

Stop-Service docker

Get-ContainerNetwork | Remove-ContainerNetwork

Start-Service docker
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment