Stuck with the Error invalid_zone docker? We can help you.
We may come across this error while we start docker using
sudo systemctl start docker.
As part of our Docker Hosting services, we assist our customers with several Docker queries.
Today, let us see how to fix this error.
Error invalid_zone docker
Recently, we had a customer trying to start docker via
sudo systemctl start docker. He had docker on centos 7. However, he came across:
Job for docker.service failed because the control process exited with error code. See "systemctl status docker.service" and "journalctl -xe" for details.
On receiving this output he went ahead with
systemctl status docker.service.
The result is as shown below:
However, this output couldn’t provide him the cause of the error.
To know the cause we went ahead with:
From the last sentence of the output, we could figure out the obvious reason:
failed to start daemon: Error initializing network controller: Error creating default "bridge" network: Failed to program NAT chain: INVALID_ZONE: docker
The problem of conflict, from essential, it should be
firewalld versus iptablesConflict.
How to fix this?
This can happen when the docker zone is not in the trusted list.
$ firewall-cmd --get-active-zones
FedoraWorkstation interfaces: ens4u1u2 wlp59s0 docker interfaces: br-48d7d996793a libvirt interfaces: virbr0 trusted interfaces: docker0
Here, we can see that the interface docker0 seems to be in the trusted zone. we can also see another zone, docker.
We add it to the docker zone instead using the command below:
$ sudo firewall-cmd --zone=docker --change-interface=docker0
Alternatively, we try to temporarily disable firewalld. This is an effective way.
``` systemctl stop firewalld systemctl disable firewalld ```
On the other hand, we can also try to update the existing Docker.
Installing Docker on Centos has requirements for the Linux version. The latest Docker does not support the old version of CentOS.
sudo yum -y update
[Need help with the fix? We’d be happy to assist you]
To conclude, we can fix this error either via an update or by stopping firewalld. In short, we saw how our Support Techs fix the error.