What repository contains a package backed by a given artifact file in pulp-3?
Environment
- Red Hat Satellite 6
- any other deployment of
pulp-3
Issue
Running orphans cleanup in pulp-3, too many artifacts remain on the disk under /var/lib/pulp/media/artifact directory. How to identify what package they represent? Or what repository contains or published them?
Resolution
To identify package behind given artifact, run file or (if it is really a RPM) the rpm command directly:
# file /var/lib/pulp/media/artifact/e5/3062ea6273c170eddc3e806f0d0b52793b6b68bcba2f872d4691e1a3097bc7
/var/lib/pulp/media/artifact/e5/3062ea6273c170eddc3e806f0d0b52793b6b68bcba2f872d4691e1a3097bc7: RPM v3.0 bin i386/x86_64 glibc-langpack-st-2.34-28.el9_0.2
# rpm -q -p /var/lib/pulp/media/artifact/e5/3062ea6273c170eddc3e806f0d0b52793b6b68bcba2f872d4691e1a3097bc7
glibc-langpack-st-2.34-28.el9_0.2.x86_64
#
To find out what repository contains or published the given artifact, run either below query - just customize the relative path (strip leading /var/lib/pulp/media/):
# su - postgres -c "psql pulpcore -c \"SELECT cr.* FROM core_repository AS cr INNER JOIN core_repositoryversion AS crv ON cr.pulp_id = crv.repository_id INNER JOIN core_publication AS cp ON crv.pulp_id = cp.repository_version_id INNER JOIN core_publishedartifact AS cpa ON cp.pulp_id = cpa.publication_id INNER JOIN core_contentartifact AS cca ON cpa.content_artifact_id = cca.pulp_id INNER JOIN core_artifact AS ca ON cca.artifact_id = ca.pulp_id WHERE ca.file = 'artifact/e5/3062ea6273c170eddc3e806f0d0b52793b6b68bcba2f872d4691e1a3097bc7';\""
pulp_id | pulp_created | pulp_last_updated | name | description | next_v
ersion | pulp_type | remote_id | retain_repo_versions | user_hidden
--------------------------------------+-------------------------------+-------------------------------+-----------------------------------------------------------------+-------------+-------
-------+-----------+-----------+----------------------+-------------
71887855-256e-44da-8d94-edb1abc869d1 | 2022-10-12 13:58:26.190398+02 | 2022-10-12 14:03:41.622534+02 | Red_Hat_Enterprise_Linux_9_for_x86_64_-_BaseOS_RPMs_9-152542526 | |
2 | rpm.rpm | | | f
(1 row)
#
# su - postgres -c "psql pulpcore -c \"SELECT cr.* FROM core_repository AS cr INNER JOIN core_repositorycontent AS crc ON cr.pulp_id = crc.repository_id INNER JOIN core_contentartifact AS cca ON crc.content_id = cca.content_id INNER JOIN core_artifact AS ca ON cca.artifact_id = ca.pulp_id WHERE ca.file = 'artifact/e5/3062ea6273c170eddc3e806f0d0b52793b6b68bcba2f872d4691e1a3097bc7';\""
pulp_id | pulp_created | pulp_last_updated | name | description | next_v
ersion | pulp_type | remote_id | retain_repo_versions | user_hidden
--------------------------------------+-------------------------------+-------------------------------+-----------------------------------------------------------------+-------------+-------
-------+-----------+-----------+----------------------+-------------
71887855-256e-44da-8d94-edb1abc869d1 | 2022-10-12 13:58:26.190398+02 | 2022-10-12 14:03:41.622534+02 | Red_Hat_Enterprise_Linux_9_for_x86_64_-_BaseOS_RPMs_9-152542526 | |
2 | rpm.rpm | | | f
(1 row)
#
For more KB articles/solutions related to Red Hat Satellite 6.x Pulp 3.0 Issues, please refer to the Consolidated Troubleshooting Article for Red Hat Satellite 6.x Pulp 3.0-related Issues
This solution is part of Red Hat’s fast-track publication program, providing a huge library of solutions that Red Hat engineers have created while supporting our customers. To give you the knowledge you need the instant it becomes available, these articles may be presented in a raw and unedited form.