/srv/irclogs.ubuntu.com/2022/05/16/#cloud-init.txt

minimalrunning/testing cloud-init main git on Alpine Linux I noticed warning after reboot about groups (defined in user-data) unable to be created as they exist, however whilst digging into this I noticed in /var/log/cloud-init.log that all the various cc_* modules are logged (in debug) with "frequency none" rather than always/once/once-per-instance00:35
minimalHi. Any devs around?13:40
minimal2 issues regarding 22.2 I wanted to discuss, (1) cc_set_passwords change on non-systemd OS causing Warning message on console (note added to #1450), (2) modules all appear to have frequency "none" (I'm seeing "add group" warnings on subsequent boots)13:51
acibaHello, minimal: I have answered you about (1), I'm going to purpose a PR to improve that case. Thanks!14:22
minimalaciba: perhaps make it a Debug message rather than a Warning so it does not appear on the console?14:25
minimalalso the 2nd issue I mentioned above looks generally problematic (either the Debug messages for all modules are incorrectly logging "frequency none" but actually using the right frequency, or all the modules are actually using an incorrect frequency which is likely to cause problems)14:27
acibaminimal: cloud you please share the logs of (2)?14:42
falcojrminimal: I can take a look into #2. We did a bunch of schema work this past cycle, and with it some changes to how modules are detected and run14:42
falcojrBut yeah, like aciba says, we could use some logs too. 'cloud-init collect-logs' attached to a launchpad bug would probably be easiest14:43
minimalfalcojr: I'll spin up a VM to get some logs, but I'd expect you'd see the same yourself. I just grep'ped "frequency " from cloud-init.log with debug enabled and all the cc_* modules showed "none"14:43
falcojrminimal: on Alpine?14:44
minimalfalcojr: I'm testing on Alpine, I'm not testing on other distros14:46
minimalfalcojr: I see the expected logs when running cloud-init 22.1 on Alpine, it seems to be a git "main" change in behaviour14:49
falcojrminimal: that'd make sense. My knowledge of alpine is ...minimal... . How do you build your cloud-init packages for alpine?14:50
blackboxswfalcojr: minimal I confirm behavior of printed frequency None in logs on jammy14:52
minimalfalcojr: Using the standard Alpine packaging mechanisms. You can see here: https://git.alpinelinux.org/aports/tree/community/cloud-init/APKBUILD14:52
blackboxswusing ppa:cloud-init-dev/daily 14:52
falcojrblackboxsw: you're seeing this on Ubuntu too?14:52
blackboxswfalcojr: if you are looking at %h rendering I can poke that this now14:52
blackboxsw2022-05-16 14:51:43,335 - modules.py[DEBUG]: Running module power-state-change (<module 'cloudinit.config.cc_power_state_change' from '/usr/lib/python3/dist-packages/cloudinit/config/cc_power_state_change.py'>) with frequency None14:52
minimalblackboxsw: yeah I'd assumed it was not an Alpine-specific issue.14:52
blackboxswyeah I see the logs ^ reporing None14:53
blackboxswwhether that's actually the case or just our log reporting (I think it is the latter)14:53
blackboxswI'll double check and make sure cc_* modules aren't automatically running each boot.14:53
falcojrblackboxsw: thanks, I'll go back to the rendering bug14:53
minimalI noticed this as when I rebooted a Alpine VM after 1st c-i run the console showed it trying to create the same groups again defined in user-data - so it seems to be running cc_user_groups more than just once-per-instance14:53
blackboxswif they are still gated properly on per-instance, then it's just a log formmating issue14:53
blackboxswbecause we relocated where frequency for cc_* modules was defined14:54
minimalso I don't expect it to be a log formatting issue14:54
blackboxsw:/14:54
blackboxswok will confirm now and hopefully post a fix today on this. thanks minimal for the heads up her .14:54
blackboxswhere14:54
minimalblackboxsw: shouldl be easy for you to test wqith ubuntu - in user-data create some groups and see what happens on 2nd boot14:55
blackboxswyeah +1 , and since we migrated `freq = PER_INSTANCE` out of some cc_* modules assuming this was the default when unspecified, I think it's any cc_* module that no longer has a `freq`  module attribute 14:56
minimalI'm seeing "__init__.py[WARNING]: Skipping creation of existing group 'admin'14:56
minimalwhich again doesn't occur with c-i 22.114:57
blackboxswaffected modules: power_state_change... which actually has a module attribute `cloudinit/config/cc_power_state_change.py:frequency = PER_INSTANCE`. Ok, it's something other than my hypothesis. Ok, will figure it out and squash it.14:59
minimalblackboxsw: sorry to point this out so late in the day - generally I test forthcoming releases frequently during the dev process but got caught up recently with cloud-utils and other stuff so only got to testing the past few days15:01
falcojrminimal: much better now than in 2 weeks :)15:03
blackboxswminimal: falcojr holmanb yep and confirmed what minimal said, the frequency None means we'll be running these modules evey single boot15:26
blackboxswminimal: this is perfect timing. thx15:27
blackboxswit costs twice as much later :)15:27
blackboxswtime to extend our integration tests a bit more as this regression fell through the cracks15:28
minimalgreat, looking forward to a fix, that only leaves the matter of the Warning appearing on non-systemd systems regarding ssh_pwauth15:28
minimalaciba is working on that - I hope its change can prevent the console message rather than just change its text15:29
=== hexa- is now known as h
falcojrblackboxsw: filed https://github.com/lxc/lxd/issues/10422 , need any help with the fix or testing?15:33
ubottuIssue 10422 in lxc/lxd "'MISSING' added to cloud-init userdata" [Open]15:33
falcojr(asking about help with the issue you're looking at, not what I filed)15:33
blackboxswfalcojr: can't hurt to have more eyes. It  we adapted behavior of fixup_modules and may have dropped functionaliy from fixup_module which sets a sensible default (PER_INSTANCE)  when "frequencies" is not provided in the module attribute itself. Looks like the commit 8a6be66156af57fb76211083d283ee104f2e9381  introduced this change. Just double checking now.15:43
blackboxsw*It looks like we adapted*...15:43
blackboxsw+            freq = raw_mod.get("freq") is almost always None now (unless someone changes it in /etc/cloud/cloud.cfg via supplemental settings (which _read_modules picks up ). Otherwise our logic passes that None through into mostly_mods.  I think we just need to source the official frequency from the metaschema. working that up now15:46
blackboxswok have a fix, working on the supplemental integration test15:59
blackboxswthanks for the review on https://github.com/canonical/cloud-init/pull/1457 I'll grab your additioanal integratoin test and maybe add an asset "frequency None" not in logs too16:36
ubottuPull 1457 in canonical/cloud-init "cc_modules: set default meta frequency value when no config available" [Open]16:36
blackboxswincorporated those test changes. will let CI run on this while I build/run locally.16:46
acibaI have created a PR for the console message: https://github.com/canonical/cloud-init/pull/145616:47
ubottuPull 1456 in canonical/cloud-init "Improve cc_set_passwords." [Open]16:47
blackboxswnice aciba will grab that review now. Thanks!16:48
acibaWe have an issue in the CI running the tests in 3.10: https://app.travis-ci.com/github/canonical/cloud-init/jobs/57035039016:48
acibaI am having a look16:49
blackboxswwhen looking over CI failures, I don't really like how our verify_clean_logs integration test fails on warning counts. It's totally not a helpful traceback16:53
blackboxsw`>       assert warning_count == expected_warnings16:54
blackboxsw5834E       AssertionError`16:54
blackboxswaciba: falcojr or holmanb if we  are touching integration tests in the future maybe we can change that assertion message to actually contain the unexpected warning content when the count != expected16:54
blackboxswexample failure here https://app.travis-ci.com/github/canonical/cloud-init/jobs/57026517916:55
blackboxswas another rough edge around CI behavior16:55
falcojrblackboxsw: yep, problem for that particular check is that we're checking that the log doesn't have additional warnings beyond those...so we can't really check for specific text that exists in the log17:04
falcojrit can be done, but just requires some more complicated logic...especially if it's around tracebacks17:05
acibaI have created a PR to solve the CI issue: https://github.com/canonical/cloud-init/pull/145817:12
ubottuPull 1458 in canonical/cloud-init "Fix CI test." [Open]17:12
blackboxswack falcojr, yeah I was thinking minimally just dumping warnings when expected warnings don't match https://github.com/canonical/cloud-init/pull/1424/commits/dde4bb1f816f5701c4a3b42cdb8d3a132e49635217:42
ubottuPull 1424 in canonical/cloud-init "schema: version schema-cloud-config-v1.json" [Open]17:42
blackboxswtracebacks'd be a bit more complex getting a multi-line regex 17:43
blackboxswfalcojr: you are going to spoil me. I write two lines of code and you contribute 70 lines of test coverage17:51
blackboxswturns out I actually need to package the json schema in order to pass integration tests :) https://github.com/canonical/cloud-init/pull/1424 ready for re-review18:16
ubottuPull 1424 in canonical/cloud-init "schema: version schema-cloud-config-v1.json" [Open]18:16
blackboxswsince the cloudinit.config.schemas didn't have an __init__.py it wasn't included when packaging, which lead to a lot of warnings about inability to find valid schema18:17
=== h is now known as hexa-

Generated by irclog2html.py 2.7 by Marius Gedminas - find it at mg.pov.lt!