Bug 1403898

Summary: spacewalk-repo-sync should log explicit error when missing RPM encountered during a sync
Product: [Community] Spacewalk Reporter: Gennadii Altukhov <galtukho>
Component: ServerAssignee: Gennadii Altukhov <galtukho>
Status: CLOSED CURRENTRELEASE QA Contact: Red Hat Satellite QA List <satqe-list>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 2.6CC: eherget, galtukho, rdrazny, satqe-list, tlestach
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 1397427 Environment:
Last Closed: 2017-09-27 19:30: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:
Bug Depends On: 1397427    
Bug Blocks: 1484117    

Description Gennadii Altukhov 2016-12-12 15:22:27 UTC
+++ This bug was initially created as a clone of Bug #1397427 +++

Description of problem:
When syncing channel from CDN using the cdn-sync command, there is possibility of missing RPM in the CDN. Cdn-sync should log explicit error in its log in such occasion, and exit with non-zero exit code. Currently it doesn't report any specific error in the log, and exits with 0 (success) exit code.

Version-Release number of selected component (if applicable):
spacewalk-backend-cdn-2.5.3-32

How reproducible:
Issue is present only when there is missing RPM file in the CDN (happens sometimes on the code-stage). As of today, there is missing libkadm5-1.14.1-26.el7-0.i686 in the rhel-x86_64-server-7 channel in the code-stage.

Steps to Reproduce:
1. cdn-sync -c rhel-x86_64-server-7

Actual results:

# cdn-sync -c rhel-x86_64-server-7
08:14:13 ======================================
08:14:13 | Channel: rhel-x86_64-server-7
08:14:13 ======================================
08:14:13 Sync of channel started.
08:14:13 Repo URL: https://cdn.stage.redhat.com/content/dist/rhel/server/7/7Server/x86_64/os
<...>
08:33:20 6307/13875 : libkadm5-1.14.1-26.el7-0.i686
08:33:21 failure: Packages/libkadm5-1.14.1-26.el7.i686.rpm from content_dist_rhel_server_7_7Server_x86_64_os: [Errno 256] No more mirrors to try.
08:33:21 ERROR: failure: Packages/libkadm5-1.14.1-26.el7.i686.rpm from content_dist_rhel_server_7_7Server_x86_64_os: [Errno 256] No more mirrors to try.
08:33:21 Repo URL: https://cdn.stage.redhat.com/content/dist/rhel/server/7/7.1/x86_64/kickstart
08:33:34 Packages in repo:              4371
<...>
08:35:59 Linking packages to channel.
08:36:23 ERROR: Could not find object [<spacewalk.server.importlib.importLib.IncompletePackage instance; attributes={'package_size': None, 'package_arch_id': 104, 'name': 'libkadm5', 'checksum_list': None, 'md5sum': None, 'org_id': None, 'epoch': '0', 'checksums': {'sha1': '553b168dc506d33f684f3a0c36f6054a3fa253b9'}, 'channels': {101: 'rhel-x86_64-server-7'}, 'nevra_id': 8689, 'package_id': None, 'last_modified': None, 'name_id': 3597, 'version': '1.14.1', 'checksum': '553b168dc506d33f684f3a0c36f6054a3fa253b9', 'release': '26.el7', 'checksum_type': 'sha1', 'arch': 'i686', 'evr_id': 5310, 'checksum_id': 773956}] in table rhnPackage
08:36:23 Sync of channel completed in 0:09:53.
08:36:23 Total time: 0:09:53

[root@hp-dl360g6-01 ~]# echo $?
0

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


We have the same bug for spacewalk-repo-sync. It should return non-zero code if some problems occurred during syncing rpm-packages.

Comment 1 Gennadii Altukhov 2016-12-13 09:17:08 UTC
spacewalk.git:
35748ebb07c6263443958710adb59f5948c0e5bb

Comment 2 Eric Herget 2017-09-27 19:30:31 UTC
Spacewalk 2.7 has been released.

https://github.com/spacewalkproject/spacewalk/wiki/ReleaseNotes27