Matched signals
- unable to configure the Docker daemon with file
- conflicting options: hosts
- merged json
- daemon.json
- failed to start daemon
- could not change group /var/run/docker.sock
- You cannot specify a host flag in daemon.json together with the -H
- Flag --hosts cannot be used together with 'hosts' key in daemon configuration file
Docker daemon configuration conflict prevents startup
What this failure means
The Docker daemon failed to start because conflicting options were supplied — the same setting was configured both in daemon.json and on the daemon command line. The daemon exits instead of starting.
Symptoms
Faultline looks for one or more of these log fragments:
unable to configure the Docker daemon with file
conflicting options: hosts
merged json
daemon.json
failed to start daemon
could not change group /var/run/docker.sock
You cannot specify a host flag in daemon.json together with the -H
Flag --hosts cannot be used together with 'hosts' key in daemon configuration file
Diagnosis
Docker does not allow the same option to be specified in both daemon.json and via CLI flags. When it detects a conflict during startup, the daemon aborts with a configuration error. This is distinct from the daemon being unreachable after a successful start.
Common conflicts:
hostsset indaemon.jsonand via-Hor--hostflags at the same time.data-rootorlog-driverspecified both in the config file and as command-line arguments.- Remote-access settings (
tcp://) added todaemon.jsonon a system that already passes--hostvia systemd unit override. - Stale or malformed
daemon.jsonleft from a prior Docker install.
Fix steps
-
Check the daemon error message to identify which option is conflicting:
journalctl -u docker --no-pager -n 30 # or on systems without journald: cat /var/log/docker.log | tail -30 -
Open
/etc/docker/daemon.jsonand compare its contents against the active dockerd command or systemd unit:cat /etc/docker/daemon.json systemctl cat docker | grep ExecStart -
Remove the conflicting key from
daemon.jsonif the same option is already on the command line, or move all configuration intodaemon.jsonand remove it from the command line. -
Validate the JSON syntax before restarting:
python3 -c "import json, sys; json.load(open('/etc/docker/daemon.json'))" -
Restart the daemon:
sudo systemctl restart docker docker info
Validation
sudo systemctl status dockershowsactive (running).docker infosucceeds without error.
Try it locally
journalctl -u docker --no-pager -n 30
cat /etc/docker/daemon.json
systemctl cat docker
docker info
How Faultline detects it
Use faultline explain docker-daemon-config-conflict to see the full playbook.
faultline analyze build.log
faultline explain docker-daemon-config-conflict
Generated from playbooks/bundled/log/runtime/docker-daemon-config-conflict.yaml. Do not edit directly.