/srv/irclogs.ubuntu.com/2020/02/26/#cloud-init.txt

ausfestivuswhats the best way to get some help with a cloud-init problem here?07:29
meenaausfestivus: asking a question is a good start.07:32
ausfestivuslol07:33
ausfestivussure07:33
meenan.b.: most devs (the people with @ in front of their nick) are somewhere in North America… so if us, mere mortals cannot help, you'll have to wait for them to wake up.07:34
ausfestivusim trying to debug why a script is not running when its placed in /var/lib/cloud/scripts/per-once07:34
ausfestivuson ubuntu  18.04 on azure as part  of a  scale set07:35
ausfestivusthe script IS in the above path07:35
ausfestivusroot@cptadotfvm000000:/var/lib/cloud/scripts/per-once# lsinstall-ado-agent.sh07:35
ausfestivusroot@cptadotfvm000000:/var/lib/cloud/scripts/per-once# lsinstall-ado-agent.sh07:36
ausfestivusapols for the formatting07:36
ausfestivusim following the steps at https://cloudinit.readthedocs.io/en/latest/topics/faq.html#how-can-i-debug-my-user-data07:36
ausfestivusto debug the user data07:36
meenawe've recently improved the documentation on per-X, or so i hope… i wonder if it's released on Read The Docs…07:37
ausfestivuswhen I run the `cloud-init query userdata > user-data.yaml` command, I get a bunch of python gunk. I suspect because the VM has python2 and cloud-init needs python307:38
meenaausfestivus: that shouldn't really matter. cloud-init should be using the correct python.07:39
meenaausfestivus: can you pastebin the python gunk somewhere, please?07:39
ausfestivusstandby07:41
meenai can't do anything else07:41
meenawell, i could sleep, but i don't think it's appreciated at $customer's office.07:41
meenaunless you have 20 years seniority…07:42
ausfestivuswhats the best way to paste console output in here?07:42
ausfestivuswebclient here07:42
ausfestivus```07:43
meenaausfestivus: you copy/paste the output to your favourite pastebin… or gist.github.com or whatnot, and then post the link here07:43
ausfestivus```cptuser@cptadotfvm000000:/tmp$ sudo cloud-init query userdataTraceback (most recent call last):  File "/usr/bin/cloud-init", line 11, in <module>    load_entry_point('cloud-init==19.4', 'console_scripts', 'cloud-init')()  File "/usr/lib/python3/dist-packages/cloudinit/cmd/main.py", line 893, in main    get_uptime=True, func=functor, args=(name,07:43
ausfestivusargs))  File "/usr/lib/python3/dist-packages/cloudinit/util.py", line 2558, in log_time    ret = func(*args, **kwargs)  File "/usr/lib/python3/dist-packages/cloudinit/cmd/query.py", line 124, in handle_args    instance_data['userdata'] = util.load_file(user_data_fn)  File "/usr/lib/python3/dist-packages/cloudinit/util.py", line 1372, in load_file07:43
ausfestivusreturn decode_binary(contents)  File "/usr/lib/python3/dist-packages/cloudinit/util.py", line 146, in decode_binary    return blob.decode(encoding)UnicodeDecodeError: 'utf-8' codec can't decode byte 0x8b in position 1: invalid start byte```07:43
ausfestivusyea okay07:43
meenaausfestivus: not like this… :P07:43
ausfestivushttps://gist.github.com/ausfestivus/cdd1635b9340cb2f61ee83eed071f04e07:44
ausfestivus^^ python  gunk07:44
meenaausfestivus: can you run `file /var/lib/cloud/scripts/per-once/install-ado-agent.sh`07:47
ausfestivus```cptuser@cptadotfvm000000:/tmp$ file /var/lib/cloud/scripts/per-once/install-ado-agent.sh/var/lib/cloud/scripts/per-once/install-ado-agent.sh: Bourne-Again shell script, ASCII text executable```07:48
ausfestivusthe script is fine07:48
ausfestivusif I run it from there it does the job fine07:49
meenaausfestivus: it would be nice to know which script it's complaining about07:49
ausfestivushence why im  trying  to get some debug info from cloud-init07:49
ausfestivushence the python gunk after following the debug steps in the docs07:49
meenaoooh, waaait… is it userdata it's complaining about?07:50
ausfestivusit doesnt complain07:50
meenaausfestivus: python-gunking about07:50
ausfestivusoh07:50
ausfestivus`sudo cloud-init query userdat`07:50
ausfestivus`sudo cloud-init query userdata`07:50
meenathat works?07:51
ausfestivusno07:51
ausfestivusgives the gunk07:51
meenai assumed from # that you're root.07:51
meenaausfestivus: it's odd, according to docs, gzip compressed userdata should just be decompressed…07:54
meenaand your userdata is.07:54
meenahere's a cut from /usr/share/mime/magic:07:54
meena[50:application/gzip]07:55
meena>0=^@^B^_<8b>07:55
meenathat means, gzip is identified by a magic byte sequence of 0x8b07:55
meenaausfestivus: you can try play around with https://cloudinit.readthedocs.io/en/latest/topics/analyze.html — or read the logs yourself, to figure out if this same behaviour happens on boot, cuz if it does that's a serious bug (or misconfiguration, or misunderstanding)07:58
ausfestivusare you saying  thefile in per-once should be mime-encoded?08:03
meenaausfestivus: no, i'm saying that your userdata is gzipped. that's what "python gunk" is saying. and for reasons unclear to me, cloud-init is choking on that, rather than ungzipping it, before trying to decode it as text08:11
meenathe only thing i can imagine going wrong is double gzip encoding, or, a bug.08:11
ausfestivusafk dinner08:13
ausfestivus@meena how can I debug this problem further? Any tips?09:27
ausfestivusthe debug tools in the FAQ are not working for a reason I cant decipher09:28
meenaausfestivus: pastebin your logfile, and i can help take a look. also pastebin your /var/lib/cloud-init/instance/userdata (or whatever the actual real path is)09:29
ausfestivusyou want both log files?09:31
meenasure09:31
meenaif you're unsure about your logs, cuz they're a lot, you can cloud-init clean --logs --reboot09:35
meenato get a new set of fresh logs09:35
ausfestivuscloud-init-output.log - https://pastebin.com/0CiR0yFEcloud-init.log - https://pastebin.com/iG6Up8SP09:47
ausfestivusgrrr09:47
ausfestivusstandby09:47
ausfestivuscloud-init-output.log - https://pastebin.com/0CiR0yFE09:48
ausfestivuscloud-init.log - https://pastebin.com/iG6Up8SP09:48
ausfestivusI have a userdata.txt and a userdata.txt.i both are binary data09:48
ausfestivuserr correction09:49
ausfestivus.i isnt09:49
ausfestivususerdata.txt.i https://pastebin.com/qacVGm4p09:50
meenaausfestivus: how many boots is this? did you run clean --logs --reboot?10:03
ausfestivusjust one boot, didnt run clean --logs --reboot11:16
hkominosGood morning guys. I wanted to ask the channel if cloud init works with only python3 installed. I am trying to build centos8 with cloud-init but I am facing issues. (even the upstream image of centos8 is showing missing deps for cloud-init)11:47
meenahkominos: the latest version has dropped python 2.7 support12:03
meenahkominos: but, you may wanna describe exactly what problems you're facing… or pastebin some stack-trace or similar.12:06
meenahow are you trying to build cloud-init, etc…12:06
otuborharper: quick question (because we talked about this last time): regarding BZ#1748015, I managed to fix this by adding "ExecStartPost=/usr/bin/systemctl try-restart NetworkManager.service" to cloud-final.service.12:21
otubo(I thought the bot would resolv bugzillas as well :-) - [cloud-init][RHEL7] /etc/resolv.conf lose config after reboot (initial instance is ok) - https://bugzilla.redhat.com/show_bug.cgi?id=174801512:22
ubot5bugzilla.redhat.com bug 1748015 in cloud-init "[cloud-init][RHEL7] /etc/resolv.conf lose config after reboot (initial instance is ok)" [High,Assigned]12:22
otubooh it does :-D12:23
otuborharper: do you know if this race is seen in other distros as well? Shall I send a pull-request or just keep it downstream?12:23
meenaotubo: i'd open a PR. better safe than sorry12:25
meenai can imagine an insigificant update in systemd to create this race where it wasn't there previously12:25
otubomeena: true that!12:26
hkominoshi meena!. Yes python 2.7 has been dropped (correctly in my ipinion). SO the stock Centos8 image that comes from upstream here https://cloud.centos.org/centos/8/x86_64/images/ has cloud init 18,5 installed. However a dnf update shows for example that 19.2 is available BUThttp://cpaste.info/29lw/. In my case even I have a prebuild 19.4 that I use in12:48
hkominosour centos7 images which works fine but i see even more dependancies missing http://cpaste.info/29lx/. So i am trying to figure out if is a packaging issue or a cloud-init issue. (or other)12:48
meenaseems pretty badly packaged13:01
hkominosso 19.2 is hosted upstream but cannot download it. 19.4 is packages and hosted by me. Dnf shows dependancy errros BUT all the binaries are actually visible by rpm -qa . So does that leave me with a badly build centos8 upstream image ?13:20
hkominosI just feel that the 18.5 cloud init might be causing problmes13:24
meenahkominos: you have more than one cloud-init installed?13:32
hkominosno.13:32
hkominosonly 18.5 is installed in the upstream image. I am simply unable to upgrade to any other binary13:33
meenai wouldn't exactly call a bunch of python files strewn over your filesystem a "binary"13:34
hkominos? what do you mean ?13:36
meenahkominos: if cloud-init was a self-contained binary, it might be easier to update.13:37
meenawelcome back hkominos. i hope all your sorrows are taken care of, since we last met.13:39
hkominoshahahahaha.13:39
hkominosnaaaaaah still things do not work. THat is why I turn to IRC for help13:40
meenahkominos: how did you build 19.4?13:42
meenahow was the 19.2 package built?13:42
hkominosof course I did not document all this :P. It looks like I used a spec file for the older 18.5 cloud init and just changed the binary that it pointed to. to build 19.213:53
hkominoshttp://cpaste.info/29m7/13:53
hkominoslike so13:53
meenahkominos: my company proxy doesn't trust  cPaste.info13:54
hkominosok. attempt213:54
hkominoshttps://pastebin.com/hNCwe1Xk13:56
hkominosperhaps ?13:56
hkominosok. so the spec specifies python requirements14:00
hkominosthat I do have. But it cant find them14:00
meenahkominos: have you seen https://github.com/canonical/cloud-init/blob/master/packages/redhat/cloud-init.spec.in ?14:03
meenamissing… things… are replaced with: https://github.com/canonical/cloud-init/blob/master/packages/brpm14:05
meenayou can call it from the Makefile14:05
meenamake rpm DISTRO=redhat14:05
hkominosfirst time i see this!14:35
hkominosWill get on it right away. thx14:41
rharperotubo: I suspect that if Ubuntu images only had network-manager we might see the same issue15:59
rharperotubo: would appreciate your thoughts on https://github.com/canonical/cloud-init/pull/22615:59
blackboxswmeena: thanks for being so active16:36
blackboxswit adds a lot to the cloud-init project16:37
hkominosmeena I will work on this tomorrow. But even with the spec file that you provided i get tricky issues. f.e. https://pastebin.com/tBgPrXBK16:52
hkominosDo i need python 2.7 to build cloud init ?16:53
rharperhkominos: for centos7, at this time, 2.7 is required, for python3 in centos8 etc, there's a branch with a modified spec file; that work has not yet landed, but you can get a look at those changes here: https://code.launchpad.net/~raharper/cloud-init/+git/cloud-init/+merge/36884517:01
hkominosthx!17:03
AnhVoMSFTrharper: just checking if there is anything else we need for this PR: https://github.com/canonical/cloud-init/pull/5418:55
powersjAnhVoMSFT, I don't think there is - we need to loop back and get that as part of our next SRU, but Chad can correct me if I am mistaken18:57
rharperAnhVoMSFT:  no, powersj is right; we can land that and it would get picked up in the next SRU19:25
AnhVoMSFTthanks rharper powersj19:33
meenablackboxsw: 💜21:13
meenabtw, any of you seen ausfestivus issue? i was able to pin-point the exception. but not the reason why it's happening.21:14
ausfestivusDo you sleep meena? :-p21:17
meenaausfestivus: between 23:00 and hopefully 7…21:19
meenabut my baby daughter is still pretty unpredictable.21:20

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