Bug 869897

Summary: UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in position 2: ordinal not in range(128)
Product: [Fedora] Fedora Reporter: f.zsadany
Component: firstbootAssignee: Vratislav Podzimek <vpodzime>
Status: CLOSED WONTFIX QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 18CC: bcl, msivak
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Unspecified   
Whiteboard: abrt_hash:2d2671533112a36a8a92d439757e3d00d7cda765047f40cd0e3c4c29cf77078c
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-10-14 10:47:37 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
File: other involved packages
none
File: environ
none
File: type
none
File: hashmarkername
none
File: firstboot-tb
none
File: release
none
/var/log/messages with firstboot messages while locale is hu.UTF-8 none

Description f.zsadany 2012-10-25 05:32:04 UTC
Description of problem:
Half the time i boot fedora ( for all f18 kernels i used ) , after the loading process i get no login ( no graphical no text based ) ,and if i get one instead of some of the icons i see some random noiselike pictures ( for ex just above the login name or the power button icon , but if i move the mouse above it , i get the good one) .

Version-Release number of selected component:
firstboot-18.5-1.fc18.x86_64

Additional info:
libreport version: 2.0.16
cmdline:        /usr/bin/python  /usr/sbin/firstboot
kernel:         3.6.3-3.fc18.x86_64

description:
:Traceback from firstboot:
:firstboot 18.5 exception report
:Traceback (most recent call last):
:  File "/usr/sbin/firstboot", line 155, in <module>
:    reconfig=opts.reconfig)
:  File "/usr/lib/python2.7/site-packages/firstboot/loader.py", line 68, in load_modules
:    imported = __import__(module)
:  File "/usr/share/firstboot/modules/create_user.py", line 34, in <module>
:    from firstboot.pwcheck import Password
:  File "/usr/lib/python2.7/site-packages/firstboot/pwcheck.py", line 41, in <module>
:    class Password(object):
:  File "/usr/lib/python2.7/site-packages/firstboot/pwcheck.py", line 48, in Password
:    _("Fairly strong"),
:  File "/usr/lib/python2.7/site-packages/firstboot/pwcheck.py", line 34, in <lambda>
:    _ = lambda x: gettext.ldgettext("firstboot", x)
:  File "/usr/lib64/python2.7/gettext.py", line 543, in ldgettext
:    return t.lgettext(message)
:  File "/usr/lib64/python2.7/gettext.py", line 368, in lgettext
:    return tmsg.encode(locale.getpreferredencoding())
:UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in position 2: ordinal not in range(128)

Comment 1 f.zsadany 2012-10-25 05:32:08 UTC
Created attachment 633163 [details]
File: other involved packages

Comment 2 f.zsadany 2012-10-25 05:32:11 UTC
Created attachment 633164 [details]
File: environ

Comment 3 f.zsadany 2012-10-25 05:32:14 UTC
Created attachment 633165 [details]
File: type

Comment 4 f.zsadany 2012-10-25 05:32:16 UTC
Created attachment 633166 [details]
File: hashmarkername

Comment 5 f.zsadany 2012-10-25 05:32:18 UTC
Created attachment 633167 [details]
File: firstboot-tb

Comment 6 f.zsadany 2012-10-25 05:32:20 UTC
Created attachment 633168 [details]
File: release

Comment 7 Martin Sivák 2012-10-25 07:48:07 UTC
Can you please describe the details of an action that leads to this traceback?

Comment 8 f.zsadany 2012-10-25 17:40:31 UTC
A simple boot. No real action made here. I just boot the os.

Comment 9 f.zsadany 2012-10-25 17:45:34 UTC
The error occurs during boot. Sometime it even gets stuck after the fedora logo loaded (the f logo that fills up during boot).

Comment 10 Martin Sivák 2012-10-31 17:02:48 UTC
OK, can you describe the exact install steps used to install system which behaves like this? There should be a kickstart file in /root, can you please attach it here too?

Comment 11 Steve Tyler 2012-10-31 17:44:33 UTC
The attached environ file shows an invalid locale:
LANG=hu.UTF-8

The workaround is to edit /etc/sysconfig/i18n and /etc/locale.conf:
LANG=hu_HU.UTF-8

See:
Bug 858591 - anaconda setting invalid system locale xx.UTF-8 not xx_YY.UTF-8 

$ LANG=hu.UTF-8 locale
locale: Cannot set LC_CTYPE to default locale: No such file or directory
locale: Cannot set LC_MESSAGES to default locale: No such file or directory
locale: Cannot set LC_ALL to default locale: No such file or directory
LANG=hu.UTF-8
LC_CTYPE="hu.UTF-8"
LC_NUMERIC="hu.UTF-8"
LC_TIME="hu.UTF-8"
LC_COLLATE="hu.UTF-8"
LC_MONETARY="hu.UTF-8"
LC_MESSAGES="hu.UTF-8"
LC_PAPER="hu.UTF-8"
LC_NAME="hu.UTF-8"
LC_ADDRESS="hu.UTF-8"
LC_TELEPHONE="hu.UTF-8"
LC_MEASUREMENT="hu.UTF-8"
LC_IDENTIFICATION="hu.UTF-8"
LC_ALL=

$ locale -a | grep hu
hu_HU
hu_HU.iso88592
hu_HU.utf8
hungarian
lithuanian

Comment 12 Steve Tyler 2012-10-31 19:42:35 UTC
Rerun firstboot with:
LANG="hu.UTF-8"


Package: firstboot-18.5-1.fc18.x86_64
OS Release: Fedora release 18

Comment 13 Steve Tyler 2012-10-31 19:56:39 UTC
(In reply to comment #12)
> Rerun firstboot with:
> LANG="hu.UTF-8"
> 
> 
> Package: firstboot-18.5-1.fc18.x86_64
> OS Release: Fedora release 18

UnicodeEncodeError traceback reproduced by editing /etc/sysconfig/i18n and /etc/locale.conf:
LANG="hu.UTF-8"
and reenabling firstboot.

I didn't see any any graphics corruption, though.

What version of the installer disc was used? In particular, what version of anaconda?

Tested after installing and updating using 'sr_RS.UTF-8@latin':
$ qemu-kvm -m 4096 -hda f18-test-2.img -cdrom ~/xfr/fedora/F18/F18-Beta/TC6/Fedora-18-Beta-TC6-x86_64-Live-Desktop.iso -usb -vga qxl -boot menu=on -usbdevice mouse

Comment 14 f.zsadany 2012-11-01 01:57:27 UTC
Good question . I have no idea . An early version of alfa. It was a nightly live compose iso. I downloaded it near the start of october. October 8 maybe.

Comment 15 Steve Tyler 2012-11-01 02:43:06 UTC
Thanks. The nightly composes are kept for two weeks[1], but the version of anaconda used to install can be found in this log file:

/var/log/anaconda/anaconda.log

Could you attach it?

The bug with the invalid locales was:
Fixed In Version: 	anaconda-18.13-1 [2]

[1] http://alt.fedoraproject.org/pub/alt/nightly-composes/
[2] Bug 858591 - anaconda setting invalid system locale xx.UTF-8 not xx_YY.UTF-8

Comment 16 Steve Tyler 2012-11-01 03:43:31 UTC
Created attachment 636428 [details]
/var/log/messages with firstboot messages while locale is hu.UTF-8

This log is from the VM where I reproduced the UnicodeEncodeError traceback.

[snippets from /var/log/messages]
...
Oct 31 15:35:21 localhost firstboot[535]: INFO:firstboot.frontend:setting LANG to hu.UTF-8
...
Oct 31 15:35:24 localhost firstboot[535]: Using the fallback 'C' locale.
...
Oct 31 15:35:25 localhost firstboot[535]: UnicodeEncodeError: 'ascii' codec can't encode character u'\xe9' in position 2: ordinal not in range(128)
...

Comment 17 f.zsadany 2012-11-01 21:18:02 UTC
Searched all over for the log file mentioned but no luck here. There's no anaconda directory or file in the /var/log directory or anywhere else. Is that normal ?

Comment 18 Steve Tyler 2012-11-02 05:09:11 UTC
Normally, anaconda copies its log files to /var/log/anaconda/. There could have been a bug in the version you installed with that prevented them from being copied. Did your install complete normally?

Since you installed from a Live CD, you might have anaconda installed:

$ rpm -q anaconda
$ sudo grep anaconda /var/log/yum.log

As a last resort, the timestamps from the oldest version of /var/log/messages might show when you installed:

$ ls -l /var/log/messages*
$ sudo head /var/log/messages # the oldest one you have

Or this:
$ ls -lFt /var/log/ | tail

Comment 19 f.zsadany 2012-11-03 00:27:07 UTC
I don't remember any error during install. 
$ sudo grep anaconda /var/log/yum.log gives: 
Oct 06 04:13:58 Updated: anaconda-widgets-18.12-1.fc18.x86_64
Oct 06 04:14:50 Updated: anaconda-18.12-1.fc18.x86_64
Oct 18 02:27:15 Updated: anaconda-widgets-18.17-1.fc18.x86_64
Oct 18 02:28:42 Updated: anaconda-18.17-1.fc18.x86_64
Oct 19 06:49:38 Updated: anaconda-widgets-18.18-1.fc18.x86_64
Oct 19 06:50:51 Updated: anaconda-18.18-1.fc18.x86_64
Oct 20 08:51:52 Updated: anaconda-widgets-18.19-1.fc18.x86_64
Oct 20 08:51:54 Updated: anaconda-18.19-1.fc18.x86_64
Oct 27 00:40:06 Updated: anaconda-widgets-18.21-1.fc18.x86_64
Oct 27 00:40:20 Updated: anaconda-18.21-1.fc18.x86_64
Nov 02 05:15:35 Updated: anaconda-widgets-18.22-1.fc18.x86_64
Nov 02 05:15:58 Updated: anaconda-18.22-1.fc18.x86_64
Nov 02 23:44:50 Updated: anaconda-widgets-18.23-1.fc18.x86_64
Nov 02 23:44:52 Updated: anaconda-18.23-1.fc18.x86_64

Comment 20 Steve Tyler 2012-11-03 01:57:22 UTC
(In reply to comment #19)
> I don't remember any error during install. 
> $ sudo grep anaconda /var/log/yum.log gives: 
> Oct 06 04:13:58 Updated: anaconda-widgets-18.12-1.fc18.x86_64
> Oct 06 04:14:50 Updated: anaconda-18.12-1.fc18.x86_64
...

Thanks. This means that you installed with a version of anaconda earlier than 18.12-1. Versions 18.12-1 and earlier have Bug 858591, which causes invalid locales to be  written to these files:[1]

1. /var/lib/AccountsService/users/<your-login-name>
2. /etc/sysconfig/i18n
3. /etc/locale.conf

If you want to confirm that the bug can be "fixed", you can edit them to have:

hu_HU.UTF-8

You can see all valid locale names with this:
$ ls /usr/share/i18n/locales/

Or you could reinstall with F18-Beta, which is due to be released 2012-11-13.[2]

[1] Bug 858591, Comment 29
[2] https://fedoraproject.org/wiki/Releases/18/Schedule
    See also:
    Subject: Fedora 18 Beta to slip by one week
    http://article.gmane.org/gmane.linux.redhat.fedora.test.announce/551

Comment 21 Fedora Admin XMLRPC Client 2013-10-14 09:19:04 UTC
This package has changed ownership in the Fedora Package Database.  Reassigning to the new owner of this component.

Comment 22 Vratislav Podzimek 2013-10-14 10:47:37 UTC
The firstboot utility is deprecated and no longer developed in Fedora 19 and newer releases. It was replaced by the initial-setup utility with a completely different codebase. If you still have any similar problems with Fedora 19 or later, please file a new bug against initial-setup or gnome-initial-setup if you did a GNOME install.