Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.
Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.

Bug 1418747

Summary: Repo isn't auto publishing after syncing
Product: Red Hat Satellite Reporter: Sachin Ghai <sghai>
Component: UpgradesAssignee: Justin Sherrill <jsherril>
Status: CLOSED ERRATA QA Contact: Sachin Ghai <sghai>
Severity: high Docs Contact:
Priority: unspecified    
Version: 6.2.7CC: bbuckingham, ehelms, inecas, jentrena, jsherril, ktordeur, mbacovsk, pmoravec
Target Milestone: UnspecifiedKeywords: Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: katello-installer-base-3.0.0.76-1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1419069 (view as bug list) Environment:
Last Closed: 2017-03-06 08:37:31 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:
Bug Depends On:    
Bug Blocks: 1410795, 1419069    

Description Sachin Ghai 2017-02-02 16:02:07 UTC
Description of problem:

I re-sync the satellite capsule repo and sync was completed successfully w/ a few new packages. Later when I publish the associated CV and promoted it. However when I ran yum repolist on registered capsule , it was still showing the old packages.

Looks like new rpms were not correctly published:

On Satellite filesystem I see the updated packages under "/var/lib/pulp/content/units/rpm/" as below:

-bash-4.2# find / -name satellite-capsule-6.2.7*
/var/lib/pulp/content/units/rpm/0f/3bd1531109d30323715d950d98e4b7c55fc33b6de4db40e176b75c2bc7bdc9/satellite-capsule-6.2.7-1.0.el7sat.noarch.rpm

But I don't see this in published CV 'rhel7_capsule_cv' under 'Library':

-bash-4.2# cd /var/lib/pulp/published/yum/https/repos/Default_Organization/Library/rhel7_capsule_cv/content/dist/rhel/server/7/7Server/x86_64/sat-capsule/6.2/os/
-bash-4.2# ll | grep satellite-capsule-6.2.7

CV publish/promote was successful and we can see package count updated on UI. But actually no new package published/promoted to selected env. 


Version-Release number of selected component (if applicable):
upgrade sat6.1.11 -> 6.2.z

How reproducible:


Steps to Reproduce:
1.
2.
3.

Actual results:

Expected results:
newly synced packages should be published/promoted to next env

Additional info:

Comment 1 Sachin Ghai 2017-02-02 16:05:28 UTC
As per dev investigation, issue seems to be related to repo publishing. the repo isn't auto publishing after syncing.

just for reference, pasting the irc chat here: thank you Justin.

<jsherrill> sghai: no not CV publishing, repo publshing,  in pulp when you sync a repo its set to auto publish the yum metadata.  in 6.1 we triggered it manaully so this auto publish was turned off, in 6.2 we turned it back on
<jsherrill> and that turning back on isn't working correctly.

Comment 3 Justin Sherrill 2017-02-02 19:17:42 UTC
Opened PRs:

https://gitlab.sat.lab.tlv.redhat.com/satellite6/katello-installer/merge_requests/84
https://gitlab.sat.lab.tlv.redhat.com/satellite6/katello/merge_requests/279

however i still need to chat with Chris about this issue

Comment 4 Sachin Ghai 2017-02-14 13:32:16 UTC
Verified this issue with sat6.2.8 snap2

Now I can successfully publish/promote the newly synced packages and packages are available under selected CV through filesystem:

-bash-4.2# cd /var/lib/pulp/published/yum/https/repos/Default_Organization/Library/rhel7_capsule_cv/content/dist/rhel/server/7/7Server/x86_64/sat-capsule/6.2/os/
-bash-4.2#  ll | grep satellite-capsule-6.2.7
lrwxrwxrwx. 1 apache apache  143 Feb 14 07:59 satellite-capsule-6.2.7-1.0.el7sat.noarch.rpm -> /var/lib/pulp/content/units/rpm/0f/3bd1531109d30323715d950d98e4b7c55fc33b6de4db40e176b75c2bc7bdc9/satellite-capsule-6.2.7-1.0.el7sat.noarch.rpm


Also, similar packages I can fetch on registered capsule.

Before:
=========
repo id                                                             repo name                                                                   status
!rhel-7-server-rpms/x86_64                                          Red Hat Enterprise Linux 7 Server (RPMs)                                    13,578
!rhel-7-server-satellite-capsule-6.2-rpms/x86_64                    Red Hat Satellite Capsule 6.2 (for RHEL 7 Server) (RPMs)                       300


after:
======
repo id                                                             repo name                                                                   status
!rhel-7-server-rpms/x86_64                                          Red Hat Enterprise Linux 7 Server (RPMs)                                    13,578
!rhel-7-server-satellite-capsule-6.2-rpms/x86_64                    Red Hat Satellite Capsule 6.2 (for RHEL 7 Server) (RPMs)                       332


see the difference in capsule packages, before fix, count was 300 and after fix count is 332.

Comment 7 Justin Sherrill 2017-02-28 18:35:29 UTC
Workaround:

On both the Satellite and the capsule, run:

#this sets auto_publish to true
mongo pulp_database --eval 'db.repo_distributors.update({"distributor_type_id": "yum_distributor"}, {"$set": {"auto_publish": true}}, {"multi": true});'

#this causes pulp to actually sync the repository, forcing a publish
mongo pulp_database --eval 'db.repo_importers.update({"scratchpad": {$ne: null}}, {$set: {"scratchpad.repomd_revision": null}}, {"multi":true})'


And then re-sync the repositories on your Satellite, followed by a full capsule sync (if the problem is on the capusle as well)

Comment 9 errata-xmlrpc 2017-03-06 08:37:31 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://access.redhat.com/errata/RHBA-2017:0447