Closed
Description
Description
Port forwarding fails on docker service create with "Error response from daemon: rpc error: code = 9 desc = service needs ingress network, but no ingress network is present"
Steps to reproduce the issue:
Facing this issue on 10 node docker swarm mode cluster. Not sure how to reproduce
Describe the results you received:
Error response from daemon: rpc error: code = 9 desc = service needs ingress network, but no ingress network is present
Describe the results you expected:
create service
Output of docker version
:
Client:
Version: 17.05.0-ce
API version: 1.29
Go version: go1.7.5
Git commit: 89658be
Built: Wed May 10 22:45:11 2017
OS/Arch: linux/amd64
Server:
Version: 17.05.0-ce
API version: 1.29 (minimum version 1.12)
Go version: go1.7.5
Git commit: 89658be
Built: Wed May 10 22:45:11 2017
OS/Arch: linux/amd64
Experimental: false
Output of docker info
:
Containers: 7
Running: 0
Paused: 0
Stopped: 7
Images: 6
Server Version: 17.05.0-ce
Storage Driver: overlay2
Backing Filesystem: extfs
Supports d_type: true
Native Overlay Diff: true
Logging Driver: json-file
Cgroup Driver: cgroupfs
Plugins:
Volume: local
Network: bridge host macvlan null overlay
Swarm: active
NodeID: l0j7jl95mzzvrc7puwccyhuik
Is Manager: true
ClusterID: k1ww6j2k2nagulfphn93doa2v
Managers: 4
Nodes: 9
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: 172.18.2.127
Manager Addresses:
172.18.2.127:2377
172.18.2.133:2377
172.18.2.139:2377
172.18.2.147:2377
Runtimes: runc
Default Runtime: runc
Init Binary: docker-init
containerd version: 9048e5e50717ea4497b757314bad98ea3763c145
runc version: 9c2d8d184e5da67c95d601382adf14862e4f2228
init version: v0.13.2 (expected: 949e6facb77383876aeff8a6944dde66b3089574)
Security Options:
seccomp
Profile: default
selinux
Kernel Version: 4.11.0-coreos
Operating System: Container Linux by CoreOS 1409.0.0 (Ladybug)
OSType: linux
Architecture: x86_64
CPUs: 3
Total Memory: 7.801GiB
Name: swarmd-1.igloo.vztelematics.in
ID: MPWK:IK7C:MQQJ:LBVI:M7AD:VPTO:6OGV:QTQ6:CZPP:PLCW:LJNJ:FHRR
Docker Root Dir: /var/lib/docker
Debug Mode (client): false
Debug Mode (server): false
Registry: https://index.docker.io/v1/
Experimental: false
Insecure Registries:
registry.igloo.vztelematics.in:5000
127.0.0.0/8
Live Restore Enabled: false
coreos 1409.0.0
Activity
cpuguy83 commentedon May 27, 2017
Sounds like you've removed your ingress network.
You can recreate it with
docker network create --ingress --driver overlay ingress
adityacs commentedon May 27, 2017
I have not deleted any network. When I did "docker network ls" ingress was there in the list.
thaJeztah commentedon May 29, 2017
Is it possible you ran
docker system prune
when no services were running?Could you provide
docker network ls
docker network inspect ingress
Does it work after you re-create the ingress network (using the steps @cpuguy83 provided?)
adityacs commentedon May 29, 2017
After getting above issue, I ran
docker network prune
which removed ingress network.Later, I recreated ingress network and it worked fine.
thaJeztah commentedon May 29, 2017
Ok, I suspect what happened, is that this was a version of docker that was upgraded from an older version. Older versions marked "ingress" networks in a different way, and there was a bug in 17.05 which prevented docker from recognising such networks. As a result,
docker network prune
(ordocker system prune
) removed the ingress network if no container / service was attached to it.That situation will be resolved in docker 17.06 (see #33286). If I'm correct, an ingress network created with docker 17.05 will not be removed by
docker network prune
, so if you would rundocker network prune
again, the network should not be removed.I'll go ahead and close this issue, because this will be addressed in docker 17.06, but feel free to continue the conversation 👍
adityacs commentedon May 29, 2017
@thaJeztah Will try network prune.
I am still confused which version of docker to use. In any of the docker versions after 1.12 some thing will break.
Could you please let me know which is the most stable version for use in production for docker swarm mode?
thaJeztah commentedon May 30, 2017
Can you provide information what breaks?
The 17.03.x and 17.06.x (to be released soon), are "quarterly" releases, which have a 4-month support cycle for critical bug fixes (community edition), and are supported for 1 year (enterprise edition)
adityacs commentedon May 30, 2017
Can you provide information what breaks?
Will try out 17.06. Hope we can use it in prod :)
Thanks for the help.
thaJeztah commentedon May 31, 2017
#31255 actually is an issue with docker 1.12.4. Note that Docker 17.03.0 is actually what 1.13.2 would have been, so no functional changes from 1.13.0, only bug fixes. For production, I'd recommend installing the "quarterly" releases, unless upgrading once a month is no problem for your situation. For longer support cycles, Docker EE provides 1 year of support (bug fixes and security fixes), so may be worth considering for production
adityacs commentedon May 31, 2017
For longer support cycles, Docker EE provides 1 year of support (bug fixes and security fixes), so may be worth considering for production
Will look into this.
cabloo commentedon Jun 17, 2017
@thaJeztah can confirm your suspicion here, just ran into the same issue on my dev environment: installed a swarm in the past, upgraded Docker and ran
docker system prune
while the swarm was offline, brought the swarm back up and got this.docker network create --ingress --driver overlay ingress
resolved the issue.yunghoy commentedon Aug 1, 2017
The method @cabloo suggested can remove the problem. It still happens in 17.06.0-ce.
johnjelinek commentedon Feb 7, 2018
@thaJeztah: I'm having this issue upgrading our swarm from 17.09 to 17.12. All the nodes are now 17.12, but I can't seem to rebuild the
ingress
network.So, it doesn't really remove the
ingress
network.thaJeztah commentedon Feb 7, 2018
@johnjelinek could it be there were still tasks lingering around that were using the ingress network? Anything in the logs that could be helpful?
johnjelinek commentedon Feb 7, 2018
nah, previously when I ran
docker network rm ingress
, it would complain about a service that depended on it (likeswarm-visualizer
). So I removed all those services first, and now I'm trying todocker network rm ingress
, and it won't go away, and yet I can't bring theswarm-visualizer
back.johnjelinek commentedon Feb 7, 2018
I saw these errors in the logs, could that be related?
johnjelinek commentedon Feb 7, 2018
meh, ended up resorting to blowing away the swarm and starting from scratch 😖 ingress network is back on all nodes now.
gybfefe commentedon Jan 11, 2019
You could have just restarted the docker daemon /: -several months later in the same shoe but with more luck. The thing is remove works, but somehow stays :) - so you have to restart docker to realise the fact, that it's no more :)
antofthy commentedon May 20, 2020
I am having the same problem, in that I have a ingress (overlay) network, and need to publish a extra port on the ingress service on that network.
But when I try publish a extra port, I get the same error...
Services using the network are active so I can not
as previously suggested @johnjelinek
The ONLY solution I have found so far is to manually route the port with iptable entries to the IP of the service, basically doing what docker should be doing...
And this worked... But of course docker does NOT know about it so when the service was restarted, the above route disappears and requires manual re-creation. Not an ideal solution.
Any other solutions?
yunghoy commentedon May 20, 2020
As far as I know,
docker network prune
and recreate the ingress network will be working. But this can be incorrect information thus I quit using docker on 2017.antofthy commentedon May 20, 2020
docker network prune
did not do anything, and I would not expect it to, as there are still services using the network!antofthy commentedon May 21, 2020
Okay was able to get service to restart (shutdown down everything... It was just lucky situation where users were suddenly not using the system (a rare occurance).. Everything was started up fine though the 'manual routing' hack I was using before had to also be manually removed to get things working properly (just stopped connections).
Still it would be better if --publish-add actually could work for services with an attached ingress network. I really would not want to go though the hoops I have had to endure to add ONE extra port.