Live session started with wrong layout

Bug #960096 reported by Fabio Marconi
50
This bug affects 11 people
Affects Status Importance Assigned to Milestone
libxklavier
Confirmed
Medium
libxklavier (Ubuntu)
Fix Released
High
Canonical Desktop Team
ubiquity (Ubuntu)
Fix Released
High
Stéphane Graber

Bug Description

Hello

TESTCASE

- Boot a usb with persistence live session
- Select italian and set the network manager, everythings is OK.
- Select -Prova Ubuntu- let it load
- The session will be started with the english layout.

**WORKAROUND**
-System Settings -> keyboard layout -> click reset to defaults

see attached screenshot, the language is italian (installa ubuntu) but the layout is wrong

ProblemType: BugDistroRelease: Ubuntu 12.04
Package: casper 1.312
ProcVersionSignature: Ubuntu 3.2.0-19.30-generic 3.2.11
Uname: Linux 3.2.0-19-generic x86_64
ApportVersion: 1.94.1-0ubuntu2
Architecture: amd64
CasperVersion: 1.312
Date: Tue Mar 20 11:00:47 2012LiveMediaBuild: Ubuntu 12.04 LTS "Precise Pangolin" - Alpha amd64 (20120320)
ProcEnviron:
 TERM=xterm
 LANG=it_IT.UTF-8
 SHELL=/bin/bashSourcePackage: casper
UpgradeStatus: No upgrade log present (probably fresh install)

Revision history for this message
Fabio Marconi (fabiomarconi) wrote :
description: updated
Revision history for this message
Ubuntu QA Website (ubuntuqa) wrote :

This bug has been reported on the Ubuntu ISO testing tracker.

A list of all reports related to this bug can be found here:
http://iso.qa.ubuntu.com/qatracker/reports/bugs/960096

tags: added: iso-testing
Changed in casper (Ubuntu):
assignee: nobody → Stéphane Graber (stgraber)
status: New → In Progress
affects: casper (Ubuntu) → ubiquity (Ubuntu)
Revision history for this message
Stéphane Graber (stgraber) wrote :

From IRC:

16:40 <stgraber> I've been spending a few days on an annoying keyboard layout bug with the live images
16:41 <stgraber> that I think I tracked down to something related to lightdm and unity-greeter
16:41 <stgraber> basically, if I start lightdm in autologin mode, I get a US english layout
16:41 <mterry> whoops
16:41 <stgraber> if I start it in normal mode and login manually, then I get the right keyboard layout
16:42 <mterry> Ah... hm
16:42 <stgraber> https://bugs.launchpad.net/ubuntu/+source/ubiquity/+bug/960096
16:43 <stgraber> ubiquity in greeter mode sets org.gnome.libgnomekbd.keyboard layouts with the list and uses xklavier to switch to the first layout and then also calls setxkmap
                 to avoid some race conditions.
16:43 <stgraber> so everything is set properly for the user session
16:43 <stgraber> /var/lib/AccountsService/users/ubuntu also contains the right keyboard layouts
16:44 <mterry> so the greeter is just being a jerk and resetting it.
16:45 <mterry> i'll look at it today
16:45 <stgraber> well, the weird part is that I'd have expected the greeter reseting it when I actually see the greeter :)
16:45 <stgraber> but in this case, it only gets reset when doing autologin
16:45 <stgraber> logging in through the greeter is the case that actually works ;)

So I confirmed that if from a shell I completely stop lightdm, then start it again using autologin, I get a US keyboard.
If I do the same but without the autologin config entries, I get the expected Italian keyboard.

That also explains why doing a logout from the live session and logging back into the session works as doing so goes through the non-autologin path.

Revision history for this message
Michael Terry (mterry) wrote :

This also affects non-live-CD sessions. As stgraber mentioned to me on IRC, this seems like it might be a bug in gnome-settings-daemon failing to set the layout...?

Revision history for this message
Fabio Marconi (fabiomarconi) wrote :

Idf can be useful, against gnome-settings-daemon, I've reported bug 956824
---
Ubuntu Bug Squad volunteer triager
http://wiki.ubuntu.com/BugSquad

Revision history for this message
Michael Terry (mterry) wrote :

This also isn't shell specific. GNOME‌‌ Shell has the same behavior, though its keyboard indicator at least is honest about it and shows "en" (Unity's indicator optimistically assumes your layout was set correctly and shows what it *should* be).

Revision history for this message
Michael Terry (mterry) wrote :

When I don't have "English (US)" in my layout list, everything works fine....

Changed in ubiquity (Ubuntu):
assignee: Stéphane Graber (stgraber) → Canonical Desktop Team (canonical-desktop-team)
importance: Undecided → High
affects: ubiquity (Ubuntu) → gnome-settings-daemon (Ubuntu)
Changed in gnome-settings-daemon (Ubuntu):
assignee: Canonical Desktop Team (canonical-desktop-team) → Stéphane Graber (stgraber)
assignee: Stéphane Graber (stgraber) → nobody
assignee: nobody → Canonical Desktop Team (canonical-desktop-team)
Revision history for this message
Stéphane Graber (stgraber) wrote :

Ouch, sorry for the mess, Launchpad seems to be oopsing a lot tonight...
Moving this bug over to the desktop team, I remain directly subscribed in case ubiquity actually needs changing.

So the problem we've noticed so far is that if you have "org.gnome.libgnomekbd.keyboard layouts" set to "['it','it\tnodeadkeys','it\tmac','it\tus']" like you do after running the ubiquity greeter and start a gnome session without going through the unity-greeter, you'll end up having the US layout set instead of the "it" layout you'd expect.

This can easily be reproduced on a machine without any open X session, logging in as a user and running:
 - gsettings set org.gnome.libgnomekbd.keyboard layouts "['it','it\tnodeadkeys','it\tmac','it\tus']"
 - startx

You'll notice that the keyboard indicator shows "it" as expected, but the actual layout is US.

Revision history for this message
Michael Terry (mterry) wrote :

Downgrading libxklavier to 11.10's version fixes this for me. Looking into changes now.

affects: gnome-settings-daemon (Ubuntu) → libxklavier (Ubuntu)
Revision history for this message
In , Michael Terry (mterry) wrote :

Originally reported in Ubuntu: https://bugs.launchpad.net/bugs/960096 using libxklavier 5.2.1

We had a problem where after autologin, the wrong keyboard layout group would get selected instead of the default.

Seems to be caused by http://cgit.freedesktop.org/libxklavier/commit/?id=18e75ba865e5f23b5e0b6926cc20ee82b0782084

To reproduce:
1) gsettings set org.gnome.libgnomekbd.keyboard layouts "['it','it\tnodeadkeys','it\tus']"
2) startx # assuming this launches GNOME Shell or Unity, haven't tested other environments)

Notice that your layout ends up being "it\tus" instead of "it". If you instead set your layouts to ['it','it\tnodeadkeys','it\tmac'], you DO NOT get the bug. That is, libxklavier is matching against the 'us' part of 'it\tus' for some reason.

Revision history for this message
Michael Terry (mterry) wrote :

Seems to be due to http://cgit.freedesktop.org/libxklavier/commit/?id=18e75ba865e5f23b5e0b6926cc20ee82b0782084

I'm going to push a version of the package that reverts that patch. Since the bug it fixes (https://bugzilla.gnome.org/show_bug.cgi?id=649377) seems less bad than this one.

Meanwhile, I've filed a bug upstream about this issue, linked to this bug.

Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package libxklavier - 5.2.1-1ubuntu1

---------------
libxklavier (5.2.1-1ubuntu1) precise; urgency=low

  * debian/patches/revert-default-group-change.patch:
    - Revert change in group handling that can cause the wrong layout to
      be enabled by default when autologging in. LP: #960096
 -- Michael Terry <email address hidden> Wed, 21 Mar 2012 14:32:39 -0400

Changed in libxklavier (Ubuntu):
status: In Progress → Fix Released
Changed in libxklavier:
importance: Unknown → Medium
status: Unknown → Confirmed
Revision history for this message
Fabio Marconi (fabiomarconi) wrote :

Reopened as not fixed
In yesterday buil;d it wasn-t present, but today-s it is back with libxklavier updated.
See attached screenshot

Changed in libxklavier (Ubuntu):
status: Fix Released → Triaged
Revision history for this message
Fabio Marconi (fabiomarconi) wrote :

Ah, the right side button is the bug 962949

Revision history for this message
In , Sergey V. Udaltsov (svu) wrote :

If you disable autologin - what is the layout used in GDM?

Revision history for this message
In , Michael Terry (mterry) wrote :

I'm not sure. Ubuntu doesn't use GDM by default. LightDM happens to do the right thing, and leaves the layout correct when it starts the user session, which is why the Ubuntu bug mentions autologin.

But autologin is a bit of a red herring, because the reproduction steps I gave don't involve a display manager at all, just startx.

description: updated
Revision history for this message
Sergio Zanchetta (primes2h) wrote :

Confirmed with daily build (20120402) live usb with persistence.
After first boot and selecting Italian, i get us keyboard.
After rebooting i get the correct "it" one.

It's not related at all probably, but have you had a look into this recently fixed bug #926207 ?

Revision history for this message
Ubuntu QA Website (ubuntuqa) wrote :

This bug has been reported on the Ubuntu localized ISO testing tracker.

A list of all reports related to this bug can be found here:
http://localized-iso.qa.ubuntu.com/qatracker/reports/bugs/960096

tags: added: localized-iso
Revision history for this message
Michael Terry (mterry) wrote :

Hrm. :( I can't reproduce with latest nightlies (in Unity 2D). Maybe Unity 3D is a part of the puzzle? Will try that.

Revision history for this message
Michael Terry (mterry) wrote :

Scratch that, I just got it on the Live CD, trying the exact same thing I did before... Suggests something is racy here.

Revision history for this message
Sergio Zanchetta (primes2h) wrote :

Tried Precise build 20120403, I can't reproduce it in a VM, but It appears with a persistent usb disk.

Revision history for this message
Michael Terry (mterry) wrote :

I've gotten it twice in a VM, out of ~15 or so tries. When I've gotten it, oddly enough, the Log Out button in the session menu isn't present. So that deserves investigation... /me looks further

Revision history for this message
Michael Terry (mterry) wrote :

OK. I've dumped all gsettings keys in a session with the bug and one without:

Without bug: http://paste.ubuntu.com/915169/plain/
With bug: http://paste.ubuntu.com/915170/plain/

Now, the differences (slightly edited to remove timestamp differences etc) are:

"""
-com.canonical.indicator.session suppress-logout-menuitem false
+com.canonical.indicator.session suppress-logout-menuitem true

-org.gnome.desktop.media-handling automount-open true
-org.gnome.desktop.media-handling automount true
-org.gnome.desktop.media-handling autorun-never false
+org.gnome.desktop.media-handling automount false
+org.gnome.desktop.media-handling automount-open false
+org.gnome.desktop.media-handling autorun-never true

-org.gnome.libgnomekbd.keyboard layouts ['it', 'it\tnodeadkeys', 'it\tmac', 'it\tus']
+org.gnome.libgnomekbd.keyboard layouts ['us', 'cm', 'gb', 'gh']
"""

Note that this is *not* the original bug here. In this case, the menu is correctly showing the layouts as represented by gsettings. So this is a different bug about why some settings on the LiveCD are racy and not what we'd expect.

Revision history for this message
Michael Terry (mterry) wrote :

Added a ubiquity task, since stgraber indicated on IRC that it does this sort of gsettings tomfoolery. Perhaps it's killing the dconf daemon before it writes to disk? Or setting sometimes isn't working?

Changed in ubiquity (Ubuntu):
status: New → Fix Committed
assignee: nobody → Stéphane Graber (stgraber)
Revision history for this message
Launchpad Janitor (janitor) wrote :

This bug was fixed in the package ubiquity - 2.10.7

---------------
ubiquity (2.10.7) precise; urgency=low

  [ Colin Watson ]
  * Fix partman plugin to preseed grub-installer/bootdev in a cleanup method
    rather than exit_ui_loops, since talking to debconf in the latter isn't
    safe (LP: #792652). Adjust how maybe_update_grub gets the default boot
    device to avoid regressing LP #756920.

  [ Stéphane Graber ]
  * Add support for Windows 8 user directory detection.
  * Make wubi work when the OS data partition is different from the boot
    partition. (LP: #772470)
  * Call gsettings through dbus-launch in an hope to ensure its changes
    are saved to disk. (LP: #960096)
  * Make ubiquity depend on dbus-x11 for dbus-launch.
  * Update compat/os-proper to make a different cache when listing OS
    data partitions. (LP: #772470)
  * Automatic update of included source packages: migration-assistant
    0.6.12.
 -- Stephane Graber <email address hidden> Wed, 04 Apr 2012 20:56:08 -0400

Changed in ubiquity (Ubuntu):
status: Fix Committed → Fix Released
Revision history for this message
Michael Terry (mterry) wrote :

OK, so stgraber pushed in a fix based on running gsettings under a dbus-launch call. This may fix it for 2 reasons:

(1) when I run sudo gsettings, I need to instead use sudo dbus-launch gsettings or it won't work at all, because the session dbus can't be shared with other users like that (though I would think that if this were the problem, it would never work at all, not that it would still work most of the time)

and (2) when the mini dbus session dies, presumably the dbus daemon will write anything to disk that it was holding on to.

I just tested last night's ISO 12 times and it worked each time. Is this fixed for others too?

Revision history for this message
Fabio Marconi (fabiomarconi) wrote :

Hello
In today's build isn't present.
I will surely perform others daily tests for the next week.
Thanks guys
Fabio

Michael Terry (mterry)
Changed in libxklavier (Ubuntu):
status: Triaged → Fix Released
Revision history for this message
Stian Sigbjørnsen (stian-sigbjoernsen) wrote :

Bug is present in daily build 20120410. Will try 20120411 now.

Revision history for this message
Stian Sigbjørnsen (stian-sigbjoernsen) wrote :

Bug still somewhat present in daily build 20120411. First boot after installation, keyboard layout is correct (in my case Norwegian). After installing updates and rebooting, keyboard language is changed to English, and I have to run dpkg-reconfigure keyboard-configuration. Applies to every reboot.

Revision history for this message
Øyvind Stegard (oyvindstegard) wrote :

Just upgraded from an Oneiric-install, and the only way I can get proper Norwegian layout is to run "dpkg-reconfigure keyboard-configuration" from within the X-session and re-select already correct settings for Norwegian. It will only last for that single session. Logging out and back in causes wrong English layout to be used again.

$ LC_MESSAGES=C apt-cache policy libxklavier16
libxklavier16:
  Installed: 5.2.1-1ubuntu1
  Candidate: 5.2.1-1ubuntu1
  Version table:
 *** 5.2.1-1ubuntu1 0
        500 http://no.archive.ubuntu.com/ubuntu/ precise/main amd64 Packages
        100 /var/lib/dpkg/status

Revision history for this message
Øyvind Stegard (oyvindstegard) wrote :

LightDM always uses the wrong layout, even though it says "No" in top right corner (keyboard layout indicator).

Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

I'm reopening this report because it still exists in ubiquity 2.10.12

Changed in ubiquity (Ubuntu):
status: Fix Released → Triaged
importance: Undecided → High
Revision history for this message
Michael Terry (mterry) wrote :

I can't reproduce with either Italian or Norwegian Bokmal. For each, I did "Try Ubuntu", installed, rebooted, updated, rebooted, turned on autologin, rebooted. In each case I tested that the layout was displayed correctly and worked correctly.

Can you give clear reproduction steps?

Revision history for this message
Fabio Marconi (fabiomarconi) wrote :

I don't have seen it with or without persistence fro the day of the fix for all my install tests

Revision history for this message
Stian Sigbjørnsen (stian-sigbjoernsen) wrote : Re: [Bug 960096] Re: Live session started with wrong layout

Skip the "Try Ubuntu"-step and install directly. That's why I started a separate bug report.

Mvh,
Stian Sigbjørnsen

Den 16. apr. 2012 kl. 17:58 skrev Michael Terry <email address hidden>:

> I can't reproduce with either Italian or Norwegian Bokmal. For each, I
> did "Try Ubuntu", installed, rebooted, updated, rebooted, turned on
> autologin, rebooted. In each case I tested that the layout was
> displayed correctly and worked correctly.
>
> Can you give clear reproduction steps?
>
> --
> You received this bug notification because you are subscribed to a
> duplicate bug report (970146).
> https://bugs.launchpad.net/bugs/960096
>
> Title:
> Live session started with wrong layout
>
> Status in libxklavier - XKB foundation libary:
> Confirmed
> Status in “libxklavier” package in Ubuntu:
> Fix Released
> Status in “ubiquity” package in Ubuntu:
> Triaged
>
> Bug description:
> Hello
>
> TESTCASE
>
> - Boot a usb with persistence live session
> - Select italian and set the network manager, everythings is OK.
> - Select -Prova Ubuntu- let it load
> - The session will be started with the english layout.
>
> **WORKAROUND**
> -System Settings -> keyboard layout -> click reset to defaults
>
> see attached screenshot, the language is italian (installa ubuntu) but
> the layout is wrong
>
> ProblemType: BugDistroRelease: Ubuntu 12.04
> Package: casper 1.312
> ProcVersionSignature: Ubuntu 3.2.0-19.30-generic 3.2.11
> Uname: Linux 3.2.0-19-generic x86_64
> ApportVersion: 1.94.1-0ubuntu2
> Architecture: amd64
> CasperVersion: 1.312
> Date: Tue Mar 20 11:00:47 2012LiveMediaBuild: Ubuntu 12.04 LTS "Precise Pangolin" - Alpha amd64 (20120320)
> ProcEnviron:
> TERM=xterm
> LANG=it_IT.UTF-8
> SHELL=/bin/bashSourcePackage: casper
> UpgradeStatus: No upgrade log present (probably fresh install)
>
> To manage notifications about this bug go to:
> https://bugs.launchpad.net/libxklavier/+bug/960096/+subscriptions

Revision history for this message
Jean-Baptiste Lallement (jibel) wrote :

I reproduce this defect on a Mac Mini and an Asus Eee PC 1015PE but not on a DELL N4010

Here are the steps I follow:
1. Boot from a usb stick without persistence
2. In ubiquity-dm select 'French'
3. click on 'Try Ubuntu'
4. Let the Live session start
5. Open a terminal (CTRL+ALT+T) or the Dash
6. Press 'a'

EXPECTED RESULT:
'a' is printed on the screen

ACTUAL RESULT
'q' is printed on the screen

Revision history for this message
Fabio Marconi (fabiomarconi) wrote :

Hello Jibel
I've done your testcase and in my case is OK , I'm italian and I've got a qwerty keyboard then the keyboard is correctly detected as a italian keyboard (probably by linux or xorg evdev) and if I go to see the french keymap you use the azerty type.
So I think that this bug isn't related at all.
I've done also an install test selecting français as language, but it propose me italian as keyboard layout, and this is right because this is an italian keyboard.
Another thing is that it propose my timezone as Rome, so the environement is perfectly localized.
Test done connected by wire and usb without persistence.
see attached screenshots

Revision history for this message
Fabio Marconi (fabiomarconi) wrote :

Timezone rigthly detected
---
Ubuntu Bug Squad volunteer triager
http://wiki.ubuntu.com/BugSquad

Revision history for this message
Fabio Marconi (fabiomarconi) wrote :

keyboard righly detected respect the language selection.
---
Ubuntu Bug Squad volunteer triager
http://wiki.ubuntu.com/BugSquad

Revision history for this message
Fabio Marconi (fabiomarconi) wrote :

On another machine I can confirm Jibel's issue.
I've seen that clicking on the little keyboard, selecting keyboard layout and clicking reset to defaults it jump from french to english

Revision history for this message
Fabio Marconi (fabiomarconi) wrote :

Just now is out the respin, retest

Revision history for this message
Fabio Marconi (fabiomarconi) wrote :

same behaviors, just now i've discovered that it propose the italian layout during the installation when connected to internet.
But the bug remain with the fr layout selected and english in effect, so I confirm this existing with FR language but not with IT

Revision history for this message
Michael Terry (mterry) wrote :

Note that this is a different bug than originally (that was only with autologin) and a different bug than the ubiquity one (which was about gsettings not being correct).

This one seems to be about variants confusing everything. If you have "fr\toss" (French (Alternative)) as your first layout, you seem to get this bug, even outside of the LiveCD. I'm looking into why. It affects both Unity Greeter and the session itself.

Revision history for this message
Michael Terry (mterry) wrote :

Running with libxklavier debugging turned to max, looks like we get this after trying to set the keyboard layout in unity-greeter:

"Unexpected by libxklavier X ERROR: 0x8351fb8, 163f0005, 2 [], X11 request: 145, minor code: 9"

That 2 in there is the X error code, which means BadValue. I assume 145 is the major op code that got assigned for the XKBFile extension. If so, 9 is the X_kbSetMap request. Which all fits with an error trying to set the new layout map.

So the question is why we got BadValue... Looking into why xkbfile would do that.

Revision history for this message
Michael Terry (mterry) wrote :

Oh wait. I do believe that the error code is relative to the extension. So for libxkbfile, 2 means _XkbErrMissingTypes, or "key types not defined".

So it seems the map file doesn't have it's key types defined... Does anyone more familiar with layouts know what that means? /me goes on IRC.

Revision history for this message
Fabio Marconi (fabiomarconi) wrote :

Hello Michael

IMHO is the same beast of bug 973277 (read just step 32) affecting network manager (who can miss or reset the settings ??).
This afflict russian languages too, not only french.

Revision history for this message
Fabio Marconi (fabiomarconi) wrote :

And i think that NM bug afflict everyone

Revision history for this message
Fabio Marconi (fabiomarconi) wrote :

OOOOOOO, sorry bug 973227 everytime I fail !!!

Revision history for this message
Stéphane Graber (stgraber) wrote :

Fabio: Please don't try and mix all your bugs, this one clearly looks like a libxklavier issue as we actually have an error message.

Your Network Manager problem rather looks like a race in Network Manager, some policykit weirdness or an issue caused by the lack of inotify support on overlayfs.

Let's take the issues one by one if we want to have any of these solved for release.

Thanks

Revision history for this message
Michael Terry (mterry) wrote :

I created bug 985065 to deal with this new fr/oss issue, since I don't want to keep beating the dead horse of this bug.

Changed in ubiquity (Ubuntu):
status: Triaged → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Duplicates of this bug

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.