Thursday, 2017-07-13

bkeroWeird. I got a python traceback adding ca-certificates-java on xenial01:12
bkeroAdding 'ca-certificates-java' to package-installs.yaml to ubuntu/package-installs.yaml should reproduce01:13
bkeroUnicodeDecodeError: 'ascii' codec can't decode byte 0xc3 in position 15: ordinal not in range(128). I think one of the certificates has an accent in the filename01:13
bkeroHave y'all seen that before?01:15
*** owalsh has quit IRC01:22
bkerohttp://paste.openstack.org/show/615224/01:27
bkerohttp://bugs.launchpad.net/diskimage-builder/+bug/168408101:51
openstackLaunchpad bug 1684081 in diskimage-builder "UnicodeDecodeError with xenial on custom package-installs" [Undecided,New]01:51
*** chhavi has joined #openstack-dib03:02
*** prometheanfire has quit IRC05:25
*** isaacb has joined #openstack-dib06:52
*** andreas-f has quit IRC07:15
*** andreas-f has joined #openstack-dib07:16
*** andreas-f has quit IRC07:17
*** isaacb_ has joined #openstack-dib07:24
*** isaacb has quit IRC07:26
*** isaacb_ has quit IRC07:29
*** isaacb_ has joined #openstack-dib07:35
*** aparnav has joined #openstack-dib08:50
*** owalsh has joined #openstack-dib09:28
*** owalsh has quit IRC10:19
*** owalsh has joined #openstack-dib10:21
*** owalsh has quit IRC10:22
*** owalsh has joined #openstack-dib10:38
*** owalsh has quit IRC10:41
*** owalsh has joined #openstack-dib10:43
*** owalsh has quit IRC11:59
*** aparnav has quit IRC12:06
*** aparnav has joined #openstack-dib12:06
*** owalsh has joined #openstack-dib12:07
*** owalsh has quit IRC12:07
*** owalsh has joined #openstack-dib12:07
*** farosas has joined #openstack-dib12:09
*** aparnav has quit IRC12:11
*** deep-book-gk_ has joined #openstack-dib13:24
*** deep-book-gk_ has left #openstack-dib13:25
*** isaacb_ has quit IRC15:06
openstackgerritMarkos Chandras (hwoarang) proposed openstack/diskimage-builder master: elements: zypper: Enable explicit sudo logging  https://review.openstack.org/48344615:31
openstackgerritMarkos Chandras (hwoarang) proposed openstack/diskimage-builder master: elements: zypper: Enable explicit sudo logging  https://review.openstack.org/48344615:33
greghaynesbkero: yea looks like the default locale is probably set to c/ascii not utf816:07
greghaynesSo that's what Python is decoding as16:07
bkerogreghaynes: Working on trusty though16:07
bkeroMaybe py2 vs py3 is the diff16:08
greghaynesbkero: possible, that would happen is subprocess proc.stdout is not implicitly decoded and wasnt in py216:12
bkerogreghaynes: that seems to be the case16:13
bkeroI tried proc.stdout.line.decode('utf-8') and it threw back at me that .decode() wasn't a method -- which means it was using py316:13
greghaynesyea but it could also be that the default locale is set to something utf8 in your trusty build16:15
greghaynesthe real question is if type(proc.stdout.line) == bytes16:15
greghayneson trusty16:15
greghaynesactually, its doing readline16:15
greghaynesI think readline has to decode16:15
greghaynesso it must be more sane locale16:16
greghaynesI think what we should have is an element that tries to set locale to somethign sane in pre-install.d16:18
greghaynesprobably infer from build host and overridable via env var16:18
*** saneax has quit IRC16:18
*** jamielennox has quit IRC16:19
bkerogreghaynes: are pre-install.d scripts sourced so that exported env vars are carried through to other stages?16:47
greghaynesenv vars exist throughout all stages16:47
bkeroSure, but if I have "#!/bin/bash \n\n export THING=true" in script.sh, then do './script.sh', I don't have $THING in my parent environment.16:48
bkeroI'd need to 'source script.sh'16:48
bkerogreghaynes: http://paste.openstack.org/show/615299/17:03
greghaynesbkero: not sure what you mean, I mean the same as all the other dib env vars we support for configuration17:04
greghaynesexcept DIB_LOCALE=17:05
greghaynesbkero: not sure what the context is in that paste, is somethign different there?17:07
bkerogreghaynes: That is just DIB_RELEASE=xenial disk-image-create -o temp.qcow2 ubuntu vm java17:07
bkero(I made the java element, it just has a package-installs.yaml of 'openjdk-8-headless-jre'17:08
bkero)17:08
greghaynesyea, so its just locale17:09
greghaynesbasically you need to have en_US-utf8 as your locale17:09
greghaynesand right now its C17:09
bkeroIn my shell it's en_US.UTF-8. I imagine that needs to be passed in to dib somehow17:10
greghaynesyes, which is what I was getting at with making an element that sets it up in pre-install.d. Id also try grepping around to make sure we dont have anything that might try to set it17:10
greghaynesI know theres some fedora specific stuff to work around some bugs there, but I dont remember if theres anythign similar on ubuntu17:11
bkeroonly in debootstrap :)17:11
bkeroand that's C.UTF-817:11
greghayneshrm17:12
greghaynesI have no idea what debootstrap does with that info17:12
bkeroMy locale.gen stuff17:13
bkeroMaybe17:13
greghaynesdo you have a shell inside of the chroot/17:13
greghaynesyou should see if locales-all is installed17:13
bkeroI can drop a shell inside package-installs-v217:13
greghaynesyea youll just want to make sure you do it as late as possible17:14
bkeroadded 'export LC_ALL=C.UTF-8' to my pre-install.d script, didn't work. Tried en_US.UTF-8 too17:14
greghaynesoh sorry - you cant export vars in those phases, only read them17:16
greghaynesbecasue each script is in a subshell17:16
bkeroThat's what I was saying earlier ._.17:16
greghaynesright so the way our env vars all work is in environment.d we export the things that the scripts need17:17
bkeroI added a pdb set_trace, will go see if there's a locales-all package17:17
bkeroThere is no locales-all package, although the locales package is installed17:19
greghaynesalso as a quick test, add that export to the package-installs script17:19
greghaynessince its script local itd work17:20
bkeroos.getenv('LC_ALL') is C, and os.getenv('LANG') is en_US.UTF-817:20
bkeroI've never seen LC_ALL and LANG differ before O_o17:20
greghaynesyea17:21
bkerook, environment.d/10-locale = 'export LC_ALL=en_US.UTF-8' for starters17:21
bkeroIt's also interpreting newlines weirdly and making the terminal look totally off17:22
bkerogreghaynes: environment.d fixed it :D17:22
greghaynesok cool so you must have the locales-all pacakge installed17:23
bkeroXenial doesn't seem to have a locales-all package17:28
bkeroat least dpkg -l didn't list it17:28
bkeroIt did have a locales package though, and that was installed17:28
greghayneshttps://packages.ubuntu.com/xenial/locales-all17:33
greghayneshrm17:33
greghaynesOH thats in universe17:33
greghaynesyea locales is the one17:34
greghaynescool17:34
bkerogreghaynes: Does it make sense for that environment.d to live in the element itself, or is this a more generic patch?17:38
*** jamielennox has joined #openstack-dib18:37
greghaynesbkero: in the element I think19:20
greghaynesbkero: well, depends what you mean by generic, I think the generic thing is to make a locale element but it might be worth an ML or similar, im curious what ianw_pto and andreas think19:20
bkeroOk, so any other element which adds a dep on ca-certificates to xenial (non-minimal) will hav this problem too19:21
greghaynesyea the larger thing is 'locale isnt being properly configured'19:21
greghaynesand IIRC thats somethign we have just punted on because it hadnt been a real issue for anyone yet19:21
greghaynesbut I am not the most up to date on the status of that19:21
bkeroDIB_LOCALE?19:22
bkero*time for ^19:22
greghaynesright, I think wed make an element called locale-config or something, it would use that var or by default check the locale on the build host and properly set it in the target19:22
*** chhavi has quit IRC19:38
openstackgerritDirk Mueller proposed openstack/diskimage-builder master: opensuse-minimal: install glibc-locale  https://review.openstack.org/47395920:50
openstackgerritDirk Mueller proposed openstack/diskimage-builder master: zypper-minimal: No point in preserving the environment here  https://review.openstack.org/48355020:51
openstackgerritDirk Mueller proposed openstack/diskimage-builder master: opensuse-minimal: install glibc-locale  https://review.openstack.org/47395920:54
*** farosas has quit IRC21:10
*** saneax has joined #openstack-dib22:01

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