Bug 1311664 - Guests included in hypervisor checkins that do not have a guestid should be ignored
Summary: Guests included in hypervisor checkins that do not have a guestid should be i...
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Candlepin
Classification: Community
Component: candlepin
Version: 2.0
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: ---
: 2.0
Assignee: Chris Snyder
QA Contact: Katello QA List
URL:
Whiteboard:
Depends On:
Blocks: 1315897 1317008
TreeView+ depends on / blocked
 
Reported: 2016-02-24 17:18 UTC by Chris Snyder
Modified: 2020-04-15 14:23 UTC (History)
10 users (show)

Fixed In Version: candlepin-2.0.11-1
Doc Type: Bug Fix
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-07-22 19:05:31 UTC
Embargoed:


Attachments (Terms of Use)
config for virt-who to recreate the issue in candlepin (56 bytes, text/plain)
2016-02-24 17:18 UTC, Chris Snyder
no flags Details
report for virt-who to send to reproduce (723 bytes, text/plain)
2016-02-24 17:21 UTC, Chris Snyder
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Github candlepin candlepin pull 1124 0 None closed 1311664: Ignore empty guest IDs and hypervisor IDs 2020-07-09 17:55:47 UTC
Red Hat Knowledge Base (Solution) 2176921 0 None None None 2016-02-24 17:23:01 UTC

Description Chris Snyder 2016-02-24 17:18:56 UTC
Created attachment 1130266 [details]
config for virt-who to recreate the issue in candlepin

Description of problem:
When a hypervisor checkin is performed including a guest with a guestid of "",
the checkin fails with the essentially the following:

"""
2016-02-17 01:15:47,874 [req=b1d561ed-c6ea-4fe2-bdd8-24c26da1dedb, org=LME] ERROR org.candlepin.resource.HypervisorResource - Hypervisor checkin failed javax.persistence.PersistenceException: org.hibernate.PropertyValueException: not-null property references a null or transient value: org.candlepin.model.GuestId.guestId <stack_trace_omitted> Caused by: org.hibernate.PropertyValueException: not-null property references a null or transient value: org.candlepin.model.GuestId.guestId <stack_trace_omitted>
"""

This seems to cause candlepin to send back an http error 500.

How reproducible:
100%

Steps to Reproduce:
1. register to candlepin
2. Send a report including at least 1 guest with a guestid of "" using virt-who

For the convenience of whomever takes on this bug I have attached an example config and fake report for virt-who that will cause the issue in candlepin. These can be used to reproduce against a local deployment of candlepin.

Actual results:

The hypervisor checkin job fails due to the guestid = "".


Expected results:
The hypervisor checkin job succeeds by ignoring guest records that have a guestid of "" and logging what has been done so that we can track the frequency of such occurrences. 

Additional info:
It seems if a report containing the "" guestid is sent to the async hypervisor check in api method and the job consequently fails, it is retried 10 times. This could explain why the log file expands so much.

Comment 1 Chris Snyder 2016-02-24 17:21:29 UTC
Created attachment 1130268 [details]
report for virt-who to send to reproduce

Comment 2 Chris Snyder 2016-02-24 17:36:36 UTC
In order to use the attachments to reproduce the issue:

1) place the attached config file in /etc/virt-who.d/config.conf
2) place the attached report file somewhere on your filesystem (e.g. "/home/csnyder/Documents/report1.json")
3) update the config to point to the report.

Below are slightly more verbose reproduction steps:

1) register (using subscription-manager) to a locally deployed candlepin that has a db including our standard test_data.
2) run `virt-who -o -d`


Hope this helps!

Comment 3 Barnaby Court 2016-02-25 20:08:55 UTC
A debug log of the number of guests with missing id's should be output so it can be tracked.

Comment 8 Mike McCune 2016-03-28 22:26:18 UTC
This bug was accidentally moved from POST to MODIFIED via an error in automation, please see mmccune with any questions

Comment 9 Chris Roberts 2016-04-01 14:34:46 UTC
*** Bug 1315897 has been marked as a duplicate of this bug. ***


Note You need to log in before you can comment on or make changes to this bug.