Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Bug 1691105 - Content view version delete results in broken sym links
Summary: Content view version delete results in broken sym links
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Pulp
Version: 6.5.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: 6.5.0
Assignee: satellite6-bugs
QA Contact: Lai
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-03-20 21:09 UTC by Partha Aji
Modified: 2023-10-06 18:11 UTC (History)
10 users (show)

Fixed In Version: pulp-rpm-2.18.1.2-1
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2019-05-14 12:40:31 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Pulp Redmine 4560 0 Normal CLOSED - CURRENTRELEASE Publish YumMetadataFiles as files and not symlinks 2019-05-30 17:02:09 UTC
Red Hat Product Errata RHSA-2019:1222 0 None None None 2019-05-14 12:40:41 UTC

Internal Links: 1720369

Description Partha Aji 2019-03-20 21:09:01 UTC
During content view publishes satellite does not generate metadata if nothing changed between the source and destination repositories. This is done to speed up capsule syncs. However this optimization breaks if there is an additional metadata file in the repo (repodata/productid for example.)

The metadata files are created as unique identifiers for every repo. This implies that every CV publish generates a new metadata file in its archived version. However since satellite only looks for rpms, distributions, errata and checksums + name for yum metadata, it does not realize that content changed. This means content generated via a CV promote will still point to content from one of the previous archives. This will lead to broken symlinks if that previous archived version is deleted.

Steps to reproduce
1) Create a repo with some yum metadata on it (https://partha.fedorapeople.org/test-repos/rpm-with-productid/) 
2) Sync the repo
3) Create a CV with that repository and publish
4) Publish the CV again and create version 2.0
5) Delete version 1.0
6) Go to the console and run the following
"foreman-rake katello:delete_orphaned_content"
7) check the following directories

ls -l /var/lib/pulp/published/yum/https/repos/Default_Organization/content_views/<cv name>/2.0/custom/<product name>/<repo name>/repodata/*product*
and 
ls -l /var/lib/pulp/published/yum/https/repos/Default_Organization/Library/<cv name>/custom/<product name>/<repo name>/repodata/*product*


Expected:
The 2 paths symlink to the same file

Actual:
The library version has a broken symlink

Comment 3 Justin Sherrill 2019-03-20 21:17:09 UTC
As a workaround after the problem occurs, simply:

Navigate to  Content > Content Views > Click your content view > find your content view version
click 'Actions' Down arrow > Regenerate Repository metadata

Comment 4 Partha Aji 2019-03-21 19:54:26 UTC
The approach to fix this involves copying yum metadata files directly instead of using symlinks. Check the associated pulp issue.

Comment 5 pulp-infra@redhat.com 2019-03-21 20:31:52 UTC
The Pulp upstream bug status is at NEW. Updating the external tracker on this bug.

Comment 6 pulp-infra@redhat.com 2019-03-21 20:31:53 UTC
The Pulp upstream bug priority is at Normal. Updating the external tracker on this bug.

Comment 7 pulp-infra@redhat.com 2019-03-22 18:31:19 UTC
The Pulp upstream bug status is at ASSIGNED. Updating the external tracker on this bug.

Comment 8 pulp-infra@redhat.com 2019-03-22 21:01:23 UTC
The Pulp upstream bug status is at POST. Updating the external tracker on this bug.

Comment 9 pulp-infra@redhat.com 2019-03-25 11:31:43 UTC
The Pulp upstream bug status is at MODIFIED. Updating the external tracker on this bug.

Comment 10 pulp-infra@redhat.com 2019-03-25 12:01:42 UTC
All upstream Pulp bugs are at MODIFIED+. Moving this bug to POST.

Comment 12 Lai 2019-04-04 19:05:47 UTC
Steps to retest:

Steps to reproduce
1) Create a repo with 2 yum metadata on it (https://partha.fedorapeople.org/test-repos/rpm-with-productid/) 
2) Sync the repo
3) Create a CV with that repository and publish
4) Publish the CV again and create version 2.0
5) Delete version 1.0
6) Go to the console and run the following
"foreman-rake katello:delete_orphaned_content"
7) check the following directories

ls -l /var/lib/pulp/published/yum/https/repos/Default_Organization/content_views/<cv name>/2.0/custom/<product name>/<repo name>/repodata/*product*
and 
ls -l /var/lib/pulp/published/yum/https/repos/Default_Organization/Library/<cv name>/custom/<product name>/<repo name>/repodata/*product*


Expected:
-bash-4.2# ls -l /var/lib/pulp/published/yum/https/repos/Default_Organization/content_views/linkTest2/4.0/custom/syslink/rpm-with-productid/repodata/
total 28K
-rw-r--r--. 1 apache apache  304 Apr  4 13:57 03973ad7700d20523f1ded1b0d0344929e5c4db47864d0aba45bd2a4c107c9d0-other.xml.gz
-rw-r--r--. 1 apache apache   24 Apr  4 13:57 73eada8d89ebc808fa71a8446e4a55b2c15a61822738f3b87ac1f7b0d30016a8-productid.gz
-rw-r--r--. 1 apache apache  124 Apr  4 13:57 a27718cc28ec6d71432e0ef3e6da544b7f9d93f6bb7d0a55aacd592d03144b70-comps.xml
-rw-r--r--. 1 apache apache  814 Apr  4 13:57 a94dcbbac2bcfb42bad521988aeb2bd7b8e0775c211990ba75814260d6041926-primary.xml.gz
-rw-r--r--. 1 apache apache  330 Apr  4 13:57 b4890b31d401ba38417ddfb132f49466dd12afe92031680ec9082bdd8685f7cc-filelists.xml.gz
-rw-r--r--. 1 apache apache   92 Apr  4 13:57 b7e270c025e7ff6a689332db48a6b7297f8b07c8059d75234e66b55f24e6d437-updateinfo.xml.gz
-rw-r--r--. 1 apache apache 2.5K Apr  4 13:58 repomd.xml
-bash-4.2# ls -l /var/lib/pulp/published/yum/https/repos/Default_Organization/Library/linkTest2/custom/syslink/rpm-with-productid/repodata/
total 28K
-rw-r--r--. 1 apache apache  304 Apr  4 13:57 03973ad7700d20523f1ded1b0d0344929e5c4db47864d0aba45bd2a4c107c9d0-other.xml.gz
-rw-r--r--. 1 apache apache   24 Apr  4 13:57 73eada8d89ebc808fa71a8446e4a55b2c15a61822738f3b87ac1f7b0d30016a8-productid.gz
-rw-r--r--. 1 apache apache  124 Apr  4 13:57 a27718cc28ec6d71432e0ef3e6da544b7f9d93f6bb7d0a55aacd592d03144b70-comps.xml
-rw-r--r--. 1 apache apache  814 Apr  4 13:57 a94dcbbac2bcfb42bad521988aeb2bd7b8e0775c211990ba75814260d6041926-primary.xml.gz
-rw-r--r--. 1 apache apache  330 Apr  4 13:57 b4890b31d401ba38417ddfb132f49466dd12afe92031680ec9082bdd8685f7cc-filelists.xml.gz
-rw-r--r--. 1 apache apache   92 Apr  4 13:57 b7e270c025e7ff6a689332db48a6b7297f8b07c8059d75234e66b55f24e6d437-updateinfo.xml.gz
-rw-r--r--. 1 apache apache 2.5K Apr  4 13:58 repomd.xml

Actual:
-bash-4.2# ls -l /var/lib/pulp/published/yum/https/repos/Default_Organization/content_views/linkTest2/4.0/custom/syslink/rpm-with-productid/repodata/
total 28K
-rw-r--r--. 1 apache apache  304 Apr  4 13:57 03973ad7700d20523f1ded1b0d0344929e5c4db47864d0aba45bd2a4c107c9d0-other.xml.gz
-rw-r--r--. 1 apache apache   24 Apr  4 13:57 73eada8d89ebc808fa71a8446e4a55b2c15a61822738f3b87ac1f7b0d30016a8-productid.gz
-rw-r--r--. 1 apache apache  124 Apr  4 13:57 a27718cc28ec6d71432e0ef3e6da544b7f9d93f6bb7d0a55aacd592d03144b70-comps.xml
-rw-r--r--. 1 apache apache  814 Apr  4 13:57 a94dcbbac2bcfb42bad521988aeb2bd7b8e0775c211990ba75814260d6041926-primary.xml.gz
-rw-r--r--. 1 apache apache  330 Apr  4 13:57 b4890b31d401ba38417ddfb132f49466dd12afe92031680ec9082bdd8685f7cc-filelists.xml.gz
-rw-r--r--. 1 apache apache   92 Apr  4 13:57 b7e270c025e7ff6a689332db48a6b7297f8b07c8059d75234e66b55f24e6d437-updateinfo.xml.gz
-rw-r--r--. 1 apache apache 2.5K Apr  4 13:58 repomd.xml
-bash-4.2# ls -l /var/lib/pulp/published/yum/https/repos/Default_Organization/Library/linkTest2/custom/syslink/rpm-with-productid/repodata/
total 28K
-rw-r--r--. 1 apache apache  304 Apr  4 13:57 03973ad7700d20523f1ded1b0d0344929e5c4db47864d0aba45bd2a4c107c9d0-other.xml.gz
-rw-r--r--. 1 apache apache   24 Apr  4 13:57 73eada8d89ebc808fa71a8446e4a55b2c15a61822738f3b87ac1f7b0d30016a8-productid.gz
-rw-r--r--. 1 apache apache  124 Apr  4 13:57 a27718cc28ec6d71432e0ef3e6da544b7f9d93f6bb7d0a55aacd592d03144b70-comps.xml
-rw-r--r--. 1 apache apache  814 Apr  4 13:57 a94dcbbac2bcfb42bad521988aeb2bd7b8e0775c211990ba75814260d6041926-primary.xml.gz
-rw-r--r--. 1 apache apache  330 Apr  4 13:57 b4890b31d401ba38417ddfb132f49466dd12afe92031680ec9082bdd8685f7cc-filelists.xml.gz
-rw-r--r--. 1 apache apache   92 Apr  4 13:57 b7e270c025e7ff6a689332db48a6b7297f8b07c8059d75234e66b55f24e6d437-updateinfo.xml.gz
-rw-r--r--. 1 apache apache 2.5K Apr  4 13:58 repomd.xml

Syslink are the same on library and content-view location.

Tested on 6.5.0 snap 22.

Comment 13 sthirugn@redhat.com 2019-04-22 21:40:20 UTC
Updated Steps to reproduce:
1) Create a repo with some yum metadata on it (https://partha.fedorapeople.org/test-repos/rpm-with-productid/) 
2) Sync the repo
3) Create a CV with that repository and publish
4) Create an include filter and have it include `lion` package (assuming you are using the repo on Step 1)
5) Publish the CV again and create version 2.0
6) Delete version 1.0
7) Go to the console and run the following
"foreman-rake katello:delete_orphaned_content"
8) check the following directories
ls -l /var/lib/pulp/published/yum/https/repos/Default_Organization/content_views/<cv name>/2.0/custom/<product name>/<repo name>/repodata/*product*
and 
ls -l /var/lib/pulp/published/yum/https/repos/Default_Organization/Library/<cv name>/custom/<product name>/<repo name>/repodata/*product*

I was able to reproduce this on 6.4.2.

Comment 17 errata-xmlrpc 2019-05-14 12:40:31 UTC
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.

For information on the advisory, and where to find the updated
files, follow the link below.

If the solution does not work for you, open a new bug report.

https://access.redhat.com/errata/RHSA-2019:1222

Comment 18 pulp-infra@redhat.com 2019-05-22 19:31:49 UTC
The Pulp upstream bug status is at ON_QA. Updating the external tracker on this bug.

Comment 19 pulp-infra@redhat.com 2019-05-30 17:02:10 UTC
The Pulp upstream bug status is at CLOSED - CURRENTRELEASE. Updating the external tracker on this bug.


Note You need to log in before you can comment on or make changes to this bug.