cloud-init-23.4 cannot read "- Azure" datasource_list format
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
cloud-init (Ubuntu) |
Fix Released
|
Undecided
|
Brett Holman | ||
Focal |
Fix Released
|
Undecided
|
Unassigned | ||
Jammy |
Fix Released
|
Undecided
|
Unassigned | ||
Mantic |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
[ Impact ]
When an invalid configuration in /etc/cloud/
While the datasource_list is invalid, it does represent a regression because previous ds-identify behavior was to silently ignore the invalid configuration and now it needlessly prevents cloud-init from running rather than identifying the correct datasource like it used to.
[ Test Plan ]
1. Create a VM on Azure, change the /etc/cloud/
datasource:
Azure:
apply_
datasource_list:
\- Azure
2. Clean cloud-init and reboot VM
$sudo cloud-init clean
$sudo reboot
Expected results
cloud-init service can start successfully.
Bug results
cloud-init service fails to start.
[ Where problems could occur ]
This is a revert of a commit added this cycle, so it's possible we could bring back any other undiscovered bugs we didn't know about in the old code.
[ Other Info ]
Upstream bug: https:/
This issue was introduced as a fix for https:/
PR reverting and fixing the issue: https:/
[ Original Description ]
In Image Builder images, the datasource_list in /etc/cloud/
datasource_list:
\- Azure
which cannot be parsed by cloud-init.
2024-01-18 10:27:12,433 - stages.py[DEBUG]: Using distro class <class 'cloudinit.
2024-01-18 10:27:12,441 - _{_}init{
2024-01-18 10:27:12,441 - util.py[WARNING]: failed stage init
2024-01-18 10:27:12,441 - util.py[DEBUG]: failed stage init
Traceback (most recent call last):
File "/usr/lib/
ret = functor(name, args)
File "/usr/lib/
init.
File "/usr/lib/
return self._get_
File "/usr/lib/
self.reporter,
File "/usr/lib/
ds_list = list_sources(
File "/usr/lib/
ds_name = importer.
File "/usr/lib/
if "nocloud-net" == mod_name.lower():
AttributeError: 'dict' object has no attribute 'lower'
## Steps to reproduce the problem
1. Create a VM on Azure, change the /etc/cloud/
datasource:
Azure:
apply_
datasource_list:
\- Azure
2. Clean cloud-init and reboot VM
$sudo cloud-init clean
$sudo reboot
Expected results
cloud-init service can start successfully.
Actual results
cloud-init service fails to start(logs are in the description)
If change the
datasource_list:
\- Azure
to:
datasource_list: [ Azure ]
Then cloud-init clean && reboot, the cloud-init service and start successfully.
## Environment details
- Cloud-init version: cloud-init-23.4
- Operating System Distribution: RHEL
- Cloud provider, platform or installer type: Azure
## cloud-init logs
1. $ sudo cat /etc/cloud/
datasource_list:
\- Azure
2. cloud-init.log
2024-01-18 10:27:12,433 - stages.py[DEBUG]: Using distro class <class 'cloudinit.
2024-01-18 10:27:12,441 - _{_}init{
2024-01-18 10:27:12,441 - util.py[WARNING]: failed stage init
2024-01-18 10:27:12,441 - util.py[DEBUG]: failed stage init
Traceback (most recent call last):
File "/usr/lib/
ret = functor(name, args)
File "/usr/lib/
init.
File "/usr/lib/
return self._get_
File "/usr/lib/
self.reporter,
File "/usr/lib/
ds_list = list_sources(
File "/usr/lib/
ds_name = importer.
File "/usr/lib/
if "nocloud-net" == mod_name.lower():
AttributeError: 'dict' object has no attribute 'lower'
## Additional info:
1. No such issue in cloud-init-23.1.1, just met this issue after rebase to 23.4, so could you please help to address which commit did this change between 23.1.1 and 23.4?
2. RHEL was using ds-identify before 23.1.1
3. I am afraid users who were using the format "- Azure" in config file will meet this issue after upgrade, so could you please help to check if there is a way to be compatible with this format? Thanks
---
Upstream bug: https:/
This issue was introduced as a fix for https:/
PR reverting and fixing the issue: https:/
Changed in cloud-init (Ubuntu): | |
status: | New → In Progress |
Changed in cloud-init (Ubuntu): | |
assignee: | nobody → Brett Holman (holmanb) |
description: | updated |
description: | updated |
tags: | added: regression-proposed |
tags: |
added: verification-done verification-done-focal verification-done-jammy verification-done-mantic removed: verification-needed verification-needed-focal verification-needed-jammy verification-needed-mantic |
Fix committed upstream per https:/ /github. com/canonical/ cloud-init/ commit/ 8ff94fe9493ad88 344eb8bbf2f023c 6ba2db5206