cloud-init.service/start deleted to break ordering cycle
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cloud-init (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned | ||
firewalld (Ubuntu) |
Confirmed
|
Undecided
|
Unassigned |
Bug Description
I'm encountering this systemd service dependecy cycle, which prevent cloud-init from running, and making my image build unusable since user-data settings do not get applied.
Issues present on bionic and focal
Steps to reproduce:
1. apt-get purge -y ufw; apt-get install -y firewalld
2. cloud-init clean
3. reboot
4. grep -B 5 cycle /var/log/syslog
I've seen these two error messages:
```
[ 3.609277] systemd[1]: Set hostname to <localhost>.
[ 3.620361] systemd[1]: Initializing machine ID from KVM UUID.
[ 3.621151] systemd[1]: Installed transient /etc/machine-id file.
[ 4.007739] systemd[1]: basic.target: Found ordering cycle on paths.target/start
[ 4.017890] systemd[1]: basic.target: Found dependency on apport-
[ 4.018837] systemd[1]: basic.target: Found dependency on sysinit.
[ 4.019713] systemd[1]: basic.target: Found dependency on cloud-init.
[ 4.020613] systemd[1]: basic.target: Found dependency on systemd-
[ 4.021700] systemd[1]: basic.target: Found dependency on systemd-
[ 4.022677] systemd[1]: basic.target: Found dependency on network-
[ 4.023574] systemd[1]: basic.target: Found dependency on firewalld.
[ 4.024463] systemd[1]: basic.target: Found dependency on basic.target/start
[ 4.025298] systemd[1]: basic.target: Job paths.target/start deleted to break ordering cycle starting with basic.target/start
[[0;1;31m SKIP [0m] Ordering cycle found, skipping [0;1;39mPaths[0m
[ 4.027404] systemd[1]: firewalld.service: Found ordering cycle on sysinit.
[ 4.028367] systemd[1]: firewalld.service: Found dependency on cloud-init.
[ 4.029359] systemd[1]: firewalld.service: Found dependency on systemd-
[ 4.034786] systemd[1]: firewalld.service: Found dependency on systemd-
[ 4.035843] systemd[1]: firewalld.service: Found dependency on network-
[ 4.036853] systemd[1]: firewalld.service: Found dependency on firewalld.
[ 4.037878] systemd[1]: firewalld.service: Job cloud-init.
[[0;1;31m SKIP [0m] Ordering cycle found, skipping [0;���job (metadata service crawler)[0m
[ 4.041631] systemd[1]: Created slice system-
```
```
Jan 6 22:04:02 ib-scan-ubuntu2004 kernel: [ 3.824604] systemd[1]: sysinit.target: Found ordering cycle on cloud-init.
Jan 6 22:04:02 ib-scan-ubuntu2004 kernel: [ 3.825678] systemd[1]: sysinit.target: Found dependency on systemd-
Jan 6 22:04:02 ib-scan-ubuntu2004 kernel: [ 3.826718] systemd[1]: sysinit.target: Found dependency on systemd-
Jan 6 22:04:02 ib-scan-ubuntu2004 kernel: [ 3.827613] systemd[1]: sysinit.target: Found dependency on network-
Jan 6 22:04:02 ib-scan-ubuntu2004 kernel: [ 3.828450] systemd[1]: sysinit.target: Found dependency on firewalld.
Jan 6 22:04:02 ib-scan-ubuntu2004 kernel: [ 3.836078] systemd[1]: sysinit.target: Found dependency on dbus.service/start
Jan 6 22:04:02 ib-scan-ubuntu2004 kernel: [ 3.836928] systemd[1]: sysinit.target: Found dependency on basic.target/start
Jan 6 22:04:02 ib-scan-ubuntu2004 kernel: [ 3.837814] systemd[1]: sysinit.target: Found dependency on paths.target/start
Jan 6 22:04:02 ib-scan-ubuntu2004 kernel: [ 3.838762] systemd[1]: sysinit.target: Found dependency on ua-license-
Jan 6 22:04:02 ib-scan-ubuntu2004 kernel: [ 3.839750] systemd[1]: sysinit.target: Found dependency on sysinit.
Jan 6 22:04:02 ib-scan-ubuntu2004 kernel: [ 3.840612] systemd[1]: sysinit.target: Job cloud-init.
```
affects: | cloud-init → cloud-init (Ubuntu) |
Thank you for filing a bug and making Ubuntu better.
I can confirm that your procedure to reproduce on Ubuntu jammy. This does in fact represent a bug in how the firewalld systemd unit is being setup. My first guess here is the DefaultDependencies being injected by firewalld's systemd service is what is causing the ordering cycle w/ cloud-init.
It will need a bit more time to triage. But I can at least confirm the bug report.