[00:48] how can I specify the system locale in a yaml file? Using "locale: en_DK.UTF-8" does not work. [01:17] MICROburst: you mean in user-data? In theory, yes, that should work, I use it myself. However you haven't indicated with cloud-init version you are using, which distro (and version of that), and which cloud-init datasource [07:54] minimal: I'm using debian bullseye and testing. I did not put it below user-dara since I would like to have it set system-wide. Is it required to list locales-all in the packages section? [10:40] Hey, can I talk to anyone here, I'm trying to understand some basic things and google isn't helpful [10:44] yuvi: Hello, I can try to help [13:46] ananke: if you're still around... [13:46] a couple of weeks ago i looked at the cloud-initramfs-tools package in ubuntu for a overlayroot issue. [13:47] I'm here, thanks for responding! I'm right now not sure where to report this issue. Debian's bug tracker has it, but there seems to be no action [13:48] I've been able to work around the missing flock (and other missing tools such as sed/rm/grep), but right now I'm stumped by missing wait-for-root. Debian's packages do not include it in initramfs-tools [13:48] if i recall correctly, debian's is very out of date compared to ubuntu. They grabbed it, made a change or two (again, from memory, i disagreed with), and then really never synced in changes. [13:50] https://paste.opendev.org/show/bYpMFNvCIqqz0Bm3YDIX/ [13:50] I'm baffled by their changes honestly. They took out tools from the hooks file [13:51] it doesn't surprise me that growroot would "mostly work" without flock , espeically in the initramfs. [13:51] it was racy, and worked for *years* reliably before it started misbehaving (probably some udev or kernel thing changed timing) [13:51] lack of flock seemed to result in fatal failure, but lack of rm/grep/sed didn't [13:52] initramfs-tools is a mess in that regard. as are all initreamfs creation packages i'm aware of. [13:53] you have a module that says "i need program x". the initramfs script runs, it fails, and then the tool goes on. [13:53] the only way you know about the error is when it fails or if you happened to look at logs. [13:53] so I'm wondering what can be done at this point. is wait-for-root available in ubuntu? [13:57] and the changes to /usr/share/initramfs-tools/hooks/growroot they did were baffling. their 0.18.debian8 version included more tools (rm, readlink, sed, grep), but 0.18.debian11 removed them [13:58] I wish debian had a bit friendlier bug tracker, rather this mailing list approach [14:11] i'd be happy to take a patch to "upstreaM" cloud-initramfs-tools that identified that growpart depends on sed,awk, grep [14:12] but even then, its non-trivial because the busybox versions are sufficient, and you don't want to cause a copy of "the real sed" if busybox is present with that. [14:13] and ubuntu's busybox-initramfs *does* have those https://paste.opendev.org/show/bXSm70ar2pG8FQgZnnY4/ [14:17] hm.. reading https://manpages.ubuntu.com/manpages/bionic/en/man8/initramfs-tools.8.html i guess maybe growroot should/could set BUSYBOX=Y ? i dont know. [14:17] I'm going to do some testing on vanilla debian 11, using the official AMI, and see if I can replicate the issue there [14:17] oh, one question [14:18] why do you need it / want it in the initramfs ? [14:21] smoser: I personally do not care where it's located. my org is using official Kali images in AWS, which are impacted by this problematic change. Kali seems to be using upstream directly from Debian [14:21] and that makes sense... [14:21] the problem is simple: you make an ec2 instance with that kali AMI, you apply the updates (including that package), and then try to grow the disk. your instance will fail to boot [14:22] if i had a lot of time that i had nothing to do with, then i might try to get cloud-initramfs-tools to be a proper upstream (not a native package on ubuntu) and then get that into debian and have ubuntu just sync from debian. [14:22] looking at the debian bug report, this likely affects anybody else using virtualization images [14:22] and i think if i worked hard at that, it could get done in 6 montsh of calendar time. [14:23] yeah, that doesn't seem like a good ROI :) [14:25] if it wasn't for the fact that it used to work just fine, I wouldn't be diving so deep in it. if I don't find a good fix, and ideally get somebody to accept it upstream (Kali, or Debian), then we'll have to keep integrating that fix for the foreseable future. We very much rely on our images being small, and deploying them with larger disk size. rinse & repeat for thousands of users [14:25] for sure, i wouldnt want to do that. [14:25] here is what i'd suggest: [14:28] * start working from the ubuntu version https://git.launchpad.net/cloud-initramfs-tools [14:28] * add some way to copy grep sed awk as you showed [14:28] * suggest debian pull from that. [14:29] if you hyave a relationship with kali, you might just suggest they remove cloud-initramfs-tools from their packages [14:30] thank you [14:32] so that brings up a good point, which I haven't considered yet: growing the root filesystem doesn't need to be done with initramfs [14:33] so one potential way would be to remove cloud-initramfs-growroot package, and redo initramfs? I can test that [14:39] hah, it worked on debian 11. removed the package, shut it down, increased disk size, started it up. cloud-init was able to grow the filesystem on boot. I personally don't care how early in the boot process that filesystem is grown, so who knows - this may be our best option for right now [14:41] I'll do some more testing this afternoon, gotta take kids to the dentist. thanks again! [14:42] the only reason that it was done in the initramfs was because > 10 years ago, there was no option [14:42] if your kernel is nerwer than something like 3.18 you can do it while the filesystem is mounted. [14:43] *3.18* seriously. [14:43] I vaguely recall doing online resizing back in 2.4 or 2.6 series [14:45] either way, that may be a good stop gap measure for us, so any images we create now will be resizable in the near future, regardless of updates. Part of my issue was timing: I have to roll out few new images this/next week, and any kind of fix would need to survive whatever upstream rolls out [15:18] ananke: yeah, filesystem resize is older than that. but 'ptupdate' (partition update) was new in 3.8. [15:19] 3.8 becomes 10 years old next month . [15:37] anake: "growing the root filesystem doesn't need to be done with initramfs" - that was the recently I commented "I've never seen growpart run in an initramfs before" yesterday ;-) [15:37] s/the recently/why/ [15:38] ananke: ^^^ [16:10] kids [16:34] smoser: whew [16:37] OpenBSD and NetBSD still use the initramfs hack. online growfs for UFS/FFS2 has been in FreeBSD for… a long time. but different FFS flavours have somewhat diverged in the past 30 years… [17:10] I wanted to… borrow Puppet's facter code for is_virtual, and promptly found a bug [18:38] smoser: yeah, re-reading partition table was notoriously problematic with linux. one often had to try different tools to eventually get it to acknowledge changes: blockdev --rereadpt, sfdisk -r, hdparm, partprobe, etc. [18:41] funny enough, just few weeks ago I came across a phantom problem, when building our images would fail because a block device was not found. the culprit? we still don't know why, but for some reason, that particular day executing 'partprobe' on EC2 instances would result in /dev/ to disappear for less than 1 second. that was enough to cause our process to fail, because right after [18:41] partprobe we were trying to use dd against it [18:43] never happened before, we've had that process in place for months, running on various instances. that day it stopped working. we put in gratuitous waits, and re-ordered few things to avoid that issue, and by the time we were done testing the fix, the problem went away [18:47] ananke: yeah recently I wanted to remove parted package (for partprobe) as a dependancy of the Alpine cloud-init package...then I found Busybox blockdev didn't work reliably for cc_disk_setup lol [19:02] ananke: fwiw, running 'udevadm settle' usually fixes things. the problem with it is that most of the time so would 'sleep 1'. so it is very easy to say "oh, the fix is to run udevadm settle" and then you'll actually see it "fixed". but that is very likely no different than adding 'sleep 1' [19:02] s/very likely/possibly/ [19:04] * meena wonders if that's how udevadm is implemented [19:19] I run without udev (and therefore without "udevadm settle") on some systems ;-) [19:21] alias "udevadm settle" "sleep 1" [19:23] meena? [19:23] I'm assuming it was a joke...otherwise I'm very worried XD [19:23] oops, meena: no need, cc_disk_setup only runs udevadm if it is present [19:24] falcojr: are you referring to me? [19:24] no, the alias [19:27] falcojr: mostly a joke, yes. mostly ;) [19:30] five minutes in a ruby pry session, and i have forgotten half of python again [19:34] MICROburst: your response re your locale problem wasn't clear. Where exactly are you specifying the "locale:"? [20:28] Good evening all, I am trying to debug the cloud-init module cc_puppet, because of the following error. [20:28] cloudinit.url_helper.UrlError: HTTPSConnectionPool(host='raw.githubusercontent.com', port=443): Max retries exceeded with url: /puppetlabs/install-puppet/main/install.sh (Caused by SSLError(SSLCertVerificationError(1, '[SSL: CERTIFICATE_VERIFY_FAILED] certificate verify failed: unable to get local issuer certificate (_ssl.c:997)'))) [20:28] A local wget works fine, certficate is valid enabled debugging on logger_cloud-init but no luck. [20:28] Any tips where to look ? [20:32] minimal: below "timezone:" (not indented, if you meant that) [20:39] MICROburst: I meant where as in if it is not in user-data (you said) then where exactly have you specified it? [20:39] in /etc/cloud/cloud.cfg ? somewhere else? [21:16] minimal: virt-install ... --cloud-init user-data=../etc/${NAME}.yaml [21:17] thought you were talking about the users section in the file... [21:17] MICROburst: so you *are* providing user-data, your earlier response said "I did not put it below user-data" [21:19] so did you check if the /etc/default/locale file was updated by cloud-init? That's the file cc_locale changes for Debian [21:20] do you also have the Debian locales package installed? [21:31] xtalkme: 2 options [21:31] 1. cloud-init/python is not looking for certs the same place as wget is [21:32] 2. when cloud-init tried the clock was not right [21:33] to do the same request with cloud-init, something like: [21:36] https://paste.openstack.org/show/bvAqYfyonGtxNQFytU3e/ [21:37] if that works at the same time wget works, then i think its clock related or (just thought of this), you're behind some sort of closed portal [21:38] your https request to github is going to some local page and https is crying about that. [21:44] https://raw.githubusercontent.com/puppetlabs/install-puppet/main/install.sh is defined in cc_puppet.py so that's where the url portions referenced above come from [21:45] the "local page" is actually the non-scheme, non-host part of that url [21:55] smoser Thanks did not think about time as a issue. Will have a look at that. And with closed portal i guess you mean something like a wifi portal ? [22:02] smoser when i import the urlhelper, i get the same error, time seems correct. [22:19] minimal not sure what you mean with the "Local page"? [22:19] smoser certifi.where() also seems to return the expected location for its certificates: '/etc/ssl/certs/ca-certificates.crt' [22:28] r = requests.get("https://raw.githubusercontent.com/puppetlabs/install-puppet/main/install.sh", verify=False) works so i guess something certificates... [22:40] The issue is on 22.04 but not on 20.04, both using 22.4.2 but different python versions [22:51] minimal: the locales-all package was not added to the list. I'll test this... [22:58] https://github.com/canonical/cloud-init/pull/1957 [22:58] -ubottu:#cloud-init- Pull 1957 in canonical/cloud-init "add function is_virtual to distro/FreeBSD" [Open] [23:01] xtalkme: I was referring to smoser's reference to "some local page" === esv_ is now known as esv [23:23] minimal: No success: /etc/default/locale -> LANG=C.UTF-8 and should be LANG=en_DK.UTF-8 -- log file claims "invalid locale", however "localectl set-locale LANG=en_DK.UTF-8" works [23:27] MICROburst: have you turned on debugging for cloud-init and then looked in /var/log/cloud-init.log to see what it shows for cc_locale? [23:28] actually, hang on, is there such as thing as en_DK? Danish English? [23:29] oh there is, first I've ever seen it mentioned, wow [23:30] so you have the "locales" Debian package installed? [23:30] minimal: best locale in the world. [23:30] probably ;-) [23:30] minimal: gives you english language stuff with a sensible time and date format [23:31] meena: sensible time/date format? you mean like en_GB and en_IE? [23:34] minimal: i don't know what those look like, but en_US is incomprehensible. [23:34] MICROburst: cc_locale on Debian doesn't run "localctl", it runs "update-locale" or "locale-gen" [23:34] date on my system with LC_TIME=en_DK.utf-8 gives: 2023-01-12T23:34:27 GMT [23:35] meena: well you're in Ireland now, you should be using en_IE ;-) [23:35] minimal: true [23:35] it's like en_GB but with Euros not Pounds lol [23:36] https://gist.github.com/79424923d80e70213ceef8084b61222f [23:36] MICROburst: both those commands come from the "locales" package which is why I asked you earlier if you had it installed [23:37] minimal: locales-all IS installed [23:37] MICROburst: for the 2nd time, I didn't ask you about locales-all, I asked about locales [23:37] they are 2 different packages [23:38] minimal: package 'locale' is installed too. [23:39] so perhaps test manually if the "update-locale" and "locale-gen" commands work as that's what cloud-init is using [23:40] meena: you're using those settings? ;-) [23:41] minimal: i have no idea. I assume the system knows what it's doing. I set this via the GUI. [23:42] this makes me wonder if there's ga_IE? [23:42] meena: so your part of Ireland is using Danish Krone for currency? lol [23:43] damn, forgot about that bit [23:43] yupe, there is ga_IE indeed [23:43] minimal: "update-locale" and "locale-gen" do not have an impact on /etc/default/locale [23:44] though you're not in a Gaeltacht are you? [23:44] minimal: very close to one [23:44] MICROburtst: I'm looking at the cloud-init distro/debian.py functions for locale handling and they do not use localctl (apart from keymap), they use either update-locale or locale-gen [23:45] several people in my partner's family speak Irish, and my daughter is learning it from them, too, i hope. She's certainly learning more Irish than Bosnian. [23:45] and if yuo have debugging enabled in cloud-init you could then see the exactly commands run by cloud-init when trying to set the locale for you [23:46] meena: did 1 year of Irish decades ago and forgotten most of it [23:47] minimal: I'm using 'localectl ..." on shell to check. The .yaml file contains "locale: en_DK.UTF-8" -- So what do I need to change? [23:47] MICROburst: so you're using a command to test things that the cloud-init code does not use [23:47] minimal: https://glitch.social/@meena/108444208010644055 [23:49] MICROburst: look at cloudinit/distros/debian.py for the definition of LOCALE_CONF_FN and also at the get_locale and apply_locale functions in there [23:51] minimal: I can use for testing whatever I want - I has to work, since the system is installed. cloud-init has to set up things according to the .yaml file(s). I looked in /etc/default/locale as you recommended earlier - still "LANG=C.UTF-8" [23:52] MICROburst: "I can use for testing whatever I want" - as cloud-init does not use the localectl command then whether it works or not is irrelevant as cloud-init does not use it [23:52] or more specifically, cloud-init on Debian does not use it [23:53] minimal: So why is /etc/default/locale unchanged? - What do I need to put in user-data ... yaml? [23:54] I assume that file is unchanged because of the "invalid locale" you mentioned earlier [23:54] but I'm guess as you haven't shown any output from cloud-init.log when debugging is enabled [23:58] as the current contents of the /etc/default/locale file don't match the specified locale in your user-data then cloud-init should be running "locale-gen en_DK.UTF-8" and I assume that is what is failing [23:58] but I'm guessing whereas seeing the relevant excerpt from cloud-init.log would give specific information