Bug 1222758

Summary: Yast2 sw_single out of memory error
Product: [openSUSE] openSUSE Distribution Reporter: Noel Carneiro <carneiro>
Component: YaST2Assignee: YaST Team <yast-internal>
Status: RESOLVED INVALID QA Contact: Jiri Srain <jsrain>
Severity: Normal    
Priority: P5 - None CC: carneiro, zypp-maintainers
Version: Leap 15.5   
Target Milestone: ---   
Hardware: x86-64   
OS: openSUSE Leap 15.5   
URL: https://trello.com/c/kBexnULH
Whiteboard:
Found By: --- Services Priority:
Business Priority: Blocker: ---
Marketing QA Status: --- IT Deployment: ---
Attachments: compressed /var/log/YaST2 folder
compressed file generated from save_y2logs

Description Noel Carneiro 2024-04-14 13:23:18 UTC
Created attachment 874270 [details]
compressed /var/log/YaST2 folder

Hi,

I'm using Leap 15.5 and I'm getting the following error message when trying to run Yast2 Software Management, either starting from Yast Control Center or from console.

I can run other Yast2 modules without any problem and even zypper (to install, search, uninstall, etc) without any problems.

I've attached a screenshots of the error message as well yast2_logs inside the compressed file.

Could you help me to solve this problem? Thanks very much in advance.
Comment 1 Stefan Hundhammer 2024-04-14 14:39:03 UTC
Does this happen every time you try to start it, or only every once in a while?

If it's always, please attach y2logs generated with the supplied 'save_y2logs' script.  See also

https://en.opensuse.org/openSUSE:Report_a_YaST_bug#I_attached_/var/log/YaST2/y2log_to_a_YaST2_bug,_and_still_I_am_asked_to_attach_y2logs._Why?
Comment 2 Noel Carneiro 2024-04-14 14:54:58 UTC
Created attachment 874271 [details]
compressed file generated from save_y2logs
Comment 3 Noel Carneiro 2024-04-14 14:57:41 UTC
Hi,

thanks for the promptly reply.

It always happens!

Attached is a newly generated file from save_y2logs.

Best regards,
Comment 4 Stefan Hundhammer 2024-04-14 16:46:09 UTC
>> 10:49:36 <1> [zypp] ZYppImpl.cc(ZYppImpl):124 libzypp: 17.31.15
>> 10:49:36 <1> [zypp] ZYppImpl.cc(ZYppImpl):124 libsolv: 0.7.28
>> 10:49:59 <1> [qt-ui]  YQPackageSelectorPluginStub.cc(YQPackageSelectorPluginStub):40 Loaded qt-pkg plugin successfully from /usr/lib64/yui/libyui-qt-pkg.so.16
>> 10:49:59 <1> [qt-pkg] YQPackageSelectorBase.cc(YQPackageSelectorBase):96 PackageSelectorBase init done
>> 10:49:59 <1> [qt-pkg] YQPackageSelector.cc(YQPackageSelector):156 This is libyui-qt-pkg 4.5.3
>> 10:49:59 <1> [qt-pkg] YQPackageSelectorBase.cc(~YQPackageSelectorBase):102 Destroying PackageSelector
>> 10:49:59 <3> [qt-pkg] YQPackageSelectorPluginImpl.cc(createPackageSelector):61 Caught std::exception: std::bad_alloc
>> 10:49:59 <3> [qt-pkg] YQPackageSelectorPluginImpl.cc(createPackageSelector):62 This is a libzypp problem. Do not file a bug against the UI!
>> ...
>> ...
>> 10:50:10 <3> [Ruby] yast/wfm.rb(handle_exception):271 Client /usr/share/YaST2/clients/sw_single.rb failed with 'Opening package selector failed.' (RuntimeError).
>> Backtrace:
>>
>> /usr/share/YaST2/modules/PackagesUI.rb:312:in `RunPackageSelector'
>> /usr/share/YaST2/clients/sw_single.rb:590:in `StartSWSingle'
>> /usr/share/YaST2/clients/sw_single.rb:81:in `main'
>> /usr/share/YaST2/clients/sw_single.rb:807:in `<top (required)>'
>> /usr/lib64/ruby/vendor_ruby/2.5.0/yast/wfm.rb:345:in `eval'
>> /usr/lib64/ruby/vendor_ruby/2.5.0/yast/wfm.rb:345:in `run_client'
>> /usr/lib64/ruby/vendor_ruby/2.5.0/yast/wfm.rb:206:in `call_builtin'
>> /usr/lib64/ruby/vendor_ruby/2.5.0/yast/wfm.rb:206:in `call_builtin_wrapper'
>> /usr/lib64/ruby/vendor_ruby/2.5.0/yast/wfm.rb:195:in `CallFunction'
>> /usr/lib/YaST2/bin/y2start:68:in `<main>'
>>
>> 10:50:10 <3> [Ruby] yast/wfm.rb(handle_exception):308 Internal error.
>>   Please report a bug report with logs.
>>   Run save_y2logs to get complete logs.
>>
>>  Caller:  /usr/share/YaST2/modules/PackagesUI.rb:312:in RunPackageSelector
>>  Details: Opening package selector failed.


from the 'rpm-qa' file:

> libsolv-tools-0.7.28-150400.3.16.2  (SUSE LLC <https://www.suse.com/>)  SUSE Linux Enterprise 15
> libzypp-17.31.31-150400.3.52.2      (SUSE LLC <https://www.suse.com/>)  SUSE Linux Enterprise 15
Comment 5 Stefan Hundhammer 2024-04-14 16:52:45 UTC
Please check if this works better with the NCurses UI (text mode):

  sudo yast sw_single

('yast2' gives you the Qt UI (graphical), 'yast' the NCurses UI)


Please also check if maybe you have a hanging zypp process left over:

  pstree | grep -i zypp

This result would mean you have a 'sudo yast sw_single' in some other terminal window:

     |     `-sudo---yast---Zypp-main---3*[{Zypp-main}]

This would be a running / hanging 'zypper' command started from somewhere:
  
     |     `-sudo---Zypp-main---{Zypp-main}
Comment 6 Noel Carneiro 2024-04-14 17:00:32 UTC
Hi, Stefan.

Using NCurses, I don't get any errors.

The output of "pstree | grep -i zypp" is
       |         |             |-konsole-+-su---tcsh---yast---Zypp-main---3*[{Zypp-main}]

Best regards,
Comment 7 Stefan Hundhammer 2024-04-14 17:25:23 UTC
Your 'pstree' output means that there is a 'yast ncurses' running. Is that the one that you just started? If not, please try to find that open KDE 'konsole' window and terminate that yast process and try again with 'yast2 sw_single' (Qt UI).

How much RAM does that machine have? Is it plausible that maybe it has a genuine out of memory error?

That information would be in the installation logs which are normally included in the y2logs tarball generated by 'save_y2logs', but that part was obviously cleared before calling the script.
Comment 8 Stefan Hundhammer 2024-04-14 17:31:24 UTC
I also see quite some active repos in the y2logs, and of course each of them adds to the memory requirements of the libzypp subsystem:

> 10:49:36 <1> [zypp] url : dir:/usr/local/src/rpm
> 10:49:36 <1> [zypp] url : http://download.opensuse.org/repositories/Education/15.5
> 10:49:36 <1> [zypp] url : http://download.opensuse.org/repositories/electronics/15.5
> 10:49:36 <1> [zypp] url : https://download.opensuse.org/repositories/Emulators/15.5
> 10:49:36 <1> [zypp] url : https://dl.google.com/linux/chrome/rpm/stable/x86_64
> 10:49:36 <1> [zypp] url : http://download.opensuse.org/repositories/home:/maxiotis/15.5
> 10:49:36 <1> [zypp] url : http://download.nvidia.com/opensuse/leap/15.5
> 10:49:36 <1> [zypp] url : http://ftp.gwdg.de/pub/linux/misc/packman/suse/openSUSE_Leap_15.5
> 10:49:36 <1> [zypp] url : http://ftp.gwdg.de/pub/linux/misc/packman/suse/openSUSE_Leap_15.5/Essentials
> 10:49:36 <1> [zypp] url : http://ftp.gwdg.de/pub/linux/misc/packman/suse/openSUSE_Leap_15.5/Extra
> 10:49:36 <1> [zypp] url : http://ftp.gwdg.de/pub/linux/misc/packman/suse/openSUSE_Leap_15.5/Multimedia
> 10:49:36 <1> [zypp] url : http://download.opensuse.org/repositories/security:/tls/openSUSE_Factory
> 10:49:36 <1> [zypp] url : http://download.opensuse.org/repositories/filesystems/15.5
> 10:49:36 <1> [zypp] url : http://download.opensuse.org/repositories/YaST:/Head/openSUSE_Factory
> 10:49:36 <1> [zypp] url : http://download.opensuse.org/update/leap/15.5/oss
> 10:49:36 <1> [zypp] url : http://download.opensuse.org/update/leap/15.5/non-oss
> 10:49:36 <1> [zypp] url : http://download.opensuse.org/repositories/science/15.5
> 10:49:36 <1> [zypp] url : http://download.opensuse.org/repositories/editors/15.5
> 10:49:36 <1> [zypp] url : http://download.opensuse.org/source/distribution/leap/15.5/repo/oss
> 10:49:36 <1> [zypp] url : http://download.opensuse.org/repositories/multimedia:/libs/15.5
> 10:49:36 <1> [zypp] url : http://download.opensuse.org/distribution/leap/15.5/repo/non-oss
> 10:49:36 <1> [zypp] url : http://download.opensuse.org/distribution/leap/15.5/repo/oss
> 10:49:36 <1> [zypp] url : http://download.opensuse.org/repositories/home:/XRevan86/openSUSE_Factory
> 10:49:36 <1> [zypp] url : http://download.opensuse.org/update/leap/15.5/backports
> 10:49:36 <1> [zypp] url : http://download.opensuse.org/repositories/LibreOffice:/7.5/openSUSE_Tumbleweed
> 10:49:36 <1> [zypp] url : http://download.opensuse.org/update/leap/15.5/sle
> 10:49:36 <1> [zypp] url : https://repo.nordvpn.com/yum/nordvpn/centos/x86_64
> 10:49:36 <1> [zypp] url : https://codecs.opensuse.org/openh264/openSUSE_Leap
> 10:49:36 <1> [zypp] url : https://download.opensuse.org/repositories/KDE:/Applications/KDE_Frameworks5_openSUSE_Leap_$releasever
> 10:49:36 <1> [zypp] url : https://download.opensuse.org/repositories/KDE:/Extra/KDE_Applications_openSUSE_Leap_$releasever
> 10:49:36 <1> [zypp] url : https://download.opensuse.org/repositories/KDE:/Frameworks/openSUSE_Leap_$releasever
> 10:49:36 <1> [zypp] url : https://download.opensuse.org/repositories/KDE:/Frameworks5/openSUSE_Leap_$releasever
> 10:49:36 <1> [zypp] url : https://download.opensuse.org/repositories/KDE:/Qt5/openSUSE_Leap_$releasever
> 10:49:36 <1> [zypp] url : https://download.opensuse.org/repositories/KDE:/Qt6/openSUSE_Leap_$releasever
Comment 9 Noel Carneiro 2024-04-14 17:36:38 UTC
yes, that's the one that I had just started.

I have 31.2 GiB of RAM, according to Info Center.

Regarding the repos, I've always had a lot of repositories listed (I've added 2 or 4 in the last weeks) but that has never been a problem. I once thought that could be a problem and deleted some of the repos but it didn“t help!

Best regards,
Comment 10 Stefan Hundhammer 2024-04-14 17:55:15 UTC
OK; 32 GiB should definitely be more than enough.

So it's time to move this to the libzypp experts.
Comment 11 Stefan Hundhammer 2024-04-14 17:56:29 UTC
Michael:

>> 10:49:59 <3> [qt-pkg] YQPackageSelectorPluginImpl.cc(createPackageSelector):61
>>   Caught std::exception: std::bad_alloc
Comment 12 Noel Carneiro 2024-04-14 18:21:16 UTC
thanks, Stefan.
Comment 13 Michael Andres 2024-04-15 12:16:47 UTC
(In reply to Stefan Hundhammer from comment #11)
> Michael:
> 
> >> 10:49:59 <3> [qt-pkg] YQPackageSelectorPluginImpl.cc(createPackageSelector):61
> >>   Caught std::exception: std::bad_alloc

Stefan, this is a bad_alloc in the YAST YQPackageSelectorPluginImpl, not necessarily in libzypp.

AFAICS repos are already refreshed and loaded. There are "just" 33 repos with 102519 packages. If I check this with zypper (full download, refresh and solving and even added soem DiscUsage computation to make sure those data rae sane as well). I get:
> hobbes:/tmp (0)# rm -r /tmp/XXX/var/cache/zypp/raw/
> hobbes:/tmp (0)# rm -r /tmp/XXX/var/cache/zypp/solv/
> hobbes:/tmp (0)# /usr/bin/time -v zypper --root /tmp/XXX/ up
> Building repository 'codecs.opensuse.org:openSUSE_Leap' cache ....................................................[done]
> Building repository 'dl.google.com:x86_64' cache .................................................................[done]
> Building repository 'download.nvidia.com:15.5' cache .............................................................[done]
> Building repository 'download.opensuse.org:15.5' cache ...........................................................[done]
> Building repository 'download.opensuse.org:KDE_Applications_openSUSE_Leap_15.5' cache ............................[done]
> Building repository 'download.opensuse.org:KDE_Frameworks5_openSUSE_Leap_15.5' cache .............................[done]
> Building repository 'download.opensuse.org:backports' cache ......................................................[done]
> Building repository 'download.opensuse.org:non-oss' cache ........................................................[done]
> Building repository 'download.opensuse.org:openSUSE_Factory' cache ...............................................[done]
> Building repository 'download.opensuse.org:openSUSE_Leap_15.5' cache .............................................[done]
> Building repository 'download.opensuse.org:openSUSE_Tumbleweed' cache ............................................[done]
> Building repository 'download.opensuse.org:oss' cache ............................................................[done]
> Building repository 'download.opensuse.org:sle' cache ............................................................[done]
> Building repository 'ftp.gwdg.de:Essentials' cache ...............................................................[done]
> Building repository 'ftp.gwdg.de:Extra' cache ....................................................................[done]
> Building repository 'ftp.gwdg.de:Multimedia' cache ...............................................................[done]
> Building repository 'ftp.gwdg.de:openSUSE_Leap_15.5' cache .......................................................[done]
> Building repository 'http-download.opensuse.org-0b47479a' cache ..................................................[done]
> Building repository 'http-download.opensuse.org-25fb364d' cache ..................................................[done]
> Building repository 'http-download.opensuse.org-2a78d094' cache ..................................................[done]
> Building repository 'http-download.opensuse.org-2caf4db1' cache ..................................................[done]
> Building repository 'http-download.opensuse.org-2fc9ffbe' cache ..................................................[done]
> Building repository 'http-download.opensuse.org-36f755ff' cache ..................................................[done]
> Building repository 'http-download.opensuse.org-7f43e0b4' cache ..................................................[done]
> Building repository 'http-download.opensuse.org-a31323c5' cache ..................................................[done]
> Building repository 'http-download.opensuse.org-b214da92' cache ..................................................[done]
> Building repository 'http-download.opensuse.org-efc9be45' cache ..................................................[done]
> Building repository 'http-download.opensuse.org-f0061f34' cache ..................................................[done]
> Building repository 'https-download.opensuse.org-629939f6' cache .................................................[done]
> Building repository 'https-download.opensuse.org-6423309c' cache .................................................[done]
> Building repository 'https-download.opensuse.org-ae1cb93b' cache .................................................[done]
> Building repository 'https-download.opensuse.org-cd1967c0' cache .................................................[done]
> Building repository 'repo.nordvpn.com:x86_64' cache ..............................................................[done]
> Loading repository data...
> Reading installed packages...
> ...
>         Command being timed: "zypper --root /tmp/XXX/ up"
>         User time (seconds): 33.53
>         System time (seconds): 2.62
>         Percent of CPU this job got: 66%
>         Elapsed (wall clock) time (h:mm:ss or m:ss): 0:54.65
>         Average shared text size (kbytes): 0
>         Average unshared data size (kbytes): 0
>         Average stack size (kbytes): 0
>         Average total size (kbytes): 0
>         Maximum resident set size (kbytes): 313528

Just 313M.
Comment 14 Michael Andres 2024-04-15 12:24:33 UTC
@YAST: In case of doubt please enhance the logging during your DU setup and computation. We don not know if the 'btrfs subvolume list' calls returned some strange data, although there is no indication to this in the log.
Comment 15 Stefan Hundhammer 2024-04-16 08:40:40 UTC
From the rpm-qa file of the attached y2logs tarball:

> libyui-ncurses-pkg16-4.5.3-150500.3.3.1  (SUSE LLC <https://www.suse.com/>)     SUSE Linux Enterprise 15
> libyui-ncurses16-4.5.3-150500.3.3.1      (SUSE LLC <https://www.suse.com/>)     SUSE Linux Enterprise 15
> libyui-qt-pkg16-4.5.3-150500.3.3.1       (SUSE LLC <https://www.suse.com/>)     SUSE Linux Enterprise 15
> libyui-qt-graph16-4.6.1-2.12             (obs://build.opensuse.org/YaST)        YaST:Head / openSUSE_Factory
> libyui-qt16-4.6.1-2.22                   (obs://build.opensuse.org/YaST)        YaST:Head / openSUSE_Factory


zypp/history (reformatted for readability):

> 2024-04-08 12:14:18  install  libyui16              4.5.2-150500.1.1    x86_64  openSUSE-Leap-15.5-1
> 2024-04-08 12:14:19  install  libyui-ncurses16      4.5.2-150500.1.1    x86_64  openSUSE-Leap-15.5-1
> 2024-04-08 12:17:11  install  libyui-qt16           4.5.2-150500.1.1    x86_64  openSUSE-Leap-15.5-1
> 2024-04-08 12:17:28  install  libyui-qt-graph16     4.5.2-150500.1.1    x86_64  openSUSE-Leap-15.5-1
> 2024-04-08 12:18:28  install  libyui-qt-pkg16       4.5.2-150500.1.1    x86_64  openSUSE-Leap-15.5-1
> 2024-04-08 12:18:29  install  libyui-ncurses-pkg16  4.5.2-150500.1.1    x86_64  openSUSE-Leap-15.5-1
> 2024-04-08 13:39:34  install  libyui16              4.5.3-150500.3.3.1  x86_64  SUSE_Linux_Enterprise_Leap_15.5
> 2024-04-08 13:39:34  install  libyui-ncurses16      4.5.3-150500.3.3.1  x86_64  SUSE_Linux_Enterprise_Leap_15.5
> 2024-04-08 13:39:49  install  libyui-qt16           4.5.3-150500.3.3.1  x86_64  SUSE_Linux_Enterprise_Leap_15.5
> 2024-04-08 13:39:53  install  libyui-qt-graph16     4.5.3-150500.3.3.1  x86_64  SUSE_Linux_Enterprise_Leap_15.5
> 2024-04-08 13:42:35  install  libyui-qt-pkg16       4.5.3-150500.3.3.1  x86_64  SUSE_Linux_Enterprise_Leap_15.5
> 2024-04-08 13:42:35  install  libyui-ncurses-pkg16  4.5.3-150500.3.3.1  x86_64  SUSE_Linux_Enterprise_Leap_15.5
> 2024-04-12 14:15:24  install  libyui-qt16           4.6.1-2.22          x86_64  YaST_Packages_Leap_15.5
> 2024-04-12 14:15:27  install  libyui-qt-graph16     4.6.1-2.12          x86_64  YaST_Packages_Leap_15.5



So you installed different versions of libyui packages, some from the original Leap 15.5 and some from YaST:Head. If you do that, anything can happen.

There is a reason why we keep all libyui packages together in the same repo, and we bump the versions in parallel.
Comment 16 Michael Andres 2024-04-16 10:30:38 UTC
@Noel It is in general a bad idea to mix packages from TW/Factory and Leap/SLE - not just for YAST. The different distros may use different compiler versions and setups and there may also be also differences in filesystem layout and service handling.
Comment 17 Noel Carneiro 2024-04-16 14:06:17 UTC
Oh, OK. Thanks Fabian/Michael.

I believe I had added the YaST:Head repo a couple of years ago to solve a problem with Yast (I think was in Leap 15.2/3 - don't really remember - and never removed it after).

So, should I just remove the Yast:Head repository? How could I keep just one of the versions of the packages?
Comment 18 Noel Carneiro 2024-04-16 14:07:02 UTC
Sorry, Stefan/Michael (not Fabian!)
Comment 19 Michael Andres 2024-04-16 16:48:12 UTC
If you are running a Leap_15.5 you should be very careful with repositories containing factory and TW builds.

> url : http://download.opensuse.org/repositories/security:/tls/openSUSE_Factory
> url : http://download.opensuse.org/repositories/YaST:/Head/openSUSE_Factory
> url : http://download.opensuse.org/repositories/home:/XRevan86/openSUSE_Factory
> url : http://download.opensuse.org/repositories/LibreOffice:/7.5/openSUSE_Tumbleweed

If you check e.G. the project page for YaST:Head
> https://build.opensuse.org/project/show/YaST:Head
You will see that they also provide builds for 
> openSUSE_Leap_15.5
which are published in 
> https://download.opensuse.org/repositories/YaST:/Head/openSUSE_Leap_15.5/

If you think you need the repos, try to switch to a build for your distro. Otherwise just remove the repo.

This however does not change the packages installed on your disk. For the libyui16 packages Stefan mentioned I'd try:
> zypper se -si libyui
If the packages all use the same version, as Stefan explained, try to figure out the wrong ones and re-install them from the. Based on what Stefan posted in c#15 it could be something like
> zypper install --oldpackage libyui-qt16-4.5.3-150500.3.3.1 libyui-qt-graph16-4.5.3-150500.3.3.1
Comment 20 Michael Andres 2024-04-16 16:49:58 UTC
(..in the correct version)
Comment 21 Noel Carneiro 2024-04-16 17:50:53 UTC
OK. I'll try that.