AttributeError: 'NoneType' object has no attribute 'partition'
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cloud-init (Ubuntu) |
Fix Released
|
High
|
Alberto Contreras | ||
Bionic |
Fix Released
|
Undecided
|
Unassigned | ||
Focal |
Fix Released
|
Undecided
|
Unassigned | ||
Jammy |
Fix Released
|
Undecided
|
Unassigned | ||
Kinetic |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
[ Impact ]
In very early boot, before cloud-init creates /run/cloud-
[ Test Plan ]
The following test plan reprouced this issue 100% of the time on LXC containers with images containing cloud-init version 22.4.0
* Create a clean LXC image from <series>-proposed pocket
* Launch and lxc container and immediately run cloud-init status --wait to ensure no race exists.
cat > setup_proposed.sh <<EOF
#/bin/bash
mirror=http://
echo deb \$mirror \$(lsb_release -sc)-proposed main | tee /etc/apt/
apt-get update -q
apt-get install -qy cloud-init
EOF
for RELEASE in bionic focal jammy kinetic; do
echo "### test SRU for $RELEASE"
lxc launch ubuntu-
lxc exec sru-$RELEASE -- cloud-init status --wait;
echo "### update to -proposed pocket"
lxc file push setup_proposed.sh sru-$RELEASE/
lxc exec sru-$RELEASE -- /sru-$RELEASE/
echo "### boot clean and validate cloud-init status --wait
lxc exec sru-$RELEASE -- cloud-init clean --logs --reboot
lxc exec sru-$RELEASE -- cloud-init status --wait
lxc exec sru-$RELEASE -- grep Traceback /var/log/
done
[ Where problems could occur ]
* The fix shores up a gap in the initial/default state of /run/cloud-
[ Other Info ]
This regression discovery was during SRU validation timeframe for 22.4.0 and is subsequently been included in cloud-init upstream version 22.4.2. (Already published to Ubuntu Lunar (23.04).
[ Original Description ]
Hello,
Cloud-init version 2.4-0ubuntu4 (currently in lunar), fails in certain conditions when running cloud-init status --wait:
Traceback (most recent call last):
File "/usr/bin/
sys.
File "/usr/lib/
retval = util.log_time(
File "/usr/lib/
ret = func(*args, **kwargs)
File "/usr/lib/
details = get_status_
File "/usr/lib/
datasource, _, _ = value.partition(" ")
AttributeError: 'NoneType' object has no attribute 'partition'
We noticed that it broke our subiquity pipeline, see https:/
This seems to fail when invoking cloud-init status --wait (very) early.
Reproducer:
#!/bin/bash
lxc launch --ephemeral ubuntu-daily:lunar test
lxc exec test -- cloud-init status --wait
I believe it might also affect the versions being SRUed (https:/
description: | updated |
description: | updated |
description: | updated |
Changed in cloud-init (Ubuntu): | |
importance: | Undecided → High |
Changed in cloud-init (Ubuntu): | |
assignee: | nobody → Alberto Contreras (aciba) |
status: | Triaged → In Progress |
Changed in cloud-init (Ubuntu): | |
status: | In Progress → Fix Committed |
Changed in cloud-init (Ubuntu): | |
status: | Fix Committed → Fix Released |
tags: | added: regression-proposed |
description: | updated |
description: | updated |
description: | updated |
After doing a quick bisect, I think the regression was introduced in https:/ /github. com/canonical/ cloud-init/ commit/ 274b23ec18bebc4 c77357e4a5db08c 0bc5627e5a, which is part of the current SRU of cloud-init 22.4 .