Bug 1488508
Summary: | hypervisor removal causes postgres fk error | ||
---|---|---|---|
Product: | [Community] Candlepin | Reporter: | Klaas Demter <klaas> |
Component: | candlepin | Assignee: | Chris "Ceiu" Rog <crog> |
Status: | CLOSED CURRENTRELEASE | QA Contact: | Katello QA List <katello-qa-list> |
Severity: | medium | Docs Contact: | |
Priority: | high | ||
Version: | 2.0 | CC: | khowell, klaas, redakkan, skallesh |
Target Milestone: | --- | Keywords: | Triaged |
Target Release: | --- | ||
Hardware: | Unspecified | ||
OS: | Unspecified | ||
Whiteboard: | |||
Fixed In Version: | Doc Type: | If docs needed, set a value | |
Doc Text: | Story Points: | --- | |
Clone Of: | Environment: | ||
Last Closed: | 2019-09-24 17:13:53 UTC | Type: | Bug |
Regression: | --- | Mount Type: | --- |
Documentation: | --- | CRM: | |
Verified Versions: | Category: | --- | |
oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
Cloudforms Team: | --- | Target Upstream Version: | |
Embargoed: |
Description
Klaas Demter
2017-09-05 14:36:44 UTC
it only seems to affect hypervisors that had a license before the migration from candlepin-0.9.54.10-1.el7.noarch to candlepin-2.0.40-1.el7.noarch and I also can't remove licenses from the hypervisors. new hypervisors added after the migration seem to work fine, I can add/remove licenses and delete those hypervisors normally. After a little investigating I think the issue is that the pool points to a certificate but it should not do that. Newly created hypervisors with assigned licenses don't point to a certificate. As a workaround for my system I ran: update cp_pool set certificate_id = NULL where type = 'UNMAPPED_GUEST' ; update cp_pool set certificate_id = NULL where type = 'ENTITLEMENT_DERIVED' ; Would you guys agree with my assesment and my fix? Greetings Klaas https://github.com/candlepin/candlepin/pull/1714 - tested it and works here, does this need to go into 2.1 aswell? commit c0d5566f6a54181f55fd95454e1e72110399ca17 Author: Chris Rog <crog> Date: Mon Sep 18 10:30:22 2017 -0400 1488508: Restricted upstream info migration to master pools - The per-org migration task no longer migrates upstream subscription info to all related pools, but instead only updates the master pool for a given subscription For users already running into this issue, the workaround above will work for the specific issue, but it is recommended to apply a more thorough query that will bring the database into a closer state to what it would be had it been migrated with this fix: UPDATE cp_pool SET cdn_id=NULL, certificate_id=NULL, upstream_entitlement_id=NULL, upstream_consumer_id=NULL, upstream_pool_id=NULL WHERE id IN (SELECT ss.pool_id FROM cp2_pool_source_sub ss WHERE ss.subscription_sub_key != 'master'); This will nullify all six fields that are extraneously updated with upstream information on any pool which is not a master pool. |