Project

Profile

Help

Issue #2280

closed

Error is not reported correctly when size verification for DRPM unit fails

Added by ttereshc over 6 years ago. Updated almost 4 years ago.

Status:
CLOSED - WORKSFORME
Priority:
Normal
Assignee:
Sprint/Milestone:
-
Start date:
Due date:
Estimated time:
Severity:
2. Medium
Version:
Platform Release:
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Easy Fix, Pulp 2
Sprint:
Quarter:

Description

Create and sync DRPM repo with `validate` option enabled for importer and the feed for which size verification of DRPMs will fail, for now it is https://repos.fedorapeople.org/pulp/pulp/fixtures/drpm/

Tested on Pulp 2.9.3.

$ pulp-admin rpm repo create --repo-id drpm  --feed  https://repos.fedorapeople.org/pulp/pulp/fixtures/drpm/  --validate true

Sync task will just succeed, in the logs there will be a traceback.

$ pulp-admin rpm repo sync run --repo-id drpm
+----------------------------------------------------------------------+
                    Synchronizing Repository [drpm]
+----------------------------------------------------------------------+

This command may be exited via ctrl+c without affecting the request.

Downloading metadata...
[\]
... completed

Downloading repository content...
[-]
[==================================================] 100%
RPMs:       5/5 items
Delta RPMs: 0/4 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
Sep 22 21:51:15 dev pulp[3891]: nectar.downloaders.base:ERROR: (3891-96512) 'DRPM' object has no attribute 'name'
Sep 22 21:51:15 dev pulp[3891]: nectar.downloaders.base:ERROR: (3891-96512) Traceback (most recent call last):
Sep 22 21:51:15 dev pulp[3891]: nectar.downloaders.base:ERROR: (3891-96512)   File "/usr/lib/python2.7/site-packages/nectar/downloaders/base.py", line 145, in _fire_event_to_listener
Sep 22 21:51:15 dev pulp[3891]: nectar.downloaders.base:ERROR: (3891-96512)     event_listener_callback(*args, **kwargs)
Sep 22 21:51:15 dev pulp[3891]: nectar.downloaders.base:ERROR: (3891-96512)   File "/home/user1/devel/pulp_rpm/plugins/pulp_rpm/plugins/importers/yum/listener.py", line 194, in download_succeeded
Sep 22 21:51:15 dev pulp[3891]: nectar.downloaders.base:ERROR: (3891-96512)     super(RPMListener, self).download_succeeded(report)
Sep 22 21:51:15 dev pulp[3891]: nectar.downloaders.base:ERROR: (3891-96512)   File "/home/user1/devel/pulp_rpm/plugins/pulp_rpm/plugins/importers/yum/listener.py", line 81, in download_succeeded
Sep 22 21:51:15 dev pulp[3891]: nectar.downloaders.base:ERROR: (3891-96512)     self._verify_size(unit, report)
Sep 22 21:51:15 dev pulp[3891]: nectar.downloaders.base:ERROR: (3891-96512)   File "/home/user1/devel/pulp_rpm/plugins/pulp_rpm/plugins/importers/yum/listener.py", line 120, in _verify_size
Sep 22 21:51:15 dev pulp[3891]: nectar.downloaders.base:ERROR: (3891-96512)     constants.NAME: unit.name,
Sep 22 21:51:15 dev pulp[3891]: nectar.downloaders.base:ERROR: (3891-96512) AttributeError: 'DRPM' object has no attribute 'name'

Expected result, example of the same error reporting for srpm:

$ pulp-admin rpm repo sync run --repo-id srpm
+----------------------------------------------------------------------+
                    Synchronizing Repository [srpm]
+----------------------------------------------------------------------+

This command may be exited via ctrl+c without affecting the request.

Downloading metadata...
[\]
... completed

Downloading repository content...
[-]
[==================================================] 100%
RPMs:       3/3 items
Delta RPMs: 0/0 items

... completed

Individual package errors encountered during sync:

Package: test-srpm01
Error: The size did not match the value specified in the
repository metadata.

Package: test-srpm03
Error: The size did not match the value specified in the
repository metadata.

Package: test-srpm02
Error: The size did not match the value specified in the
repository metadata.

Downloading distribution files...
[==================================================] 100%
Distributions: 0/0 items
... completed

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

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

Cleaning duplicate packages...
[-]
... completed

Task Succeeded

JFYI, the importer `--validate` option is enabled by default in Katello https://github.com/Katello/katello/pull/4747/files

Also available in: Atom PDF