windows random failures docker-compose up - failed to create endpoint [[service]] on network nat
docker-compose up is failing randomly on windows server 2016. Details below. Seems similar to 335 which was closed due to inactivity not with a resolution as far as I can see.
In my situation for the data below, I am standing up 4 or 5 services in the compose file and sometimes it succeeds and sometimes it fails. Seems quite random.
Expected behavior
docker-compose up -d --no-build should bring up multiple services defined in the docker-compose.yml file
Actual behavior
docker-compose up fails randomly with messages similar to
failed to create endpoint [[service]] on network nat
The process is failing randomly for random services.
Information
The output from the following script - https://aka.ms/Debug-ContainerHost.ps1 is (please note that windowsservercore and nanoserver are being cleaned up by docker system prune) so the images declared in the docker-compose.yml file are being pulled when missing and in turn this dependencies are being satisfied by docker as I would expect.
Checking for common problems
Describing Windows Version and Prerequisites
Info 15:57:10
[+] Is Windows 10 Anniversary Update or Windows Server 2016 979ms
[+] Has KB3192366, KB3194496, or later installed if running Windows build 14393 229ms
[+] Is not a build with blocking issues 137ms
[+] Has 'Containers' feature installed 1.01s
Describing Docker is installed
Info 15:57:12
[+] A Docker service is installed - 'Docker' or 'com.Docker.Service' 154ms
[+] Service is running 52ms
Info 15:57:16
[+] Docker.exe is in path 4.09s
[+] Docker is registered in the EventLog service 42ms
Describing User has permissions to use Docker daemon
[+] docker.exe should not return access denied 75ms
Describing Windows container settings are correct
[+] Do not have DisableVSmbOplock set to 1 55ms
[+] Do not have zz values set 47ms
Describing The right container base images are installed
[-] At least one of 'microsoft/windowsservercore' or 'microsoft/nanoserver' should be installed 196ms
ValidationMetadataException: The argument is null or empty. Provide an argument that is not null or empty, and then try the command again.
ParameterBindingValidationException: Cannot validate argument on parameter 'Property'. The argument is null or empty. Provide an argument that is not null or empty, and then try the command again.
at
The error logs contain this:
Handler for POST /v1.25/containers/d7502a1511da4d26983746b02b30740c4dc58eace250e21b36de522e36826827/start returned error: failed to create endpoint scsprint_query_1 on network nat: HNS failed with error : Unspecified error
Steps to reproduce the behavior
run docker-compose up -d --no-build randomly on windows server 2016 and fails randomly with for random services.
See Michael's comment on https://github.com/docker/compose/issues/4482#issuecomment-279823497
Thanks @shin- . Hmm strange, I am using the the model suggested with the external NAT network setting in my compose files. Also, just to highlight that the error in the logs is unspecified, so I'm kind of searching in the dark regarding this.
failed to create endpoint scsprint_query_1 on network nat: HNS failed with error : Unspecified error
The thing is, the same compose configuration works 80% of the time then will fail. I run the deployment in a cycle hourly as I'm looking to test the reliability on Windows. The compose file does not change in there cycles.
@friism Do you have any idea for this one? I assume it has to do with networking in the Windows Engine.
Is there any enhanced logging I can enable to help with this. Over the last few days I still seem to get up to a 10% failure rate. Which always gets fixed by simple running the same up script. If its network related, is then anything here I can log / monitor?
@pennywisdom I think at this point it's simpler to use the true overlay networking functionality. Here's an example: https://github.com/friism/MusicStore/blob/master/docker-compose.windows.yml
You may need a hacked version of docker-compose for now: https://github.com/docker/compose/pull/4794
thanks @friism . I am now trying the overlay driver as i would like to create a few different networks on a host (for isolation) and am getting errors similar to:
Cannot start service [name]: attaching to network failed, make sure your network options are correct and check manager logs: context deadline exceeded
Been searching the various repos and issues and can't seem to find anything that will resolve this.
I configured like so:
docker swarm init (just a single node)
docker network create -d overlay --attachable --subnet 10.1.1.0/24 app_net
inside docker-compose i have now:
networks:
external:
name: app_get
Can you post a simple docker-compose file and series of steps that reproduce the problem?
On Mon, May 8, 2017 at 5:31 AM Alex Harrington [email protected] wrote:
thanks @friism https://github.com/friism . I am now trying the overlay driver as i would like to create a few different networks on a host (for isolation) and am getting errors similar to:
Cannot start service [name]: attaching to network failed, make sure your network options are correct and check manager logs: context deadline exceeded
Been searching the various repos and issues and can't seem to find anything that will resolve this.
I configured like so:
docker swarm init (just a single node) docker network create -d overlay --attachable --subnet 10.1.1.0/24 app_net
inside docker-compose i have now: networks: external: name: app_get
— You are receiving this because you were mentioned. Reply to this email directly, view it on GitHub https://github.com/docker/compose/issues/4521#issuecomment-299853874, or mute the thread https://github.com/notifications/unsubscribe-auth/AAHsmKZMsrQSKlnaQrAkxyzf2mazQCDLks5r3wsYgaJpZM4MHnmQ .
-- http://friism.com/ (650) 318-1051 Sapere aude
--set swarm mode docker swarm init --advertise-addr 192.168.xxx.xx:2237 --listen-addr 192.168.xxx.xx:2237
--create overlay network docker network create -d overlay --attachable app
-- bring up docker-compose.exe -f .\docker-compose.test.yml up
--docker-compose.test.yml
---
version: '3.2'
services:
proxy:
image: stefanscherer/traefik-windows:v1.1.2-windows.1
ports:
- '80:80'
- '443:443'
- '8080:8080'
# we need the IP of the vEthernet (HNS Internal NIC), you can get this from running 'ipconfig'
command: --web --docker --docker.endpoint=tcp://${DOCKER_API_HOST}:${DOCKER_API_PORT} --logLevel=DEBUG
labels:
- "traefik.backend=proxy"
volumes:
- ./traefik:C:/etc/traefik
portainer:
image: portainer/portainer:windows-amd64-1.11.2
ports:
- "9000:9000"
command: -H tcp://${DOCKER_API_HOST}:${DOCKER_API_PORT}
labels:
- "traefik.backend=portainer"
- "traefik.frontend.rule=Host:portainer.docker.local"
networks:
default:
external:
name: app
docker info
Containers: 4
Running: 0
Paused: 0
Stopped: 4
Images: 46
Server Version: 17.05.0-ce-rc1
Storage Driver: windowsfilter
Windows:
Logging Driver: json-file
Plugins:
Volume: local
Network: l2bridge l2tunnel nat null overlay transparent
Swarm: active
NodeID: cg7tqlvz32pryqwo7cp56kvrp
Is Manager: true
ClusterID: jjgcwt0gv9fgr5eg39e5zrxe6
Managers: 1
Nodes: 1
Orchestration:
Task History Retention Limit: 5
Raft:
Snapshot Interval: 10000
Number of Old Snapshots to Retain: 0
Heartbeat Tick: 1
Election Tick: 3
Dispatcher:
Heartbeat Period: 5 seconds
CA Configuration:
Expiry Duration: 3 months
Node Address: 192.168.226.62
Manager Addresses:
192.168.226.62:2237
Default Isolation: hyperv
Kernel Version: 10.0 14393 (14393.693.amd64fre.rs1_release.161220-1747)
Operating System: Windows 10 Enterprise
OSType: windows
Architecture: x86_64
CPUs: 4
Total Memory: 15.89GiB
Name: xxxxx
ID: PW6K:VCEH:T34B:IKQZ:3CLU:JVRA:YA33:H4SU:HYBU:OIJ3:WYVE:CDUN
Docker Root Dir: C:\ProgramData\Docker
Debug Mode (client): false
Debug Mode (server): false
Username: xxxx
Registry: https://index.docker.io/v1/
Experimental: false
Insecure Registries:
127.0.0.0/8
Live Restore Enabled: false
Whats the status on this? Solved? I'm having all the same problems is there any point to even Open another ticket on this?
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.
This issue has been automatically closed because it had not recent activity during the stale period.