Bug 1159286 - YaST2: Keyboard.rb:306:in `current_kbd': undefined method `empty?' for nil:NilClass
Summary: YaST2: Keyboard.rb:306:in `current_kbd': undefined method `empty?' for nil:Ni...
Status: RESOLVED FIXED
: 1161111 (view as bug list)
Alias: None
Product: openSUSE Distribution
Classification: openSUSE
Component: YaST2 (show other bugs)
Version: Leap 15.2
Hardware: Other Other
: P5 - None : Normal (vote)
Target Milestone: ---
Assignee: Josef Reidinger
QA Contact: Jiri Srain
URL: https://trello.com/c/31O3Djrl
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2019-12-16 13:17 UTC by Mindaugas Baranauskas
Modified: 2020-01-16 21:16 UTC (History)
4 users (show)

See Also:
Found By: ---
Services Priority:
Business Priority:
Blocker: ---
Marketing QA Status: ---
IT Deployment: ---


Attachments
Screenshoot (572.80 KB, image/png)
2019-12-16 13:17 UTC, Mindaugas Baranauskas
Details
y2log (498.59 KB, application/x-xz)
2019-12-16 13:21 UTC, Mindaugas Baranauskas
Details
LANG=fr_FR yast2 language - screenshot (289.98 KB, image/png)
2019-12-16 15:17 UTC, Mindaugas Baranauskas
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Mindaugas Baranauskas 2019-12-16 13:17:30 UTC
Created attachment 826199 [details]
Screenshoot

I am testing appliance based on openSUSE Leap 15.2 development version 
(latest build as of today). 

I entered into YaST Language module and received error:

Internal error. Please report a bug report with logs.
Run save_y2logs to get complete logs.
Caller: /usr/share/YaST2/modules/Keyboard.rb:306:in `current_kbd'
Details: undefined method `empty?' for nil:NilClass


Appliance URL:
https://build.opensuse.org/package/show/home:embar-:Lietukas/Lietukas_15.2_mini
You can download ISO image for playing in virtual machine or using as LiveDVD/USB:
https://download.opensuse.org/repositories/home:/embar-:/Lietukas/images/iso/?P=*15.2*
Comment 1 Mindaugas Baranauskas 2019-12-16 13:21:46 UTC
Created attachment 826200 [details]
y2log
Comment 2 Stefan Hundhammer 2019-12-16 15:02:45 UTC
Does this work with Tumbleweed or Leap 15.1?
I guess you tried Lithuanian there before, right?
Does it also crash for other languages, or only for Lithuanian?
Comment 3 Mindaugas Baranauskas 2019-12-16 15:06:26 UTC
This is openSUSE Leap 15.2.

This bug happens at opening of dialog. If I close error dialog, whole YaST module closes. Thus I have no opportunity to switch language via YaST.

I encourage you to try ISO image in virtual machine to reproduce bug.
Comment 4 Stefan Hundhammer 2019-12-16 15:11:12 UTC
Sorry, but I really can't download various applicance ISOs and experiment with them. We already have a lot of different products to maintain.

Please try to start this from a terminal window like in that other bug last week: Set the LANG and/or LC_MESSAGES environment variables and start that module.

  LANG=fr_FR yast2 language
Comment 5 Mindaugas Baranauskas 2019-12-16 15:17:44 UTC
Created attachment 826211 [details]
LANG=fr_FR yast2 language - screenshot

GUI remains in Lithuanian. Same bug.
Comment 6 Mindaugas Baranauskas 2019-12-16 15:35:37 UTC
I also tested openSUSE TW - here I can not reproduce.
Comment 7 Stefan Hundhammer 2019-12-17 10:58:09 UTC
OK, thanks for testing this again.

Something must be different on your appliance ISO. It might be a missing file that this YaST module attempts to read, or a missing configuration setting in a config file.

But independent of that, yast2-country should not crash with such a nil:NilClass exception. If anything is missing, it should properly report it to the user and then maybe terminate itself.
Comment 8 Manu Maier 2019-12-30 13:51:07 UTC
Should be fixed with version 4.2.11
https://build.opensuse.org/request/show/758604
Comment 9 Josef Reidinger 2020-01-02 14:55:15 UTC
Sadly not fixed. it failing when reading values

2019-12-16 15:13:44 <1> localhost.localdomain(7541) [Ruby] modules/Keyboard.rb:103 keyboard_on_entry: 

https://github.com/yast/yast-country/blob/master/keyboard/src/modules/Keyboard.rb#L99

but @curr_kbd should not be nil. So we need to sanitize it in reading.

But why read failed?

localectl has its value 2019-12-16 15:13:44 <1> localhost.localdomain(7541) [Ruby] lib/cheetah.rb:208 Standard output:        VC Keymap: lt

so it see lt. but in data we have only lt.baltic.

https://github.com/yast/yast-country/blob/master/keyboard/src/data/keyboards.rb#L180

So what is problem?
We do not know all variants of given language and we set lt.baltic, but there are more variants. E.g. localectl knows this keymaps for lt:

lt
lt-ibm
lt-lekp
lt-lekpa
lt-std
lt-us
lt.baltic
lt.l4
lt.std

I am not sure how to handle it. Probably we need to fallback somehow? at least we should not crash if given keymap missing in our map.
Comment 10 Josef Reidinger 2020-01-02 15:14:27 UTC
fix is in review https://github.com/yast/yast-country/pull/238
Comment 11 Josef Reidinger 2020-01-02 15:22:23 UTC
fix merged
Comment 12 Mindaugas Baranauskas 2020-01-09 20:56:02 UTC
Today I tested openSUSE Leap 15.2 based appliance with yast2-country 4.2.14 and 
I confirm that this is bug is fixed in with that version.
Thanks!
Comment 13 Ancor Gonzalez Sosa 2020-01-16 21:16:53 UTC
*** Bug 1161111 has been marked as a duplicate of this bug. ***