Note: This bug is displayed in read-only format because the product is no longer active in Red Hat Bugzilla.

Bug 1150234

Summary: "This instance does not yet exist as a row in the database" Exception
Product: [Community] Candlepin (Migrated to Jira) Reporter: Dennis Crissman <dcrissman>
Component: candlepinAssignee: candlepin-bugs
Status: CLOSED CURRENTRELEASE QA Contact: Katello QA List <katello-qa-list>
Severity: high Docs Contact:
Priority: urgent    
Version: 0.9CC: aedwards, chrobert, dcrissman, dgoodwin, ggillies, londrack, timoran, tony
Target Milestone: ---   
Target Release: ---   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2014-11-04 19:11:35 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:
Attachments:
Description Flags
Exception log
none
Exception for owner 5544985 none

Description Dennis Crissman 2014-10-07 18:14:32 UTC
Created attachment 944706 [details]
Exception log

I am getting the attached exception in both stage and production environments. Would someone take a look?

Thanks,
Dennis

Comment 3 Dennis Crissman 2014-10-10 17:46:53 UTC
I don't believe the problem is actually with RH00028, I believe at this time the refresh process is blowing up before it gets to that subscription. Rather it seems to be failing when attempting to delete pool 8a85f981478d1fa60147aa79bfad4ba4 which is for productid MCT0370. 27 of the above owners have this product in common.

Comment 4 Dennis Crissman 2014-10-10 18:24:16 UTC
Created attachment 945776 [details]
Exception for owner 5544985

Comment 5 Dennis Crissman 2014-10-21 18:30:51 UTC
Raising priority as we have another customer issue.

Comment 6 Devan Goodwin 2014-10-21 18:57:40 UTC
Will wrote a test that exposed the problem and a fix regarding how we handle cleanup of pools. An bug in the relatively rare situation that virt_limit is taken off a subscription caused problems with Hibernate. Fix is merged to master, but we are still blocked from building for RHEL 6 by bug #1149605.


PR: https://github.com/candlepin/candlepin/pull/746

Master commit: 972108f643f50030037ff940d5eb4cc176884151

Comment 7 Chris Roberts 2014-10-21 19:52:18 UTC
have another customer running into this issue, do we have an eta on a fix, i see the bug is urgent already.

Comment 8 Devan Goodwin 2014-10-23 20:24:08 UTC
Will's fix is now build in brew as candlepin-0.9.26.3-1.el6

Comment 12 Devan Goodwin 2014-10-29 14:31:49 UTC
I see two bugs here.

In this scenario, virt_limit has not been removed.

However quantity has changed from 1 to "unlimited", or -1. 

In pool.java we have:

    public boolean isOverflowing() {
        return getConsumed() > this.quantity;
    }

Which is wrong as quantity is -1 in this case, which is supposed to mean unlimited, so it's incorrectly trying to revoke entitlements for a pool that's going to unlimited quantity.

The second issue appears to be the same as the first, Will's fix avoids it for pools being deleted, but if attributes change, and quantity is reduces, and entitlements are overconsumed, it will surface again.

Comment 13 Devan Goodwin 2014-10-29 18:57:38 UTC
A more correct fix has been done in master, commit c0070627cddde0dce79bb0d461f46ed5a02f952f fixes this issue, and 69ccd4f7b3676c68c1fd6c0faa19ec22df6debbb fixes the bug where it looks like we'll try to revoke every entitlement in an unlimited pool if anything changes on it during refresh.

Doing a 0.9.26.4-1 hotfix build now.

Comment 15 Dennis Crissman 2014-11-04 19:11:35 UTC
This change has been pushed into production. I have refreshed the owners that I could find, but in case any were missed. All owners that were having this issue will need a pool refresh.