When uploading Manifest on Satellite 6.5, facing issue: PG::ForeignKeyViolation: ERROR: update or delete on table "katello_pools" violates foreign key constraint "katello_pool_products_pool_id_fk" on table "katello_pool_products"

Solution Verified - Updated

Environment

Satellite 6.5

Issue

Uploading a subscription manifest on Satellite 6.5 server sometimes fails due to the error:

PG::ForeignKeyViolation: ERROR:  update or delete on table "katello_pools" violates foreign key constraint "katello_pool_products_pool_id_fk" on table "katello_pool_products"
DETAIL:  Key (id)=(2) is still referenced from table "katello_pool_products".
: DELETE FROM "katello_pools" WHERE "katello_pools"."id" = $1

Resolution

You should be able to workaround this issue by refreshing the manifest:

WebUI --> Content --> Subscriptions --> Manage Manifest --> Refresh

For more KB articles/solutions related to Red Hat Satellite 6.x Manifest Issues, please refer to the Consolidated Troubleshooting Article for Red Hat Satellite 6.x Manifest Issues

Root Cause

This issue is caused by This content is not included.a known bug, which is a race condition which can occur some of the time when uploading a manifest on Satellite 6.5. Due to the bug, the import of the manifest only completes partially, however refreshing the manifest should fully complete the import.

Diagnostic Steps

After downloading the subscription manifest and uploading it to the Satellite server, observe the import subscription manifest task via the WebUI --> Monitor --> Tasks. Inspecting the task shows the below error (or similar):

PG::ForeignKeyViolation: ERROR:  update or delete on table "katello_pools" violates foreign key constraint "katello_pool_products_pool_id_fk" on table "katello_pool_products"
DETAIL:  Key (id)=(2) is still referenced from table "katello_pool_products".
: DELETE FROM "katello_pools" WHERE "katello_pools"."id" = $1
SBR
Product(s)

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.