Bug 1259837

Summary: Yum will fail once a empty line is encountered in /var/lib/yum/groups/* files
Product: Red Hat Enterprise Linux 7 Reporter: Roy Williams <fang64>
Component: yumAssignee: Valentina Mukhamedzhanova <vmukhame>
Status: CLOSED ERRATA QA Contact: Eva Mrakova <emrakova>
Severity: medium Docs Contact:
Priority: unspecified    
Version: 7.1CC: aaron, emrakova, james.antill, ksrot, lmiksik, ovasik, pgervase, snagar, valentin.bajrami, vmukhame
Target Milestone: rc   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: yum-3.4.3-132.el7 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2015-11-19 12:39:00 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:
Attachments:
Description Flags
patch none

Description Roy Williams 2015-09-03 15:19:31 UTC
Description of problem:
Yum will fail to update or do anything once it encounters an empty line in /var/lib/yum/groups/* files.

Version-Release number of selected component (if applicable):
RHEL 7.2
yum-3.4.3-125.el7.noarch

How reproducible:
Easily

Steps to Reproduce:
1. Modify /var/lib/yum/groups/installed or /var/lib/yum/groups/environment to include a empty line.
2. Run yum groups list

Actual results:
[root@lws11 ~]# yum groups list --debuglevel 10 --verbose
Loading "aliases" plugin
Loading "changelog" plugin
Loading "kabi" plugin
Loading "langpacks" plugin
Loading "nvidia" plugin
Loading "package_upload" plugin
Loading "product-id" plugin
Loading "subscription-manager" plugin
Loading "verify" plugin
Adding en_US.UTF-8 to language list
Updating Subscription Management repositories.
Config time: 0.716
Loading support for Red Hat kernel ABI
[nvidia]: device found: pci:v000010DEd000011B6sv0000103Csd00001022bc03sc00i00
Yum version: 3.4.3
Traceback (most recent call last):
  File "/bin/yum", line 29, in <module>
    yummain.user_main(sys.argv[1:], exit_code=True)
  File "/usr/share/yum-cli/yummain.py", line 367, in user_main
    errcode = main(args)
  File "/usr/share/yum-cli/yummain.py", line 160, in main
    base.getOptionsConfig(args)
  File "/usr/share/yum-cli/cli.py", line 352, in getOptionsConfig
    self.parseCommands() # before we return check over the base command + args
  File "/usr/share/yum-cli/cli.py", line 396, in parseCommands
    self.yum_cli_commands[self.basecmd].doCheck(self, self.basecmd, self.extcmds)
  File "/usr/share/yum-cli/yumcommands.py", line 1011, in doCheck
    elif not os.path.exists(os.path.dirname(base.igroups.filename)):
  File "/usr/lib/python2.7/site-packages/yum/__init__.py", line 1111, in <lambda>
    igroups = property(fget=lambda self: self._getIGroups(),
  File "/usr/lib/python2.7/site-packages/yum/__init__.py", line 1071, in _getIGroups
    self._igroups = yum.igroups.InstalledGroups(db_path=pdb_path)
  File "/usr/lib/python2.7/site-packages/yum/igroups.py", line 102, in __init__
    self._read_pkg_grps(db_path)
  File "/usr/lib/python2.7/site-packages/yum/igroups.py", line 114, in _read_pkg_grps
    ver = int(_read_str(fo))
ValueError: invalid literal for int() with base 10: ''


Expected results:
[root@lws11 groups]# yum groups list --debuglevel 10 --verbose
Loading "langpacks" plugin
Loading "package_upload" plugin
Loading "product-id" plugin
Loading "subscription-manager" plugin
Adding en_US.UTF-8 to language list
Updating Subscription Management repositories.
Config time: 0.723
Yum version: 3.4.3
Setting up Package Sacks
pkgsack time: 0.022
group time: 0.119
Available environment groups:
   MATE Desktop (mate-desktop-environment)
   GNOME Desktop (gnome-desktop-environment)
   KDE Plasma Workspaces (kde-desktop-environment)
Installed groups:
   Base (base)
   Compatibility libraries (compat-libraries)
   Debugging Tools (debugging)
   Desktop Debugging and Performance Tools (desktop-debugging)
   Directory Client (directory-client)
   Emacs (emacs)
   Fonts (fonts)
   Input Methods (input-methods)
   Internet Applications (internet-applications)
   Internet Browser (internet-browser)
   Java Platform (java-platform)
   KDE Desktop (kde-desktop)
   Legacy X Window System compatibility (legacy-x)
   Network file system client (network-file-system-client)
   Office Suite and Productivity (office-suite)
   Printing client (print-client)
   Remote Desktop Clients (remote-desktop-clients)
   Scientific support (scientific)
   Security Tools (security-tools)
   X Window System (x11)
Available Groups:
   Additional Development (additional-devel)
   Afrikaans Support (afrikaans-support)
   Albanian Support (albanian-support)
   Amazigh Support (amazigh-support)
   Arabic Support (arabic-support)
   Armenian Support (armenian-support)
   Assamese Support (assamese-support)
   Azerbaijani Support (azerbaijani-support)
   Backup Client (backup-client)
   Backup Server (backup-server)
   Basque Support (basque-support)
   Belarusian Support (belarusian-support)
   Bengali Support (bengali-support)
   Bhutanese Support (bhutanese-support)
   Brazilian Portuguese Support (brazilian-support)
   Breton Support (breton-support)
   Bulgarian Support (bulgarian-support)
   CIFS file server (cifs-file-server)
   Catalan Support (catalan-support)
   Chhattisgarhi Support (chhattisgarhi-support)
   Chichewa Support (chichewa-support)
   Chinese Support (chinese-support)
   Console internet tools (console-internet)
   Coptic Support (coptic-support)
   Croatian Support (croatian-support)
   Czech Support (czech-support)
   Danish Support (danish-support)
   Desktop (basic-desktop)
   Desktop Platform (desktop-platform)
   Desktop Platform Development (desktop-platform-devel)
   Development tools (development)
   Dial-up Networking Support (dial-up)
   Directory Server (directory-server)
   Dutch Support (dutch-support)
   E-mail server (mail-server)
   Eclipse (eclipse)
   Educational Software (education)
   Electronic Lab (electronic-lab)
   English (UK) Support (british-support)
   Esperanto Support (esperanto-support)
   Estonian Support (estonian-support)
   Ethiopic Support (ethiopic-support)
   FCoE Storage Client (storage-client-fcoe)
   FTP server (ftp-server)
   Faroese Support (faroese-support)
   Fedora Packager (fedora-packager)
   Fijian Support (fijian-support)
   Filipino Support (filipino-support)
   Finnish Support (finnish-support)
   French Support (french-support)
   Frisian Support (frisian-support)
   Friulian Support (friulian-support)
   Gaelic Support (gaelic-support)
   Galician Support (galician-support)
   General Purpose Desktop (general-desktop)
   Georgian Support (georgian-support)
   German Support (german-support)
   Graphical Administration Tools (graphical-admin-tools)
   Graphics Creation Tools (graphics)
   Greek Support (greek-support)
   Gujarati Support (gujarati-support)
   Hardware monitoring utilities (hardware-monitoring)
   Haskell (haskell)
   Hebrew Support (hebrew-support)
   Hiligaynon Support (hiligaynon-support)
   Hindi Support (hindi-support)
   Hungarian Support (hungarian-support)
   Icelandic Support (icelandic-support)
   Indonesian Support (indonesian-support)
   Infiniband Support (infiniband)
   Interlingua Support (interlingua-support)
   Inuktitut Support (inuktitut-support)
   Irish Support (irish-support)
   Italian Support (italian-support)
   Japanese Support (japanese-support)
   Java Base (java-base)
   Java Browser (java-browser)
   Java Database (java-database)
   Kannada Support (kannada-support)
   Kashmiri Support (kashmiri-support)
   Kashubian Support (kashubian-support)
   Kazakh Support (kazakh-support)
   Khmer Support (khmer-support)
   Kinyarwanda Support (kinyarwanda-support)
   Konkani Support (konkani-support)
   Korean Support (korean-support)
   Kurdish Support (kurdish-support)
   Lao Support (lao-support)
   Large Systems Performance (large-systems)
   Latin Support (latin-support)
   Latvian Support (latvian-support)
   Legacy UNIX compatibility (legacy-unix)
   Lithuanian Support (lithuanian-support)
   Low Saxon Support (low-saxon-support)
   Luxembourgish Support (luxembourgish-support)
   Macedonian Support (macedonian-support)
   Mainframe Access (mainframe-access)
   Maithili Support (maithili-support)
   Malagasy Support (malagasy-support)
   Malay Support (malay-support)
   Malayalam Support (malayalam-support)
   Maltese Support (maltese-support)
   Manx Support (manx-support)
   Maori Support (maori-support)
   Marathi Support (marathi-support)
   Messaging Client Support (system-management-messaging-client)
   Messaging Server Support (system-management-messaging-server)
   Milkymist (milkymist)
   Misc (misc)
   Mongolian Support (mongolian-support)
   MySQL Database client (mysql-client)
   MySQL Database server (mysql)
   Myanmar (Burmese) Support (burmese-support)
   NFS file server (nfs-file-server)
   Nepali Support (nepali-support)
   Network Infrastructure Server (network-server)
   Network Storage Server (storage-server)
   Networking Tools (network-tools)
   Northern Sotho Support (northern-sotho-support)
   Norwegian Support (norwegian-support)
   Occitan Support (occitan-support)
   Oriya Support (oriya-support)
   PHP Support (php)
   Performance Tools (performance)
   Perl Support (perl-runtime)
   Persian Support (persian-support)
   Polish Support (polish-support)
   Portuguese Support (portuguese-support)
   PostgreSQL Database client (postgresql-client)
   PostgreSQL Database server (postgresql)
   Print Server (print-server)
   Punjabi Support (punjabi-support)
   Romanian Support (romanian-support)
   Russian Support (russian-support)
   SNMP Support (system-management-snmp)
   Sanskrit Support (sanskrit-support)
   Sardinian Support (sardinian-support)
   Serbian Support (serbian-support)
   Server Platform (server-platform)
   Server Platform Development (server-platform-devel)
   Sindhi Support (sindhi-support)
   Sinhala Support (sinhala-support)
   Slovak Support (slovak-support)
   Slovenian Support (slovenian-support)
   Smart card support (smart-card)
   Southern Ndebele Support (southern-ndebele-support)
   Southern Sotho Support (southern-sotho-support)
   Spanish Support (spanish-support)
   Storage Availability Tools (storage-client-multipath)
   Swahili Support (swahili-support)
   Swati Support (swati-support)
   Swedish Support (swedish-support)
   System Management (system-management)
   System administration tools (system-admin-tools)
   Tagalog Support (tagalog-support)
   Tajik Support (tajik-support)
   Tamil Support (tamil-support)
   TeX support (tex)
   Technical Writing (technical-writing)
   Telugu Support (telugu-support)
   Tetum Support (tetum-support)
   Thai Support (thai-support)
   Tibetan Support (tibetan-support)
   Tsonga Support (tsonga-support)
   Tswana Support (tswana-support)
   TurboGears application framework (turbogears)
   Turkish Support (turkish-support)
   Turkmen Support (turkmen-support)
   Ukrainian Support (ukrainian-support)
   Upper Sorbian Support (upper-sorbian-support)
   Urdu Support (urdu-support)
   Uzbek Support (uzbek-support)
   Venda Support (venda-support)
   Vietnamese Support (vietnamese-support)
   Virtualization (virtualization)
   Virtualization Client (virtualization-client)
   Virtualization Platform (virtualization-platform)
   Virtualization Tools (virtualization-tools)
   Walloon Support (walloon-support)
   Web Server (web-server)
   Web Servlet Engine (web-servlet)
   Web-Based Enterprise Management (system-management-wbem)
   Welsh Support (welsh-support)
   Xfce (xfce-desktop)
   Xhosa Support (xhosa-support)
   Zhong Yi Song Fonts (zhongyi-song-fonts)
   Zulu Support (zulu-support)
   iSCSI Storage Client (storage-client-iscsi)
Done
[root@lws11 groups]# 

Additional info:
This seems to happen with puppet runs running yum groupinstall <some group> but it can be caused directly by simply running a bunch of groupinstall commands back to back.

Comment 4 Valentina Mukhamedzhanova 2015-09-09 17:07:38 UTC
Created attachment 1071856 [details]
patch

Comment 6 Roy Williams 2015-09-09 20:13:35 UTC
Valentina, 

This seems to fix the issue, can this be patched in EL7.0/EL7.1? Or will this require waiting on 7.2?

Roy

Comment 8 Karel Srot 2015-09-10 05:54:21 UTC
Hello Roy,
we may not be able to get the fix in 7.2 as it is quite late already. However, it might be helpful if you escalate this issue officially through a Global support services.

Comment 9 Roy Williams 2015-09-10 15:47:45 UTC
Karel,

Thanks I will do that I'll reference this BZ

Roy

Comment 10 Roy Williams 2015-09-10 15:59:35 UTC
Karel,

As a follow up, CASE # is 01506368, I've created a RHGS case at Red Hat.

Roy

Comment 14 Aaron Luchko 2015-11-02 18:43:03 UTC
Is there a workaround for when this has occurred? 

I've hit the bug shortly after starting from a minimal install and trying a group install, as such my groups directory only contained two files, installed and environment, both empty. So I just removed the 

rm -rf /var/lib/yum/groups

After this I can still install gnome-desktop-environment but trying to install or remove base doesn't do anything (the suggested command "yum groups mark install base" doesn't change anything either).

[root@localhost ~]# yum groups install base  
Loaded plugins: fastestmirror, langpacks
There is no installed groups file.
Maybe run: yum groups mark convert (see man yum)
base    | 3.6 kB  00:00:00     
extras  | 3.4 kB  00:00:00     
updates | 3.4 kB  00:00:00     
Loading mirror speeds from cached hostfile
 * base: www.muug.mb.ca
 * extras: www.muug.mb.ca
 * updates: mirror.its.sfu.ca
Warning: Group base does not have any packages to install.
Group base does have 1 conditional packages, which may get installed.
Maybe run: yum groups mark install (see man yum)
No packages in any requested group available to install or update

Comment 15 Roy Williams 2015-11-02 19:07:58 UTC
Aaron,

I don't believe this is a problem. You should be able to run yum update after a group is selected and it will install the packages in the groups that are marked for installation. This command behaves more like "yum groups mark install base" occasionally if there are some weird group associations it breaks horribly. I've only seen that problem with EPEL a few times and other third party repositories.

Roy

(In reply to Aaron Luchko from comment #14)
> Is there a workaround for when this has occurred? 
> 
> I've hit the bug shortly after starting from a minimal install and trying a
> group install, as such my groups directory only contained two files,
> installed and environment, both empty. So I just removed the 
> 
> rm -rf /var/lib/yum/groups
> 
> After this I can still install gnome-desktop-environment but trying to
> install or remove base doesn't do anything (the suggested command "yum
> groups mark install base" doesn't change anything either).
> 
> [root@localhost ~]# yum groups install base  
> Loaded plugins: fastestmirror, langpacks
> There is no installed groups file.
> Maybe run: yum groups mark convert (see man yum)
> base    | 3.6 kB  00:00:00     
> extras  | 3.4 kB  00:00:00     
> updates | 3.4 kB  00:00:00     
> Loading mirror speeds from cached hostfile
>  * base: www.muug.mb.ca
>  * extras: www.muug.mb.ca
>  * updates: mirror.its.sfu.ca
> Warning: Group base does not have any packages to install.
> Group base does have 1 conditional packages, which may get installed.
> Maybe run: yum groups mark install (see man yum)
> No packages in any requested group available to install or update

Comment 16 errata-xmlrpc 2015-11-19 12:39:00 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://rhn.redhat.com/errata/RHBA-2015-2095.html

Comment 17 Valentina Mukhamedzhanova 2015-12-16 12:46:03 UTC
*** Bug 1291939 has been marked as a duplicate of this bug. ***