Bug 1043231 - yum does not succeed in marking package groups installed with an environment group
Summary: yum does not succeed in marking package groups installed with an environment ...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: yum
Version: 20
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Packaging Maintenance Team
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard: https://fedoraproject.org/wiki/Common...
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2013-12-15 08:18 UTC by Adam Williamson
Modified: 2014-01-01 03:31 UTC (History)
12 users (show)

Fixed In Version: yum-3.4.3-128.fc19
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2013-12-25 02:37:56 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1043207 0 unspecified CLOSED _at_groupinstall check for 'non-existent' package groups, added by upstream commit ff5416b1532fe43c68bf51ae30751504885a5... 2021-02-22 00:41:40 UTC
Red Hat Bugzilla 1043221 0 unspecified CLOSED Non-existent group warnings from _at_groupinstall should not be printed when called via yum update 2021-02-22 00:41:40 UTC

Internal Links: 1043207 1043221

Description Adam Williamson 2013-12-15 08:18:37 UTC
This bug is to split out the issue I've been tracing down in https://bugzilla.redhat.com/show_bug.cgi?id=1014202 comments #21 and onwards.

The clean example of the problem that I'm using is this:

1. Do a clean minimal install of Fedora 19 or 20
2. Verify that there are no files in /var/lib/yum/groups , and 'yum group list hidden' does not list any package or environment groups as being installed
3. Run 'yum group install web-server-environment'
4. Inspect /var/lib/yum/groups/environment . Note that all the package groups in the 'web-server-environment' environment group have 'false' after them.
5. If you like, run 'yum group install web-server-environment' again, and note that it claims the group does not exist: this is #1014202 .
6. Try 'yum remove web-server-environment': it returns 'No group named web-server-environment exists', then 'No packages to remove from groups'

We hit #1014202 here because of the chain explained in https://bugzilla.redhat.com/show_bug.cgi?id=1014202#c22 . _groupInstalledEnvData considers all the package groups associated with the environment group to be "blacklisted-installed", and that eventually winds up causing the inaccurate warning.

This underlying problem seems like the most serious one, though. That bug is just an inaccurate message; the underlying bug is a practical one, because I think yum just never actually manages to track that any package group is installed due to any environment group.

I believe /var/lib/yum/groups/environment is meant to list all environment groups, and under each environment group, list the package groups inside it, and if that package group was installed as a part of the environment group, the word "true"; if it wasn't, the word "false". But the test above indicates pretty clearly that this isn't happening.

The actual code here, which I've been staring at for the last four hours, is the function _write_grp_grps(self) in igroups.py:

-----------------

    def _write_grp_grps(self):
        fo = _open_no_umask(self.grp_filename + '.tmp', 'w')

        fo.write("1\n") # version
        fo.write("%u\n" % len(self.environments))
        for evgrp in sorted(self.environments.values()):
            fo.write("%s\n" % evgrp.evgid)
            fo.write("%u\n" % len(evgrp.grp_names))
            for grpname in sorted(evgrp.grp_names):
                fo.write("%s\n" % grpname)
                if (grpname in self.groups and
                    self.groups[grpname].environment == evgrp.evgid):
                    fo.write("%s\n" % "true")
                else:
                    fo.write("%s\n" % "false")

        fo.close()
        os.rename(self.grp_filename + '.tmp', self.grp_filename)

----------------

I think I know what's wrong in this. I hacked some incredibly ugly QA-monkey debug output into it:

----------------

                if grpname in self.groups:
                    fo.write("# group in self.groups\n")
                    fo.write("# sgge: %s\n" % self.groups[grpname].environment)
                    fo.write("# ee: %s\n" % evgrp.egid)
                    if self.groups[grpname].environment == evgrp.evgid:
                        fo.write("%s\n" % "true")
                    else:
                        fo.write("%s\n" % "false")
                else:
                    fo.write("%s\n" % "false")

------------------

yeah, okay, I don't know a way to write the debug output anywhere else except into the file. Please don't laugh at me.

When I do this, then do 'yum remove httpd', 'rm -f /var/lib/yum/groups/*', 'yum group install web-server-environment' (a little hack I figured out to avoid having to blow the machine away and start over every time), here's the file that gets written:

--------------------

1
1
web-server-environment
15
core
# group in self.groups
# sgge: None
# ee: web-server-environment
false
guest-agents
false
haproxy
false
hardware-support
# group in self.groups
# sgge: None
# ee: web-server-environment
false
jbossas
false
mongodb
false
mysql
false
perl-web
false
php
false
python-web
false
rubyonrails
false
sql-server
false
standard
# group in self.groups
# sgge: None
# ee: web-server-environment
false
tomcat
false
web-server
# group in self.groups
# sgge: None
# ee: web-server-environment
false

------------------------

If you follow what I was doing, it's showing that every time that check is run, self.groups[grpname].environment evaluates to None. So the comparison always fails, and it never writes "true".

If I didn't balls up anywhere, it means that somehow, "self.groups[grpname].environment" is not actually giving us the environment group associated with the package group "grpname" (which I think is what it's trying to do). I don't know why not.

Comment 1 Fedora Update System 2013-12-19 05:21:49 UTC
yum-3.4.3-127.fc20 has been submitted as an update for Fedora 20.
https://admin.fedoraproject.org/updates/yum-3.4.3-127.fc20

Comment 2 Fedora Update System 2013-12-19 18:41:54 UTC
yum-3.4.3-127.fc19 has been submitted as an update for Fedora 19.
https://admin.fedoraproject.org/updates/yum-3.4.3-127.fc19

Comment 3 Fedora Update System 2013-12-20 01:50:44 UTC
Package yum-3.4.3-127.fc20:
* should fix your issue,
* was pushed to the Fedora 20 testing repository,
* should be available at your local mirror within two days.
Update it with:
# su -c 'yum update --enablerepo=updates-testing yum-3.4.3-127.fc20'
as soon as you are able to.
Please go to the following url:
https://admin.fedoraproject.org/updates/FEDORA-2013-23627/yum-3.4.3-127.fc20
then log in and leave karma (feedback).

Comment 4 Fedora Update System 2013-12-25 02:37:56 UTC
yum-3.4.3-128.fc20 has been pushed to the Fedora 20 stable repository.  If problems still persist, please make note of it in this bug report.

Comment 5 Fedora Update System 2014-01-01 03:31:51 UTC
yum-3.4.3-128.fc19 has been pushed to the Fedora 19 stable repository.  If problems still persist, please make note of it in this bug report.


Note You need to log in before you can comment on or make changes to this bug.