-
Bug
-
Resolution: Duplicate
-
Undefined
-
None
-
6.16.0
-
None
Description of problem:
Satellite failed to index CP pools to the database if the imported subscriptions contain future date.
rb(main):012:0> Katello::Subscription.import_all irb(main):013:0> Katello::Pool.import_all Traceback (most recent call last): 13: from lib/tasks/console.rake:5:in `block in <top (required)>' 12: from (irb):13 11: from katello (4.14.0.4) app/models/katello/glue/candlepin/candlepin_object.rb:51:in `import_all' 10: from katello (4.14.0.4) app/models/katello/glue/candlepin/candlepin_object.rb:53:in `block in import_all' 9: from katello (4.14.0.4) app/models/katello/glue/candlepin/pool.rb:62:in `import_candlepin_records' 8: from katello (4.14.0.4) app/models/katello/glue/candlepin/candlepin_object.rb:16:in `import_candlepin_records' 7: from katello (4.14.0.4) app/models/katello/glue/candlepin/candlepin_object.rb:16:in `each' 6: from katello (4.14.0.4) app/models/katello/glue/candlepin/candlepin_object.rb:17:in `block in import_candlepin_records' 5: from katello (4.14.0.4) app/models/katello/glue/candlepin/pool.rb:72:in `import_candlepin_record' 4: from katello (4.14.0.4) app/models/katello/glue/candlepin/candlepin_object.rb:30:in `import_candlepin_record' 3: from katello (4.14.0.4) app/lib/katello/util/support.rb:97:in `active_record_retry' 2: from katello (4.14.0.4) app/models/katello/glue/candlepin/candlepin_object.rb:31:in `block in import_candlepin_record' 1: from katello (4.14.0.4) app/lib/katello/lazy_accessor.rb:67:in `save!' ActiveRecord::RecordInvalid (Validation failed: Subscription can't be blank)
How reproducible:
Easy
Is this issue a regression from an earlier version:
Yes
Steps to Reproduce:
1. Create a manifest and add at least one subscription with future date.
2. Export the manifest and import to the Satellite.
Actual behavior:
Import task failed with "ActiveRecord::RecordInvalid (Validation failed: Subscription can't be blank)" error.
Expected behavior:{}
No error.
Business Impact / Additional info:
There is a new parameter for getProducts API introduced since Candlepin 4.4.16 (Satellite 6.16) called "active" which by default exclude all inactive products.
See the API documentation below:
So I think the possible solution is to set the "active=include" when Katello is calling the API to fetch all products.