Bug 507034

Summary: satellite-sync inconsistency between exporter and importer: --no-rpms does not export short metadata but importer requires it for --no-rpms import
Product: Red Hat Satellite 5 Reporter: Issue Tracker <tao>
Component: Satellite SynchronizationAssignee: Pradeep Kilambi <pkilambi>
Status: CLOSED CURRENTRELEASE QA Contact: John Matthews <jmatthew>
Severity: medium Docs Contact:
Priority: medium    
Version: 520CC: cperry, jmatthew, shughes, tao, xdmoon
Target Milestone: ---   
Target Release: ---   
Hardware: All   
OS: Linux   
Whiteboard:
Fixed In Version: sat530 Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-09-10 20:38:06 UTC Type: ---
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: 456985    

Description Issue Tracker 2009-06-19 22:30:06 UTC
Escalated to Bugzilla from IssueTracker

Comment 17 Issue Tracker 2009-06-19 22:30:39 UTC
Event posted on 06-19-2009 06:18pm EDT by xdmoon

After applying patches for both bugs to a 5.2 satellite (below at bottom),
I noticed that the importer is looking for pkg short metadata, which is
not in the export.  Per discussion with prad, this is b/c the current
dependency of packages_short on rpms, and workaround is to export the
entire channel all data and import with --no-rpms.  This is a bug w/r/t
exporter/importer consistency.

Xixi

xixi prad: on a 5.2 satellite, after applying patches from both
https://bugzilla.redhat.com/show_bug.cgi?id=209352 and
https://bugzilla.redhat.com/show_bug.cgi?id=506347 i see it's still
trying to find the pkg short medatada when importing with just --no-rpms
prad xixi, it will because short packages is a dependency on rpms.. so
without rpms short will not exist
xixi prad: okay
prad xixi, thats the dependency hierarchy we define..
xixi prad: so what do you need to do to export and import a channel with
package metadata but just no rpm files
prad xixi, export the full dump and import with --no-rpms.. lemme check
the importer one sec..
xixi prad: k
prad xixi, yep that'll do it
xixi prad: does it seem like a bug though?
prad xixi, jus import the whole thing and ask em to run satsync --no-rpms
xixi prad: having to export the entire thing?
prad xixi, the fact that importer and exporter are not consistent for the
same flags is a bug to me 
xixi prad: yes
xixi prad: the inconsistent flags between exporter and importer

[root@dhcp242-153 IT304131]# diff -ru
/usr/share/rhn/satellite_tools/satsync.py.orig
/usr/share/rhn/satellite_tools/satsync.py
--- /usr/share/rhn/satellite_tools/satsync.py.orig      2008-08-25
06:14:04.000000000 -0400
+++ /usr/share/rhn/satellite_tools/satsync.py   2009-06-19
17:53:13.000000000 -0400
@@ -777,6 +777,9 @@
     def processShortPackages(self):
         log(1, ["", "Retrieving short package metadata (used for
indexing)"])

+        # We need to process what channels we import before importing
packages
+        self.process_channels()
+
         # Compute the unique packages and populate self._channel_packages
and
         # self._uq_channel_packages
         self._compute_unique_packages()
@@ -1011,6 +1014,10 @@

     def download_package_metadata(self):
         log(1, ["", "Downloading package metadata"])
+
+        # this sets the missing packages
+        self._diff_packages()
+
         # Get the missing but uncached packages
         missing_packages = self._missing_not_cached_packages()

@@ -2200,10 +2207,6 @@

     if actionDict['no-rpms']:
         actionDict['rpms'] = 0
-        actionDict['short'] = 0
-        actionDict['download-packages'] = 0
-        actionDict['packages'] = 0
-

     #if actionDict['no-srpms']:
     #    actionDict['srpms'] = 0


[root@dhcp242-153 IT304131]# satellite-sync -c rhel-x86_64-client-vt-5
--no-rpms --mount-point /root/IT304131/rhel-x86_64-client-vt-5
18:02:21 Red Hat Network Satellite - file-system synchronization
18:02:21    mp:  /root/IT304131/rhel-x86_64-client-vt-5
18:02:21    db:  rhnsat/<password>@rhnsat
18:02:21
18:02:21 Retrieving / parsing channel-families data
18:02:21 channel-families data complete
18:02:21
18:02:21 Retrieving / parsing arches data
18:02:21 arches data complete
18:02:21
18:02:21 Retrieving / parsing additional arches data
18:02:21 additional arches data complete
18:02:21
18:02:21 Retrieving / parsing channel data
18:02:21    p = previously imported/synced channel
18:02:21    . = channel not yet imported/synced
18:02:21    base-channels:
18:02:21
18:02:21 Channel data complete
18:02:21
18:02:21 Retrieving / parsing blacklists data
18:02:21 blacklists data complete
18:02:21
18:02:21 Retrieving / parsing product names data
/root/IT304131/rhel-x86_64-client-vt-5/product_names/product_names.xml
18:02:21
18:02:21 Retrieving short package metadata (used for indexing)
18:02:21
18:02:21 Retrieving / parsing channel data
18:02:21    p = previously imported/synced channel
18:02:21    . = channel not yet imported/synced
18:02:21    base-channels:
18:02:21
18:02:21 Channel data complete
18:02:21    Retrieving / parsing short package metadata:
rhel-x86_64-client-vt-5 (176)
/root/IT304131/rhel-x86_64-client-vt-5/packages_short/46/rhn-package-6046.xml
ERROR: The dump is missing package data, use --no-rpms to skip this step
or fix the content to include package data.

/usr/share/rhn/satellite_tools/satsync.py
...
    def _step_short(self):
        try:
            return self.syncer.processShortPackages()
        except xmlDiskSource.MissingXmlDiskSourceFileError, e:
            msg= "ERROR: The dump is missing package data, use --no-rpms
to skip this step or fix the content to include package data."
            log2disk(-1, msg)
            log2stderr(-1, msg, cleanYN=1)
            sys.exit(25)
...


This event sent from IssueTracker by xdmoon  [SEG - RHN]
 issue 304131

Comment 18 Xixi 2009-06-19 22:37:39 UTC
Prad already has patch which is -

diff --git a/backend/satellite_tools/disk_dumper/iss_actions.py b/backend/satell
index 2897ee3..6b5632a 100644
--- a/backend/satellite_tools/disk_dumper/iss_actions.py
+++ b/backend/satellite_tools/disk_dumper/iss_actions.py
 -23,7 +23,7 @@ class ActionDeps:
             'source-packages'           : [''],
             'errata'                    : [''],
             'kickstarts'                : [''],
-            'rpms'                      : ['short'],
+            'rpms'                      : [''],
 #            'srpms'                     : ['channels'],
             'channels'                  : ['channel-families'],
             'channel-families'          : ['blacklists'],

Comment 21 Shannon Hughes 2009-06-30 21:03:28 UTC
this looks good on latest qa iso, 6/25. imported proxy channel with the --no-rpms flag with no errors.

Comment 22 Shannon Hughes 2009-06-30 21:19:06 UTC
also tried the rhn-satellite-exporter -c redhat-rhn-proxy-5.2-server-i386-5 -d /tmp/foo2 --no-rpms

and this worked as well

Comment 26 Brandon Perkins 2009-09-10 20:38:06 UTC
An advisory has been issued which should help the problem
described in this bug report. This report is therefore being
closed with a resolution of ERRATA. For more information
on therefore solution and/or where to find the updated files,
please follow the link below. You may reopen this bug report
if the solution does not work for you.

http://rhn.redhat.com/errata/RHEA-2009-1434.html