YaSt2 Software Management internal error ReadRepositories undefined method `uniq!'

When starting Software Management on an up-to-date LEAP 15.1 x86_64 system, I get this error popup dialog:

Internal error. Please report a bug report with logs.
Run save_y2logs to get complete logs.

Caller: /usr/share/YaST2/lib/y2packager/known_repositories.rb:75:in `read_repositories’

Details: undefined method `uniq!’ for false:FalseClass

I tried to report this at Bugzilla but the link https://bugzilla.opensuse.org/post_bug.cgi is down for me.

I am not allowed to post attachments to this forum post, so I cannot attach the YsST logs.

Regards,
Ed

Please provide the output from:

zypper lr -d

Use CODE tags for the output. You can generate CODE tags by clicking the “#” icon in the edit box.

And you can post very long texts and images on https://susepaste.org/

Yast problems are often due to mixed repos. Show zypper lr - d

 
z2:~ # zypper lr -d
# | Alias                | Name                       | Enabled | GPG Check | Refresh | Priority | Type   | URI                                                                     | Service
--+----------------------+----------------------------+---------+-----------+---------+----------+--------+-------------------------------------------------------------------------+--------
1 | non-oss              | Update Non-OSS             | Yes     | (r ) Yes  | Yes     |   99     | rpm-md | http://download.opensuse.org/update/leap/15.1/non-oss/                  |        
2 | non-oss-addon_15.1-0 | Non-OSS                    | Yes     | (r ) Yes  | Yes     |   99     | rpm-md | http://download.opensuse.org/distribution/leap/15.1/repo/non-oss/       |        
3 | openSUSE-Leap_15.1-1 | OSS                        | Yes     | (r ) Yes  | Yes     |   99     | rpm-md | http://download.opensuse.org/distribution/leap/15.1/repo/oss/           |        
4 | oss                  | Update                     | Yes     | (r ) Yes  | Yes     |   99     | rpm-md | http://download.opensuse.org/update/leap/15.1/oss/                      |        
5 | repo-debug           | Debug Repository           | No      | ----      | ----    |   99     | rpm-md | http://download.opensuse.org/debug/distribution/leap/15.1/repo/oss/     |        
6 | repo-debug-non-oss   | Debug Repository (Non-OSS) | No      | ----      | ----    |   99     | rpm-md | http://download.opensuse.org/debug/distribution/leap/15.1/repo/non-oss/ |        
7 | repo-debug-update    | Update Repository (Debug)  | No      | ----      | ----    |   99     | rpm-md | http://download.opensuse.org/debug/update/leap/15.1/oss/ 

Your repos look okay.

It is unusual to have Yast internal errors. Bad repos are often the cause when it does happen.

You can try updating your system in a root terminal (command line) session with

zypper up

After updating, see if you still have Yast problems.

The “uniq” command is part of the “coreutils” package. You could make sure that ithas not been accidently deleted

>  sudo  zypper install --force  coreutils 

If you suspect that anything else is amiss with your instaalation, you could try a distribution upgrade. This cures all manner of ills.

>  sudo  zypper dup  

I do not think the word “uniq!” here has anything to do with the tool uniq. It is something inside the Ruby coding of YaST.

Do you work with Ruby gems? They are a kind of versioned library packages for the programming language Ruby. YaST has been rewritten in Ruby a few years ago.
The other day I tried a

sudo gem update --explain

… which was supposed to merely list any available new versions of installed Ruby gems. Insted of listing, the »gem« command actually updated the gems — among them a few on which YaST happens to depend: mysql3, fast_gettext etc.
After my blunder YaST kept aborting with above »Internal Error«. Later I could make YaST run again by manually removing the unvoluntary up-to-date rubygems and installing the original gems that came with YaST:

gem uninstall fast_gettext --version 2.0.1
gem uninstall sqlite3 --version 1.4.1
zypper in -force ruby2.5-rubygem-fast_gettext-1.6.0-lp150.1.4.x86_64
zypper in -force ruby2.5-rubygem-sqlite3-1.3.13-lp150.1.7.x86_64

I’m of the opinion that any gems YaST depends on ought to be handled specially, maybe incorporated into the YaST2 source base. That way, Ruby devs like myself could install/update/hack/remove our Ruby gems to our hearts’ content without interfering with the integrity of system tools like YaST, »zypper lifecycle« and so on.

At the least YaST should have better version checking of its gems and/or improve its error reporting in this case. I tried to point out this problem on Bugzilla but was rebuked.

I went looking at the YaST Ruby code that error’d and saw that it was checking for the file /var/lib/YaST2/system_packages_repos.yaml . On my system the file existed but it was empty. I deleted the file and now Software Management starts properly.

My system files may have been in an improper state because during the update from 15.0 to 15.1 the update process hung when installing the boot loader - this is on a newer HP Z2 system which “features” the HP Secure Boot. I was able make the system operational by booting with the help of installation media and having YaST re-install the boot loader. I also found later that the usual repositories were not added - I added them later using YaST.

Thank you all for the helpful advice.

Regards,
Ed

And thank you for reporting back. Might be useful for others.

Thanks a lot. This problem is bugging me for months now and your solution solved it for me as well. I expected it to be related to mixed versions of Ruby and tried many things. Deleting the file was enough :slight_smile: