Bug 2266145

Summary: CertificateCleanupJob fails with foreign key constraint violation on table cp_certificate
Product: Red Hat Satellite Reporter: Odilon Sousa <osousa>
Component: CandlepinAssignee: Barnaby Court <bcourt>
Status: CLOSED ERRATA QA Contact: amolpati
Severity: unspecified Docs Contact:
Priority: high    
Version: 6.11.5CC: ahumbe, alsouza, hyu, jpasqual, momran, nmoumoul, pmoravec, rlavi, saydas, shwsingh, snemeth, vijsingh, zhunting
Target Milestone: 6.14.3Keywords: PrioBumpGSS, Triaged, WorkAround
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: candlepin-4.3.12-1 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of: 2229095 Environment:
Last Closed: 2024-03-27 13:19:24 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Comment 2 amolpati 2024-03-07 06:54:16 UTC
Verified.

Tested on: Satellite 6.14.3

Steps followed:

1) Import a manifest on satellite -> create activation key -> register host
2) Schedule CertificateCleanupJob to run every minute using command "candlepin.async.jobs.CertificateCleanupJob.schedule=1 * * * * ?" in /etc/candlepin/candlepin.conf and restart tomcat.
3) Find the id using query (su - postgres -c "psql candlepin -c \"select cs.*, c.id as certificate_id from cp_cert_serial cs inner join cp_certificate c on c.serial_id = cs.id;\"")
4) Update that id to be revoked using command "UPDATE cp_cert_serial SET revoked=true, expiration='2022-01-15 00:00:00.000000' WHERE id=<one of the ids returned by the previous query>;"
5) Monitor "/var/log/candlepin/candlepin.log" for Foreign Key violations.
    

Observation:

No Foreign Key violations are observed in candlepin logs.

Comment 3 amolpati 2024-03-07 07:12:09 UTC
addition to above verification  - snap version 1.0

Comment 8 errata-xmlrpc 2024-03-27 13:19:24 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 (Moderate: Satellite 6.14.3 Async Security Update), 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-2024:1536