Bug 840490

Summary: Exception from 'link_errata_rpm_units': KeyError: 'sum'
Product: [Retired] Pulp Reporter: Preethi Thomas <pthomas>
Component: user-experienceAssignee: John Matthews <jmatthew>
Status: CLOSED CURRENTRELEASE QA Contact: Preethi Thomas <pthomas>
Severity: unspecified Docs Contact:
Priority: unspecified    
Version: 2.0.6CC: jason.dobies, jmatthew, pkilambi
Target Milestone: ---   
Target Release: Sprint 38   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2013-01-07 14:09:42 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:
Attachments:
Description Flags
pulp log when the sync fails
none
A second error on repo sync none

Description Preethi Thomas 2012-07-16 13:41:20 UTC
Created attachment 598451 [details]
pulp log when the sync fails

Description of problem:

Looks like repo sync fails the first time you sync a large repo. Also running a resync on the repo fails as well the first time.
Version-Release number of selected component (if applicable):
[root@preethi-el6-pulp ~]# rpm -qa pulp-rpm-server
pulp-rpm-server-0.0.313-1.el6.noarch
[root@preethi-el6-pulp ~]# 


How reproducible:


Steps to Reproduce:
1. create a repo with the feed  Feed: http://www.gtlib.gatech.edu/pub/fedora-epel/6/x86_64/
2.Run sync on the repo
3.Once it fails run sync again
4. Also wait a day and run repo sync on the above repo
  
Actual results:
root@preethi-el6-pulp ~]# pulp-admin repo sync run --repo epel-6-x86_64
+----------------------------------------------------------------------+
                Synchronizing Repository [epel-6-x86_64]
+----------------------------------------------------------------------+

This command may be exited by pressing ctrl+c without affecting the actual
operation on the server.

Downloading metadata...
[-]
... failed

Error during repository synchronization

[u'PulpExecutionException: Importer indicated a failed response\n']

[root@preethi-el6-pulp ~]# pulp-admin repo sync run --repo epel-6-x86_64
+----------------------------------------------------------------------+
                Synchronizing Repository [epel-6-x86_64]
+----------------------------------------------------------------------+

This command may be exited by pressing ctrl+c without affecting the actual
operation on the server.

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

Downloading repository content...
[==================================================] 100%
RPMs:       77/77 items
Delta RPMs: 0/0 items
Tree Files: 0/0 items
Files:      0/0 items
... completed

Importing errata...
[-]
Error during repository synchronization

[u'PulpExecutionException: Importer indicated a failed response\n']



Expected results:


Additional info:

Comment 1 Preethi Thomas 2012-07-16 13:42:37 UTC
Created attachment 598453 [details]
A second error on repo sync

Comment 2 John Matthews 2012-07-16 14:21:00 UTC
 I think the second attachment shows the error we should focus on:

  File "/usr/lib/pulp/plugins/importers/yum_importer/errata.py", line 180, in link_errata_rpm_units
    pinfo['checksumtype'], pinfo['checksum'] = pinfo['sum']
KeyError: 'sum'

Comment 3 John Matthews 2012-07-16 20:17:12 UTC
The issue is that this repo contains errata info, yet the referenced packages lack checksum info, they only contain NEVRA.  

Below is an example of the updateinfo.xml for a referenced package:

<package arch="i686" epoch="0" name="squidGuard" release="9.el6" src="http://download.fedoraproject.org/pub/fedora/linux/updates/6/i386/squidGuard-1.4-9.el6.i686.rpm" version="1.4"><filename>squidGuard-1.4-9.el6.i686.rpm</filename></package>

The lack of checksum info impacts our ability to determine what rpms to link to the errata.

Comment 4 John Matthews 2012-07-16 21:50:03 UTC
The solution we have chosen is to skip the linking of rpms to errata when the rpm data is incomplete, i.e. it lacks checksum information.

Fix in master:
http://git.fedorahosted.org/git/?p=pulp.git;a=commitdiff;h=4a19ded8c39d9ff726b48dc86aad0a0f6c681e08

Fix in pulp_CR-1_patches:
http://git.fedorahosted.org/git/?p=pulp.git;a=commitdiff;h=98201618d24f034ea894905c80c57cd702cc7bcc

Comment 5 Jeff Ortel 2012-07-18 15:28:38 UTC
build: 0.314.

Comment 6 Preethi Thomas 2012-07-20 17:40:04 UTC
verified
[root@preethi ~]# pulp-admin -u admin -p admin repo create --repo pulp --feed http://repos.fedorapeople.org/repos/pulp/pulp/v2/testing/fedora-17/x86_64/
Successfully created repository [pulp]

[root@preethi ~]# pulp-admin -u admin -p admin repo create --repo epel --feed http://www.gtlib.gatech.edu/pub/fedora-epel/6/x86_64/
Successfully created repository [epel]

[root@preethi ~]# pulp-admin -u admin -p admin repo sync run --repo epel 
+----------------------------------------------------------------------+
                    Synchronizing Repository [epel]
+----------------------------------------------------------------------+

This command may be exited by pressing ctrl+c without affecting the actual
operation on the server.

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

Downloading repository content...
[==============                                    ] 28%
RPMs:       2846/7555 items
Delta RPMs: 0/0 items
Tree Files: 0/0 items
Files:      0/0 items
Write failed: Broken pipe
[pthomas@pthomas-lt ~]$ 
[pthomas@pthomas-lt ~]$ 
[pthomas@pthomas-lt ~]$ ssh root.redhat.com
root.redhat.com's password: 
Last login: Fri Jul 20 10:51:43 2012 from vpn-10-223.rdu.redhat.com
[root@preethi ~]# 
[root@preethi ~]# 
[root@preethi ~]# pulp-admin -u admin -p admin repo sync status --repo epel 
+----------------------------------------------------------------------+
                        Repository Status [epel]
+----------------------------------------------------------------------+

A sync task is queued on the server. Its progress will be tracked below.

This command may be exited by pressing ctrl+c without affecting the actual
operation on the server.

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

Downloading repository content...
[==================================================] 100%
RPMs:       7555/7555 items
Delta RPMs: 0/0 items
Tree Files: 0/0 items
Files:      0/0 items
... completed

Importing errata...
[-]
... completed

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

Publishing packages...
[==================================================] 100%
Packages: 0/0 items
... completed

Publishing distributions...
[==================================================] 100%
Distributions: 0/0 items
... completed

Generating metadata
[|]
... completed

Publishing repository over HTTP
[-]
... skipped

Publishing repository over HTTPS
[-]
... completed

Successfully synchronized repository

[root@preethi ~]#

Comment 7 Preethi Thomas 2013-01-07 14:09:42 UTC
Pulp 2.0 released.