Bug 1375698 - Manifest export raises 500 when ProductServiceAdapter.getProductById returns null
Summary: Manifest export raises 500 when ProductServiceAdapter.getProductById returns ...
Keywords:
Status: CLOSED NEXTRELEASE
Alias: None
Product: Candlepin
Classification: Community
Component: candlepin
Version: 0.9.51
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
: ---
Assignee: candlepin-bugs
QA Contact: Katello QA List
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2016-09-13 18:23 UTC by Jonathon Turel
Modified: 2016-12-27 02:53 UTC (History)
5 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2016-09-22 14:11:34 UTC


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Bugzilla 1248727 1 None None None 2021-01-20 06:05:38 UTC

Description Jonathon Turel 2016-09-13 18:23:22 UTC
Description of problem:

When SKUs are incorrectly configured (specifically: mapped to engineering products which do not exist) then ProductServiceAdapter.getProductById will return null based on the IT implementation of the adapter in Hosted Candlepin. This breaks manifest export in the Customer Portal.

Version-Release number of selected component (if applicable): 0.9.51


How reproducible: Always


Steps to Reproduce:
1. Write a unit test which will export a consumer manifest
2. Modify the test so that one of the attached SKUs gets a nil value when getProductById is called

Actual results: An exception will be raised which results in a 500 from the GET /consumers/<uuid>/export API.


Expected results: A valid manifest is returned which ignored the fact that one of the SKUs attached was mapped to an invalid Engineering Product.


Additional info:

Comment 1 Filip Nguyen 2016-09-20 06:14:56 UTC
This usually happens when SKU's change and the org doesn't have the pools refreshed. 

I don't think that ignoring 'non existent products' is correct behavior.

On the other hand, if the performance impact wouldn't be high, maybe Candlepin should run refresh pools before manifest export?

Comment 2 vritant 2016-09-22 14:11:34 UTC
We persist products in candlepin 2.0, and hence do not fetch products from product adapters during export. so we do *not* think this should occur in 2.0.

That being said, we would like to ensure that. could you provide steps to reproduce and / or other resources please ( database back ups if you have any )

Comment 3 Jonathon Turel 2016-09-22 15:37:10 UTC
We have a potential way to solve this in the Adapter code so we'll look to do that and come back to you guys if that's not feasible.

Thanks for the updates!


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