Note: This is a beta release of Red Hat Bugzilla 5.0. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Also email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback here.
Bug 1691105 - Content view version delete results in broken sym links
Summary: Content view version delete results in broken sym links
Keywords:
Status: VERIFIED
Alias: None
Product: Red Hat Satellite 6
Classification: Red Hat
Component: Pulp
Version: 6.5.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium vote
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: 2019-04-04 19:05 UTC (History)
6 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:
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Pulp Redmine 4560 Normal MODIFIED Publish YumMetadataFiles as files and not symlinks 2019-03-25 11:31:42 UTC

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.


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