Project

Profile

Help

Issue #2032

pulp sets reboot_suggested to True for all errata when syncing from published repo

Added by cduryee over 4 years ago. Updated over 1 year ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
High
Assignee:
Sprint/Milestone:
-
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Version:
Platform Release:
2.8.6
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Easy Fix, Pulp 2
Sprint:
Sprint 4
Quarter:

Description

If you have a Pulp server that syncs down a repo, then another Pulp server that syncs from the first Pulp, the second server will have "reboot_suggested = True" for all of its errata.

To repro:

  • sync RHEL 7
  • publish
  • on another pulp server server, sync RHEL 7 from the first Pulp's publish location

result: all errata on second server will have "reboot_suggested = True"

add'l info: It looks like not all errata (from non-Pulp sources) have "reboot_suggested" set, and it is only set at all if it's True. However, Pulp treats this as a boolean, so it becomes False upon the first sync/publish. The tricky part is that Pulp's importer then treats the existance of this flag as meaning True, even if it's false. The following snippet from the yum code illustrates:

            elif child.tag == 'reboot_suggested':
                self._md['reboot_suggested'] = True

Pulp follows this same convention, but it means if you sync/publish from one Pulp to another, everything ends up being marked as reboot suggested.


Related issues

Related to Packaging - Task #2083: Issues common to 2.9.1 and 2.8 streamCLOSED - NOTABUG

<a title="Actions" class="icon-only icon-actions js-contextmenu" href="#">Actions</a>

Associated revisions

Revision 07bb1c33 View on GitHub
Added by mhrivnak over 4 years ago

Fixes publish of Errata with reboot_suggested == False

Additionally, this enables sync to fix any values of reboot_suggested that are incorrect due to having previously sync'd from a pulp that had published with the previous behavior.

fixes #2032 https://pulp.plan.io/issues/2032

History

#1 Updated by amacdona@redhat.com over 4 years ago

  • Priority changed from Normal to High
  • Triaged changed from No to Yes
  • Tags Easy Fix added

#2 Updated by mhrivnak over 4 years ago

Apparently yum considers the presence of the "reboot_suggested" element to be an indication that the reboot is suggested, regardless of what text value it has. Here is the code (from yum 3.4.3, current "master" branch) that parses a package in a package list, with the relevant lines being right at the end:

    def _parse_package(self, elem):
        """
        Parse an individual package::

            <!ELEMENT package (filename, sum, reboot_suggested)>
                <!ATTLIST package name CDATA #REQUIRED>
                <!ATTLIST package version CDATA #REQUIRED>
                <!ATTLIST package release CDATA #REQUIRED>
                <!ATTLIST package arch CDATA #REQUIRED>
                <!ATTLIST package epoch CDATA #REQUIRED>
                <!ATTLIST package src CDATA #REQUIRED>
            <!ELEMENT reboot_suggested (#PCDATA)>
            <!ELEMENT filename (#PCDATA)>
            <!ELEMENT sum (#PCDATA)>
                <!ATTLIST sum type (md5|sha1) "sha1">
        """
        package = {}
        for pkgfield in ('arch', 'epoch', 'name', 'version', 'release', 'src'):
            package[pkgfield] = elem.attrib.get(pkgfield)

        #  Bad epoch and arch data is the most common (missed) screwups.
        # Deal with bad epoch data.
        if not package['epoch'] or package['epoch'][0] not in '0123456789':
            package['epoch'] = None

        for child in elem:
            if child.tag == 'filename':
                package['filename'] = child.text
            elif child.tag == 'sum':
                package['sum'] = (child.attrib.get('type'), child.text)
            elif child.tag == 'reboot_suggested':
                self._md['reboot_suggested'] = True
        return package

Thus, pulp's publish should omit the reboot_suggested element in the case where it is False.

#3 Updated by mhrivnak over 4 years ago

Fixing errata in pulp that incorrectly have the reboot_suggested value set to True may be tricky. We can't do a migration, because there's no way to know what the right value should be.

I think the only option is to check and fix the value during sync. There is already code on the Errata model for merging a freshly-downloaded errata record with a previously-retrieved one that's in the DB, for the purpose of merging package lists. That could also check the reboot_suggested values and adjust them accordingly.

#4 Updated by mhrivnak over 4 years ago

  • Sprint/Milestone set to 22

#6 Updated by mhrivnak over 4 years ago

  • Status changed from NEW to ASSIGNED
  • Assignee set to mhrivnak

#7 Updated by mhrivnak over 4 years ago

  • Status changed from ASSIGNED to POST

#8 Updated by mhrivnak over 4 years ago

  • Status changed from POST to MODIFIED
  • % Done changed from 0 to 100

#9 Updated by mhrivnak over 4 years ago

  • Platform Release set to 2.8.6

#11 Updated by Ichimonji10 over 4 years ago

  • Status changed from MODIFIED to ASSIGNED

I've provisioned a fresh pair of Pulp master (2.9) and 2.8.6 systems. Pulp master acts as expected. Pulp 2.8.6 still inserts a <reboot_suggested>False</reboot_suggested> element into updateinfo.xml.

#12 Updated by pthomas@redhat.com over 4 years ago

On the first server

[root@pulp-server1 ~]# pulp-admin rpm repo create --repo-id rhel7extra --feed http://cdn.rcm-internal.redhat.com/content/dist/rhel/rhui/server/7/7Server/x86_64/extras/os/
Successfully created repository [rhel7extra]

[root@pulp-server1 ~]# pulp-admin rpm repo update --repo-id rhel7extra --serve-http true
This command may be exited via ctrl+c without affecting the request.

[\]
Running...
Updating distributor: yum_distributor

Task Succeeded

[\]
Running...
Updating distributor: export_distributor

Task Succeeded

[root@pulp-server1 ~]# pulp-admin rpm repo sync run --repo-id  rhel7extra
+----------------------------------------------------------------------+
                 Synchronizing Repository [rhel7extra]
+----------------------------------------------------------------------+

This command may be exited via ctrl+c without affecting the request.

Downloading metadata...
[/]
... completed

Downloading repository content...
[-]
[==================================================] 100%
RPMs:       249/249 items
Delta RPMs: 0/0 items

... completed

Downloading distribution files...
[==================================================] 100%
Distributions: 0/0 items
... completed

Importing errata...
[|]
... completed

Importing package groups/categories...
[-]
... completed

Cleaning duplicate packages...
[\]
... completed

Task Succeeded

Initializing repo metadata
[-]
... completed

Publishing Distribution files
[-]
... completed

Publishing RPMs
[==================================================] 100%
249 of 249 items
... completed

Publishing Delta RPMs
... skipped

Publishing Errata
[==================================================] 100%
173 of 173 items
... completed

Publishing Comps file
[-]
... completed

Publishing Metadata.
[-]
... completed

Closing repo metadata
[-]
... completed

Generating sqlite files
... skipped

Publishing files to web
[-]
... completed

Writing Listings File
[-]
... completed

Writing Listings File
[-]
... completed

Task Succeeded

[root@pulp-server1 ~]# pulp-admin rpm repo content errata --repo-id rhel7extra  --erratum-id RHEA-2015:0617
+----------------------------------------------------------------------+
                        Erratum: RHEA-2015:0617
+----------------------------------------------------------------------+

Id:                RHEA-2015:0617
Title:             new package: flannel
Summary:           A new flannel package is now available for Red Hat Enterprise Linux 7 Extras.

Description:
  Flannel is an etcd-driven address management agent. It isused to manage the IP
  addresses of overlay networks between systemsrunning containers that need to
  communicate with one another.

  This enhancement update adds the flannel package to Red Hat Enterprise Linux
  7Extras. (BZ#1174665)

  All users who require flannel are advised to install this new package.

Severity:          
Type:              enhancement
Issued:            2015-03-05 00:00:00
Updated:           2015-03-05 00:00:00
Version:           1
Release:           
Status:            final
Reboot Suggested:  No

Updated Packages:
  flannel-0:0.2.0-6.el7.x86_64

References:
  ID:   None
  Type: self
  Link: https://rhn.redhat.com/errata/RHEA-2015-0617.html

On the 2nd server

[root@pulp-server2 ~]# pulp-admin rpm repo create --repo-id rhel7extra --feed http://pulp-server1]/pulp/repos/content/dist/rhel/rhui/server/7/7Server/x86_64/extras/os/
Successfully created repository [rhel7extra]


[root@pulp-server2~]# 
[root@pulp-server2 ~]# pulp-admin rpm repo sync run --repo-id rhel7extra 
+----------------------------------------------------------------------+
                 Synchronizing Repository [rhel7extra]
+----------------------------------------------------------------------+

This command may be exited via ctrl+c without affecting the request.

Downloading metadata...
[|]
... completed

Downloading repository content...
[-]
[==================================================] 100%
RPMs:       249/249 items
Delta RPMs: 0/0 items

... completed

Downloading distribution files...
[==================================================] 100%
Distributions: 0/0 items
... completed

Importing errata...
[\]
... completed

Importing package groups/categories...
[-]
... completed

Cleaning duplicate packages...
[-]
... completed

Task Succeeded

Initializing repo metadata
[-]
... completed

Publishing Distribution files
[-]
... completed

Publishing RPMs
[==================================================] 100%
249 of 249 items
... completed

Publishing Delta RPMs
... skipped

Publishing Errata
[==================================================] 100%
173 of 173 items
... completed

Publishing Comps file
[-]
... completed

Publishing Metadata.
[-]
... completed

Closing repo metadata
[-]
... completed

Generating sqlite files
... skipped

Publishing files to web
[-]
... completed

Writing Listings File
[-]
... completed

Task Succeeded

[root@pulp-server2 ~]# pulp-admin rpm repo content errata --repo-id rhel7extra  --erratum-id RHEA-2015:0617
+----------------------------------------------------------------------+
                        Erratum: RHEA-2015:0617
+----------------------------------------------------------------------+

Id:                RHEA-2015:0617
Title:             new package: flannel
Summary:           A new flannel package is now available for Red Hat Enterprise Linux 7 Extras.

Description:
  Flannel is an etcd-driven address management agent. It isused to manage the IP
  addresses of overlay networks between systemsrunning containers that need to
  communicate with one another.

  This enhancement update adds the flannel package to Red Hat Enterprise Linux
  7Extras. (BZ#1174665)

  All users who require flannel are advised to install this new package.

Severity:          
Type:              enhancement
Issued:            2015-03-05 00:00:00
Updated:           2015-03-05 00:00:00
Version:           1
Release:           
Status:            final
Reboot Suggested:  Yes

Updated Packages:
  flannel-0:0.2.0-6.el7.x86_64

References:
  ID:   
  Type: self
  Link: https://rhn.redhat.com/errata/RHEA-2015-0617.html

#13 Updated by mhrivnak over 4 years ago

  • Sprint/Milestone changed from 22 to 23

#14 Updated by mhrivnak over 4 years ago

Please include the specific build of 2.8.6 you used. I assume it's a nightly, since I don't think there have been any others. My first step in investigating will be to confirm whether the code change was present in the build that was tested.

#15 Updated by mhrivnak over 4 years ago

  • Status changed from ASSIGNED to MODIFIED
  • Sprint/Milestone changed from 23 to 22

Since there hasn't been a nightly build since before this fix was merged, I assume the build that was tested did not include the fix. I'm moving this back to MODIFIED. It will need to be re-tested once we get a new 2.8 nightly build. We'll try to get one built ASAP.

#16 Updated by pthomas@redhat.com over 4 years ago

  • Status changed from MODIFIED to 6

verified

# rpm -qa |grep pulp-server
pulp-server-2.8.6-0.1.alpha.git.20.9bf5a56.el7.noarch

[root@pulp-server2 ~]# pulp-admin rpm repo create --repo-id rhel7extra --feed http://pulp-serve1/pulp/repos/content/dist/rhel/rhui/server/7/7Server/x86_64/extras/os/
Successfully created repository [rhel7extra]

[root@pulp-server2 ~]# pulp-admin rpm repo sync run --repo-id rhel7extra
+----------------------------------------------------------------------+
                 Synchronizing Repository [rhel7extra]
+----------------------------------------------------------------------+

This command may be exited via ctrl+c without affecting the request.

Downloading metadata...
[-]
... completed

Downloading repository content...
[-]
[==================================================] 100%
RPMs:       249/249 items
Delta RPMs: 0/0 items

... completed

Downloading distribution files...
[==================================================] 100%
Distributions: 0/0 items
... completed

Importing errata...
[\]
... completed

Importing package groups/categories...
[-]
... completed

Cleaning duplicate packages...
[-]
... completed

Task Succeeded

Initializing repo metadata
[-]
... completed

Publishing Distribution files
[-]
... completed

Publishing RPMs
[==================================================] 100%
249 of 249 items
... completed

Publishing Delta RPMs
... skipped

Publishing Errata
[==================================================] 100%
173 of 173 items
... completed

Publishing Comps file
[-]
... completed

Publishing Metadata.
[-]
... completed

Closing repo metadata
[-]
... completed

Generating sqlite files
... skipped

Publishing files to web
[-]
... completed

Writing Listings File
[-]
... completed

Task Succeeded

[root@pulp-server2 ~]# pulp-admin rpm repo content errata --repo-id rhel7extra --erratum-id RHEA-2015:0617
+----------------------------------------------------------------------+
                        Erratum: RHEA-2015:0617
+----------------------------------------------------------------------+

Id:                RHEA-2015:0617
Title:             new package: flannel
Summary:           A new flannel package is now available for Red Hat Enterprise Linux 7 Extras.

Description:
  Flannel is an etcd-driven address management agent. It isused to manage the IP
  addresses of overlay networks between systemsrunning containers that need to
  communicate with one another.

  This enhancement update adds the flannel package to Red Hat Enterprise Linux
  7Extras. (BZ#1174665)

  All users who require flannel are advised to install this new package.

Severity:          
Type:              enhancement
Issued:            2015-03-05 00:00:00
Updated:           2015-03-05 00:00:00
Version:           1
Release:           
Status:            final
Reboot Suggested:  No

Updated Packages:
  flannel-0:0.2.0-6.el7.x86_64

References:
  ID:   
  Type: self
  Link: https://rhn.redhat.com/errata/RHEA-2015-0617.html

[root@pulp-server2 ~]# 

#17 Updated by semyers over 4 years ago

  • Status changed from 6 to 5

#18 Updated by semyers over 4 years ago

  • Status changed from 5 to 6

I accidentally moved this from VERIFIED back to ON_QA. Sorry for the ticket noise!

#19 Updated by semyers over 4 years ago

  • Status changed from 6 to CLOSED - CURRENTRELEASE

#20 Updated by semyers over 4 years ago

  • Related to Task #2083: Issues common to 2.9.1 and 2.8 stream added

#22 Updated by bmbouter over 2 years ago

  • Sprint set to Sprint 4

#23 Updated by bmbouter over 2 years ago

  • Sprint/Milestone deleted (22)

#24 Updated by bmbouter over 1 year ago

  • Tags Pulp 2 added

Please register to edit this issue

Also available in: Atom PDF