kayobe seed host configure fails to start docker service in seed vm running Rocky 9.3 image

Bug #2066032 reported by Adam McCartney
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
kayobe
Status tracked in Caracal
Caracal
Fix Released
Undecided
Unassigned

Bug Description

**Bug Report**

Running `kayobe seed vm provision` fails to start the docker service in the seed vm.
The error can be seen in the following handler:

```
RUNNING HANDLER [openstack.kolla.docker : Restart docker] ************************************************************************
fatal: [seed]: FAILED! => {"changed": false, "msg": "Unable to start service docker: Job for docker.service failed because the control process exited with error code.\nSee \"systemctl status docker.service\" and \"journalctl -xeu docker.service\" for details.\n"}
```

The journalctl logs provide a bit more info:

```
May 17 10:02:33 seed dockerd[28976]: unable to configure the Docker daemon with file /etc/docker/daemon.json: json: cannot unmarshal string into Go struct field Config.>
May 17 10:02:33 seed systemd[1]: docker.service: Main process exited, code=exited, status=1/FAILURE
```

The failure is due to a type error when parsing `/etc/docker/daemon.json`, line 19 shows that "mtu" is set to a string value.

**Fix**

Add a type in the ansible role for docker:

```
diff --git a/ansible/roles/docker/tasks/main.yml b/ansible/roles/docker/tasks/main.yml
index 13fd6bd0..1ee5976e 100644
--- a/ansible/roles/docker/tasks/main.yml
+++ b/ansible/roles/docker/tasks/main.yml
@@ -11,7 +11,7 @@
       {%- set _ = options.update({"registry-mirrors": docker_registry_mirrors}) -%}
       {%- endif -%}
       {%- if docker_daemon_mtu -%}
- {%- set _ = options.update({"mtu": docker_daemon_mtu}) -%}
+ {%- set _ = options.update({"mtu": docker_daemon_mtu | int}) -%}
       {%- endif -%}
       {%- if docker_daemon_live_restore | bool -%}
       {%- set _ = options.update({"live-restore": docker_daemon_live_restore | bool}) -%}
```

After applying this patch, the `kayobe seed vm provision` playbook succeeds and the docker service is started in the seed vm.

**Environment**

* OS: Rocky Linux 9.3 (Blue Onyx)

* Kernel: Linux seed 5.14.0-362.8.1.el9_3.x86_64

Revision history for this message
Adam McCartney (admccartney) wrote :
Bartosz Bezak (bbezak)
Changed in kayobe:
status: New → Confirmed
Changed in kayobe:
status: Confirmed → In Progress
Bartosz Bezak (bbezak)
no longer affects: kayobe/bobcat
no longer affects: kayobe/antelope
Revision history for this message
OpenStack Infra (hudson-openstack) wrote : Fix merged to kayobe (master)

Reviewed: https://review.opendev.org/c/openstack/kayobe/+/919427
Committed: https://opendev.org/openstack/kayobe/commit/2e7b5287f39e27fe9c0ba4dcec4ffb355853a468
Submitter: "Zuul (22348)"
Branch: master

commit 2e7b5287f39e27fe9c0ba4dcec4ffb355853a468
Author: Adam McCartney <email address hidden>
Date: Fri May 17 13:49:38 2024 +0200

    Add type for mtu field in docker role

    Closes-Bug: #2066032

    This patch adds an integer type to the task in the docker role that
    generates the docker daemon config. This was previously uncast and
    defaulting to a string type, which causes an error with certain docker
    versions (via the Rocky 9.3 distro). See bug description for more info.

    Change-Id: I2a996fa22fedece2c894b378fadbfc5dd0c045b6

Changed in kayobe:
status: In Progress → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.