Project

Profile

Help

Issue #2354

closed

Incorrect URL on lazy catalog entries created for existing RPM content units

Added by jortel@redhat.com over 7 years ago. Updated about 5 years ago.

Status:
CLOSED - CURRENTRELEASE
Priority:
High
Sprint/Milestone:
-
Start date:
Due date:
Estimated time:
Severity:
3. High
Version:
2.8.7
Platform Release:
2.10.3
OS:
Triaged:
Yes
Groomed:
No
Sprint Candidate:
No
Tags:
Pulp 2
Sprint:
Sprint 9
Quarter:

Description

The YUM importer is creating lazy catalog entries with an incorrect URL when the unit already exists. This affects RPMs, DRPMs and SRPMs. When syncing an existing unit, the importer fetches the unit and associates it to the repository. Then creates a catalog entry. The url is derived by joining the feed url and the unit.download_path property. For packages, property (method) returns the unit.relativepath which is stored in the database. As a result, is the URL for all catalog entries created for a unit has the path component based on the ref (URL) defined in the primary.xml when the unit was originally imported. Instead of, a url based on the ref (URL) in the primary.xml for the upstream repository being sync'd.

Here is an example. Assuming 2 upstream YUM repositories and 2 Pulp repositories with the following layouts:

upstream-A

repodata/
server/
    bear-4.1-1.noarch.rpm

upstream-B

repodata/
packages/
    bear-4.1-1.noarch.rpm

When upstream-A is sync'd, it will create a content unit for bear-4.1-1.noarch.rpm as:

 unit.relativepath="server/bear-4.1-1.noarch.rpm"

And a catalog entry of:

Entry.url="http://upstream-A.org/content/server/bear-4.1-1.noarch.rpm"

When upstream-B is sync'd, it will find the existing content unit for bear-4.1-1.noarch.rpm and create a catalog entry of:

Entry.url="http://upstream-B.org/content/server/bear-4.1-1.noarch.rpm"

But should have created a catalog entry using the packages directory in the path component as:

Entry.url="http://upstream-B.org/content/packages/bear-4.1-1.noarch.rpm"

The causes the streamer to 404 when trying to download content using the catalog entries with an incorrect URL. The catalog being correct is critical for both on_demand and background download policies to work.

Two things should be fixed:

  1. The importer needs to create the catalog entry with the correct URL.
  2. The streamer should try all available catalog entries before returning the 404.

I recommend only correcting the catalog entry for now.

Actions #2

Updated by jortel@redhat.com over 7 years ago

  • Status changed from NEW to ASSIGNED
  • Assignee set to jortel@redhat.com
  • Sprint/Milestone set to 27
  • Triaged changed from No to Yes
Actions #3

Updated by jortel@redhat.com over 7 years ago

  • Status changed from ASSIGNED to POST

Added by jortel@redhat.com over 7 years ago

Revision ecef550a | View on GitHub

Fix URL in catalog entry created for existing package. closes #2354

Actions #4

Updated by jortel@redhat.com over 7 years ago

  • Status changed from POST to MODIFIED
Actions #6

Updated by semyers over 7 years ago

  • Platform Release set to 2.10.3
Actions #7

Updated by semyers over 7 years ago

  • Status changed from MODIFIED to 5
Actions #9

Updated by semyers over 7 years ago

  • Status changed from 5 to CLOSED - CURRENTRELEASE
Actions #10

Updated by bmbouter about 6 years ago

  • Sprint set to Sprint 9
Actions #11

Updated by bmbouter about 6 years ago

  • Sprint/Milestone deleted (27)
Actions #12

Updated by bmbouter about 5 years ago

  • Tags Pulp 2 added

Also available in: Atom PDF