Project

Profile

Help

Issue #2032

closed

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

Added by cduryee almost 8 years ago. Updated almost 5 years 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 - NOTABUGsemyers

Actions
Actions #1

Updated by amacdona@redhat.com almost 8 years ago

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

Updated by mhrivnak almost 8 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.

Actions #3

Updated by mhrivnak almost 8 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.

Actions #4

Updated by mhrivnak almost 8 years ago

  • Sprint/Milestone set to 22
Actions #6

Updated by mhrivnak almost 8 years ago

  • Status changed from NEW to ASSIGNED
  • Assignee set to mhrivnak
Actions #7

Updated by mhrivnak over 7 years ago

  • Status changed from ASSIGNED to POST

Added by mhrivnak over 7 years ago

Revision 07bb1c33 | View on GitHub

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

Actions #8

Updated by mhrivnak over 7 years ago

  • Status changed from POST to MODIFIED
  • % Done changed from 0 to 100
Actions #9

Updated by mhrivnak over 7 years ago

  • Platform Release set to 2.8.6
Actions #11

Updated by Ichimonji10 over 7 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.

Actions #12

Updated by pthomas@redhat.com over 7 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
Actions #13

Updated by mhrivnak over 7 years ago

  • Sprint/Milestone changed from 22 to 23
Actions #14

Updated by mhrivnak over 7 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.

Actions #15

Updated by mhrivnak over 7 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.

Actions #16

Updated by pthomas@redhat.com over 7 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 ~]# 
Actions #17

Updated by semyers over 7 years ago

  • Status changed from 6 to 5
Actions #18

Updated by semyers over 7 years ago

  • Status changed from 5 to 6

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

Actions #19

Updated by semyers over 7 years ago

  • Status changed from 6 to CLOSED - CURRENTRELEASE
Actions #20

Updated by semyers over 7 years ago

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

Updated by bmbouter about 6 years ago

  • Sprint set to Sprint 4
Actions #23

Updated by bmbouter about 6 years ago

  • Sprint/Milestone deleted (22)
Actions #24

Updated by bmbouter almost 5 years ago

  • Tags Pulp 2 added

Also available in: Atom PDF