GNOME Bugzilla – Bug 343762
Error activating XKB configuration
Last modified: 2007-06-09 00:04:50 UTC
Please describe the problem: The bug is probably filed for the wrong application but I didn't find anything that looked more correct than this category: Whenever I log in to gnome I get the following error dialogue: Error activating XKB configuration. It can happen under various circumstances: - a bug in libxklavier library - a bug in X server (xkbcomp, xmodmap utilities) - X server with incompatible libxkbfile implementation X server version data: The X.Org Foundation 70000000 If you report this situation as a bug, please include: - The result of xprop -root | grep XKB - The result of gconftool-2 -R /desktop/gnome/peripherals/keyboard/kbd I haven't noticed anything negative caused by it though, it's just a bit annoying to have to click ok to an error every time I log in. The output by the suggested commands is: xprop -root | grep XKB : _XKB_RULES_NAMES_BACKUP(STRING) = "xorg", "pc105", "fi", "", "" _XKB_RULES_NAMES(STRING) = "xorg", "pc105", "fi", "", "" gconftool-2 -R /desktop/gnome/peripherals/keyboard/kbd : layouts = [fi,dvorak,dvorak se] model = pc105 overrideSettings = false options = [grp grp:alts_toggle] Steps to reproduce: 1. By logging in to gnome 2. 3. Actual results: Expected results: Does this happen every time? Other information:
Moving to gnome-control-center
I get the same message each time GNOME tries to apply changes in XKB configuration (that is, on start and on any change of keyboard layouts in the Keyboard preferences). My config is: $ xprop -root | grep XKB _XKB_RULES_NAMES_BACKUP(STRING) = "xorg", "pc104", "us,ru", ",winkeys", "grp:caps_toggle" _XKB_RULES_NAMES(STRING) = "xorg", "pc104", "us,ru", ",winkeys", "grp:caps_toggle" $ gconftool-2 -R /desktop/gnome/peripherals/keyboard/kbd layouts = [] model = options = [grp grp:caps_toggle,eurosign eurosign:e] overrideSettings = true
Are there any news on this bug? Does Sergey Udaltsov read this, btw?
Yes I do read it. I am sorry this bug got lost. But I cannot really reproduce it. Which version of GNOME do you use? If 2.14 and earlier - do you have the latest version of libxklavier (2.x series < 2.90)? Would you be able to collect the stack trace?
I observe this on libxklavier 3.1 and gnome-control-center 2.16.2. Nothing seems to crash, so I even don't know what stack trace to collect.
Oops, sorry I did not notice there was no crash. Your gconf configuration looks really odd - no model, no layouts, just options. Did you use gnome-keyboard-properties to set the configuration? What is the model you see there? What are the layouts?
Well, I don't remember where I have read it, but I read that GNOME keyboard properties in GConf... Ah, I remember, I read it in the help strings to the corresponding GConf keys :) - so, GNOME keyboard properties just modify what was previously set via xorg.conf or other alike "system" methods. So, to me the configuration looks perfectly correct from this point. And the "real" xkb configuration is reflected in my XKB_RULES_NAMES. That is, two layouts (us and ru with winkeys) in a plain pc104 model.
I also have this problem everytime I log in and everytime I try to set the keyboard settings.
The output of the above commands on my system is: $ xprop -root | grep XKB _XKB_RULES_NAMES_BACKUP(STRING) = "xorg", "pc105", "gb", "", "" _XKB_RULES_NAMES(STRING) = "xorg", "pc105", "gb", "", "" $ gconftool-2 -R /desktop/gnome/peripherals/keyboard/kbd layouts = [] model = microsoftpro overrideSettings = true options = [] It might be worth noting that the keyboard properties dialog doesn't allow me to add any additional layouts. As far as I am aware, I have the correct xkb data files installed that should populate this list (xkb-data is installed on Debian testing).
Alexey, your configuration does not look correct to me. Because you have empty model/layouts and non-empty options. This looks like half-set configuration. Sure if g-s-d could not configure XKB - you're just left with your original XKB configuration (and it is what you see in _XKB_RULES_NAMES). Would you be able to kill g-s-d (you'll need to do it several times till it actually stops respawning), run it in console with envvar XKL_DEBUG=200 and see why it fails to initialize XKB? It could help if you attach the output to this bug (gzipped).
Thomas, your configuration also looks bad - there is a model, but no layouts... Could you please explicitly try choosing layouts in gnome-keyboard-properties - and see whether the problem is still there.
I only have one layout available (United Kingdom). Setting or un-setting this as default seems to have no effect on the output of the above commands.
Setting the layout to default should not matter. Could you please add/remove French layout and show me the result of same gconftool command?
As I mentioned, I only have one layout available to select in the list. There are no other layouts appearing for me.
Thomas, something is seriously broken in your environment. Could you please attach the screenshot of the dialog which pops up when you press "Add" button in the "Layouts" tab?
Created attachment 80939 [details] Screenshot of Keyboard Preferences showing no alternative layouts As you can see from the screenshot, the add layout button is disabled, which means I cannot add any additional layouts.
Thomas, I see now. This is really weird. What is your distribution? What kind of X server do you use (which verison)? Is XKB extension enabled? What kind of XKB configuration repository is installed - is it xkeyboard-config or xkbdata? What are the versions of libxklavier, gnome-control-center?
Debian 4 (testing) Xorg 7.1 libxklavier 3.0 control-center 2.17.5 I have the xkb-data package (version 0.9) installed. The xkbwatch program runs without a problem, so this should indicate the XKB extension is enabled.
Thomas, could you please attach your xorg.xml file (should be found in /usr/X11R6/lib/X11/xkb/rules or smth)? It seems the "Add" button is disabled because XKB configuration database is broken somehow Also, I'd strongly recommend switching to xkeyboard-config package (recommended by xorg BTW). Also, taking the latest libxklavier (3.1 or even better from CVS) would not hurt either - some minor XML problems were fixed. According to the code, the only reason to disable "Add" button is the situation when libxklavier could not initialize XKB backend (so it assumes the max number of layouts is 1, FWIW) - or assume that XKB does not support multiple layouts. Could you please run gnome-keyboard-properties from console, setting envvar XKL_DEBUG=150. Would you see at startup (in console) something like "Multiple layouts ARE supported" or "Multiple layouts ARE NOT supported"?
It seems the xkb-data package from debian provides xkeyboard-config. See http://packages.debian.org/testing/x11/xkb-data for more information. Here is the output from using XKL_DEBUG=150: [1169578934,150,xklavier.c:xkl_engine_constructor/] Trying all backends: [1169578934,150,xklavier.c:xkl_engine_constructor/] Trying XKB backend [1169578934,100,xklavier_config_xkb.c:xkl_xkb_multiple_layouts_supported/] !!! Checking multiple layouts support [1169578934,100,xklavier_config.c:xkl_engine_get_ruleset_name/] Rules set: [xorg] [1169578934,100,xklavier_config_xkb.c:xkl_xkb_multiple_layouts_supported/] !!! Multiple layouts ARE NOT supported [1169578934,150,xklavier.c:xkl_engine_constructor/] Actual backend: XKB [1169578934,150,xklavier_config_i18n.c:xkl_i18n_init/] Locale search order: [1169578934,150,xklavier_config_i18n.c:xkl_i18n_init/] 0: en_GB [1169578934,150,xklavier_config_i18n.c:xkl_i18n_init/] 1: en [1169578934,150,xklavier_config_i18n.c:xkl_i18n_init/] 2: [1169578934,100,xklavier_config.c:xkl_engine_get_ruleset_name/] Rules set: [xorg] [1169578934,100,xklavier_config.c:xkl_config_registry_load_from_file/] Loading XML registry from file /opt/gnome2/share/libxklavier/xfree86.xml [1169578934,150,gkbd-keyboard-config.c:gkbd_keyboard_config_copy_from_xkl_config/] Loaded Kbd model: [pc105] [1169578934,150,gkbd-keyboard-config.c:gkbd_keyboard_config_copy_from_xkl_config/] Loaded Kbd layout (with variant): [gb] [1169578934,150,gkbd-keyboard-config.c:gkbd_keyboard_config_load_params/] Loaded Kbd model: [microsoftpro]
I just noticed using strace that gnome-keyboard-properties is trying to open the rules files from an invalid location: $ strace gnome-keyboard-properties 2>&1|grep rules open("/X11/xkb/rules/xorg-en_GB.lst", O_RDONLY) = -1 ENOENT (No such file or directory) open("/X11/xkb/rules/xorg.lst", O_RDONLY) = -1 ENOENT (No such file or directory) stat64("/X11/xkb/rules/xorg.xml", 0xbff42410) = -1 ENOENT (No such file or directory)
Your libxklavier build is broken! It is built with invalid --with-xkb-base. Could you please rebuild it so that it would find xorg.lsg xorg.xml and stuff?
I configured libxklavier with only ./configure --prefix=/opt/gnome2 and the following message was given: ********************************************************** Libxklavier is configured with the following backends: XKB, libxkbfile is present default ruleset: base base: /X11/xkb xmodmap, default ruleset: base base: /usr/share/xmodmap ********************************************************** It seems that if --with-xkb-base is not provided, then it defaults to this invalid location (/X11/xkb).
It defaults to $x_libraries/X11/XKB (according to configure.in). $x_libraries is populated by AC_PATH_XTRA. It seems your autoconf is somewhat broken.
Alexey, what is your situation with regard to this bug?
FWIW, I have the same problem as Thomas (invalid XKB base). The problem here is not Thomas's version of autoconf but the use of x_includes/x_libraries in configure. X_PATH_XTRA *does not* set these variables if it can find X without having to change the default LIBS/CFLAGS variables, so it is perfectly possible to get x_includes="" and x_libraries="".
Created attachment 81823 [details] [review] fix default xkb base This patch fixes the issue I mentioned above. Now I get the Add button enabled. If I click it, however, gnome-keyboard-properties crashes...
OK, I will think of it. I am not excited about hardcoding the default value - but may it is the simplest solution in the circumstances..
Jens, would it be a bit trouble to fix X_PATH_EXTRA instead?
I wouldn't expact such a "fix" to be accepted upstream. The macro is actually doing the right thing, because it's supposed to add required compiler flags/libs for the build process. If none are required, why should it add some? There are a few other ways to make detection more dynamic in libxklavier, though: 1) use a list of known good xkb dirs in configure and probe them until you find one that exists; if you don't find one (and none is given with --with-xkb-base) just use the /usr/lib default 2) use a .pc file that includes a variable containing the xkb location in xkeyboard-config. Then you can use pkgconfig to read that variable in configure (only works with xkeyboard-config, of course; could be combined with 1))
Unfortunately I cannot use pkgconfig here - it would make people with non-xorg servers hate me. Anyway, now I check $x_libraries, and if it is empty - use /usr/lib. Is this of with you, Jens?
I still don't think it's a good idea, but if you really want to use x_libraries, just checking whether the variable is empty is not enough. It can be non-empty and still not give you a good path to work with, so you'd really have to check that the path you extract from the variable is non-empty (and ideally, whether it's valid and usable, but that's pretty difficult to do).
What could be non-empty value of x_libraries which would not be a good path? Could you please give me some example of such value (from real life, if possible)?
Perhaps we could move the configuration discussion to new bug against libxklavier? Sergey: Even after configuring libxklavier with -with-xkb-base=/usr/share/X11/xkb/, I still get the "Error activating XKB configuration" messages. I have checked I have the correct xkb data packages installed. Is there anything else I should check?
Unfortunately there is no libxklavier product in b.fd.o, so there is no place to move that discussion to;) What would be the result of strace gnome-keyboard-properties 2>&1|grep rules now?
$ strace gnome-keyboard-properties 2>&1|grep rules open("//usr/share/X11/xkb//rules/xorg-en_GB.lst", O_RDONLY) = -1 ENOENT (No such file or directory) open("//usr/share/X11/xkb//rules/xorg.lst", O_RDONLY) = 18 open("//usr/share/X11/xkb//rules/xorg-en_GB", O_RDONLY) = -1 ENOENT (No such file or directory) open("//usr/share/X11/xkb//rules/xorg", O_RDONLY) = 18
Seems to be ok. Could you please again run g-k-p in console with XKL_DEBUG=150 ?
(In reply to comment #33) > What could be non-empty value of x_libraries which would not be a good path? > Could you please give me some example of such value (from real life, if > possible)? After double-checking the code in autoconf you're probably right. I thought x_libraries was the same as XLIBS, but apparently that's not the case.
That "Error activating XKB configuration" screen started appearing to me after doing an "dpkg-reconfigure xserver-xorg". I introduced "es" as my variant layout and after restarting the Gnome came up with that error. Then I found out that some keys on my keyboard where disabled somehow. I solved the issue of the keys adding "setxkbmap es" in the Sessions Startup launch commands. But the error window was still appearing. This is the outputs i get: #xprop -root | grep XKB _XKB_RULES_NAMES_BACKUP(STRING) = "xorg", "pc105", "es", "es", "" _XKB_RULES_NAMES(STRING) = "xorg", "pc105", "es", "", "" #gconftool-2 -R /desktop/gnome/peripherals/keyboard/kbd layouts = [es,es es] model = options = [grp grp:alts_toggle] overrideSettings = true This is my xorg.conf: Section "InputDevice" Identifier "Generic Keyboard" Driver "kbd" Option "CoreKeyboard" Option "XkbRules" "xorg" Option "XkbModel" "pc105" Option "XkbLayout" "es" Option "XkbVariant" "es" EndSection Anyway, I found the solution to remove this error window from this thread: http://lists.freebsd.org/pipermail/freebsd-gnome/2005-December/013059.html If you need more feedback, let me know.
Your set of layouts in gconf seems strange. Could you please check it in gnome-keyboard-properties? What do you see there?
Before I fixed the error appearing screen at the start of gnome unsetting the "layouts" and "options" keys from gconf-editor::desktop::gnome::peripherals::keyboard::kbd Then u asked me to check the Layouts, and I tried to add a new keyboard layout, but any action I do using gnome-keyboard-properties opens that "Error activating XKB configuration." again. Actually when trying to adding another "Spain" keyboard layout, then suddenly appears 6 windows at the same time with that error message. And the program outputs this on the terminal: dpy: 0x8074c58 evt/error/major/minor: 111/174/1/0 Then when i check again : #gconftool-2 -R /desktop/gnome/peripherals/keyboard/kbd layouts = [es es,es] model = options = [grp grp:alts_toggle] overrideSettings = true The old values are set again, so I must remove them again to avoid that error message appear everytime I launch GNOME. By the way, when I unset that keys from the gconf-editor, it shows me 2 error windows for each unset, very weird. My Ubuntu Feisty was pretty new and I had never changed the layout before on this installation, and I as told you, probably that NEXT-NEXT-NEXT "dpkg-reconfigure xserver-xorg" that I did must have screw it up something deep.
Could you please provide screenshot of g-k-p with this configuration?
Created attachment 89385 [details] no problem configuration That is my configuration withouth problems, when I click on edit Layout then all the error messages appear and screw up my configuration.
I presume "Add layout", not Edit, yes? Which exactly layout do you choose then? Could you please provide another screenshot of the "Add layout" dialog with the selected layout (variant) you are going to add.
yeah, it's in Add layout. It doesn't matter which country layout I choose. When I click in OK, it adds it but showing lots of that "Error activating XKB configuration" messages at the same time, so I must close them one by one.
Ghm, I just checked - it works ok for me. Could you try setting your configuration using setxkbmap utility? Also, I actually asked what exactly was your second layout because the part 'es es' in your gconf looks very strange.
I made more tests... When it shows that message error, in the terminal appears: dpy: 0x8074c58 evt/error/major/minor: 111/174/1/0 Inside of Keyboard Preferences, Layouts: if I click in Reset To Defaults: it shows that error window and inserts an ES layout, but if I run this: gconftool-2 -R /desktop/gnome/peripherals/keyboard/kbd layouts = [] model = options = [] overrideSettings = true that's weird. Then from that, if I click in ADD LAYOUT and choose for example ANDORRA, then it will show the errors again and gconftool-2 -R /desktop/gnome/peripherals/keyboard/kbd layouts = [es es,ad] model = options = [grp grp:alts_toggle] overrideSettings = true So that's how the 'es es' appear.
I forgot to say that I found a way to fix it withouth using terminal. If I have layouts = [es es,ad] then from the Keyboard Preferences I can just delete the 'ES' layout, that way, it becomes like this: layouts = [ad] Then if I add an additional SPAIN layout, will become like this: layouts = [ad,es] Finally i just have to remove the ANDORRA layout and the conf will stay like this: layouts = [es] fixing the problem forever. NOTE: If I delete the ANDORRA layout when is 'layouts = [ad]' then it will go to the same problem than clicking the button RESET TO DEFAULTS.
Could you please show me grep Xkb /etc/X11/xorg.conf
grep Xkb /etc/X11/xorg.conf Option "XkbRules" "xorg" Option "XkbModel" "pc105" Option "XkbLayout" "es" Option "XkbVariant" "es" maybe that has been corrupted after I did that "sudo dpkg-reconfigure xserver-xorg" and I remember I wrote "es" as layout(that menu didn't have a list, so maybe writing "es" was a bad decision.
This is your problem. Please remove variant "es". There is no such thing as variant 'es' in layout 'es'.
Ok, thank you, now I know the problem was mine. Also I would like to criticize the "dpkg-reconfigure xserver-xorg" because doesn't help too much for non-experts users.
Well, the general rule of thumb is - do not mess with xorg.conf, just leave it alone unless you exactly know what you're doing;)
Ok, I waited for this bug to get closed just to tell that my case looks something different from the two already solved :) I'll attach my g-s-d output at XKL_DEBUG=200 shortly, and I have no idea why it didn't load my XkbModel "pc104" mentioned in xorg.conf, as well as XkbLayout "us,ru" with XkbVariant ",winkeys", respectively. I reproduce the output of gconftool here, to ease comparison: $ gconftool-2 -R /desktop/gnome/peripherals/keyboard/kbd layouts = [] model = options = [grp grp:caps_toggle] overrideSettings = false Re-setting the model, then adding the two layouts and removing old ones from gnome-keyboard-properties led to this situation, in the end: $ gconftool-2 -R /desktop/gnome/peripherals/keyboard/kbd layouts = [us,ru winkeys] model = pc104 options = [grp grp:caps_toggle] overrideSettings = false , although when I added US layout, it whined about inability to set XKB configuration.
Created attachment 89628 [details] The log of g-s-d starting and then setting the keyboard model explicitly
Alexey, could you please show me your xorg.conf | grep Xkb ?
Certainly. $ grep Xkb /etc/X11/xorg.conf Option "XkbModel" "pc104" Option "XkbVariant" ",winkeys" Option "XkbLayout" "us,ru" Option "XkbOptions" "grp:caps_toggle"