-
Notifications
You must be signed in to change notification settings - Fork 835
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
cloud-init-23.4 cannot read "- Azure" datasource_list format #4794
Comments
Could you please attach the complete log file of an instance that successfully booted with this configuration with 23.1.1? I don't think that this would have worked then either. Per discussion in irc with Ani, I believe that Azure images would have still failed but in a different way. |
Also mentioned during the irc conversation is that the configuration you provided is documented in the docs as not working, and has been documented in the configuration file as not working for 3 years. So even if you provide proof that this ever worked with ds-identify, I suspect we're still going to close this as not a bug, since this is - and was (in pre-23.1.1) expected and documented behavior. |
|
I see, just would like to confirm which commit causes this change after 23.1.1, and is there any way to be compatible with this format? |
meanwhile, could we do something like this so that there is no ugly crash?
|
I've reproduced the issue, this is a problem in ds-identify: # cat /run/cloud-init/cloud.cfg
datasource_list: [ datasource_list:, None ] Just to be clear though, what I said before stands: the following configuration is not - and was not ever supported. It just previously failed by ignoring the configuration (and then ds-identify would previously correctly identify the Azure datasource).
This issue was introduced by #4327. As a temporary workaround, I recommend not using an invalid configuration. We will work to get this fix into the latest upstream cloud-init release. |
…anonical#4327)" This reverts commit 816e05d. Fixes canonicalGH-4794
…anonical#4327)" This reverts commit 816e05d. Fixes canonicalGH-4794
…anonical#4327)" This reverts commit 816e05d. Reopens LP: 2030729 Fixes canonicalGH-4794
…anonical#4327)" This reverts commit 816e05d. Reopens LP: 2030729 Fixes canonicalGH-4794
…anonical#4327)" This reverts commit 816e05d. Reopens LP: 2030729 Fixes canonicalGH-4794
…anonical#4327)" This reverts commit 816e05d. Reopens LP: 2030729 Fixes canonicalGH-4794
Thanks for reporting this @zhaohuijuan and @ani-sinha. We're on the fence about whether this is actually a bug - on one hand, this configuration was never a valid configuration, but on the other hand it previously was ignored silently and didn't prevent users from using cloud-init - so long as ds-identify could figure out the actual datasource. I've queued up a new upstream release since the sentiment in my PR to fix the issue is that we might want to fail loudly someday about providing invalid configurations like this, but the PR that introduced this change in behavior isn't the right way to do it since, as you noticed, the logs don't make it obvious that this is caused by a broken configuration and I discovered that it also introduced even more broken behavior related to YAML parsing being incorrect. |
@holmanb Thanks for the debug and clarify the issue. The fix makes sense to us. You reverted the patch that broke it, after discussion with @ani-sinha , we will backport the revert downstream as well while the config gets fixed. |
Thanks @holmanb for identifying and reverting the change that introduced the behavior change and some additional issues. |
Bug report
In Image Builder images, the datasource_list in /etc/cloud/cloud.cfg.d/91-azure_datasource.cfg is:
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.distros.rhel.Distro'>
2024-01-18 10:27:12,441 - {}init{}.py[DEBUG]: Looking for data source in: [\{'datasource_list': None}, 'None'], via packages ['', 'cloudinit.sources'] that matches dependencies ['FILESYSTEM', 'NETWORK']
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/python3.6/site-packages/cloudinit/cmd/main.py", line 781, in status_wrapper
ret = functor(name, args)
File "/usr/lib/python3.6/site-packages/cloudinit/cmd/main.py", line 394, in main_init
init.fetch(existing=existing)
File "/usr/lib/python3.6/site-packages/cloudinit/stages.py", line 493, in fetch
return self.get_data_source(existing=existing)
File "/usr/lib/python3.6/site-packages/cloudinit/stages.py", line 367, in get_data_source
self.reporter,
File "/usr/lib/python3.6/site-packages/cloudinit/sources/{}init{}.py", line 1001, in find_source
ds_list = list_sources(cfg_list, ds_deps, pkg_list)
File "/usr/lib/python3.6/site-packages/cloudinit/sources/{}init{}.py", line 1047, in list_sources
ds_name = importer.match_case_insensitive_module_name(ds)
File "/usr/lib/python3.6/site-packages/cloudinit/importer.py", line 40, in match_case_insensitive_module_name
if "nocloud-net" == mod_name.lower():
AttributeError: 'dict' object has no attribute 'lower'
Steps to reproduce the problem
datasource:
Azure:
apply_network_config: false
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 logs
$ sudo cat /etc/cloud/cloud.cfg.d/91-azure_datasource.cfg
datasource_list:
- Azure
cloud-init.log
2024-01-18 10:27:12,433 - stages.py[DEBUG]: Using distro class <class 'cloudinit.distros.rhel.Distro'>
2024-01-18 10:27:12,441 - {}init{}.py[DEBUG]: Looking for data source in: [\{'datasource_list': None}, 'None'], via packages ['', 'cloudinit.sources'] that matches dependencies ['FILESYSTEM', 'NETWORK']
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/python3.6/site-packages/cloudinit/cmd/main.py", line 781, in status_wrapper
ret = functor(name, args)
File "/usr/lib/python3.6/site-packages/cloudinit/cmd/main.py", line 394, in main_init
init.fetch(existing=existing)
File "/usr/lib/python3.6/site-packages/cloudinit/stages.py", line 493, in fetch
return self.get_data_source(existing=existing)
File "/usr/lib/python3.6/site-packages/cloudinit/stages.py", line 367, in get_data_source
self.reporter,
File "/usr/lib/python3.6/site-packages/cloudinit/sources/{}init{}.py", line 1001, in find_source
ds_list = list_sources(cfg_list, ds_deps, pkg_list)
File "/usr/lib/python3.6/site-packages/cloudinit/sources/{}init{}.py", line 1047, in list_sources
ds_name = importer.match_case_insensitive_module_name(ds)
File "/usr/lib/python3.6/site-packages/cloudinit/importer.py", line 40, in match_case_insensitive_module_name
if "nocloud-net" == mod_name.lower():
AttributeError: 'dict' object has no attribute 'lower'
Additional info:
The text was updated successfully, but these errors were encountered: