Note: This bug is displayed in read-only format because
the product is no longer active in Red Hat Bugzilla.
Red Hat Satellite engineering is moving the tracking of its product development work on Satellite to Red Hat Jira (issues.redhat.com). If you're a Red Hat customer, please continue to file support cases via the Red Hat customer portal. If you're not, please head to the "Satellite project" in Red Hat Jira and file new tickets here. Individual Bugzilla bugs will be migrated starting at the end of May. If you cannot log in to RH Jira, please consult article #7032570. That failing, please send an e-mail to the RH Jira admins at rh-issues@redhat.com to troubleshoot your issue as a user management inquiry. The email creates a ServiceNow ticket with Red Hat. Individual Bugzilla bugs that are migrated will be moved to status "CLOSED", resolution "MIGRATED", and set with "MigratedToJIRA" in "Keywords". The link to the successor Jira issue will be found under "Links", have a little "two-footprint" icon next to it, and direct you to the "Satellite project" in Red Hat Jira (issue links are of type "https://issues.redhat.com/browse/SAT-XXXX", where "X" is a digit). This same link will be available in a blue banner at the top of the page informing you that that bug has been migrated.
Description of problem:
foreman-rake katello:reimport would fail while importing "Katello::Content" and the failure is only observed when there are product contents to move and https://github.com/Katello/katello/blob/KATELLO-4.8/app/services/katello/product_content_importer.rb#L37-L44 code is triggered.
Version-Release number of selected component (if applicable):
Satellite 6.13.1
How reproducible:
Only on Customer's environment
Steps to Reproduce:
NA
Actual results:
# foreman-rake katello:reimport --trace
** Invoke katello:reimport (first_time)
** Invoke dynflow:client (first_time)
** Invoke environment (first_time)
** Execute environment
** Execute dynflow:client
** Invoke katello:check_ping (first_time)
** Invoke environment
** Invoke dynflow:client
** Execute katello:check_ping
** Execute katello:reimport
Importing Katello::Subscription
Importing Katello::Pool
Importing Katello::Content
rake aborted!
TypeError: no implicit conversion of String into Integer
/usr/share/gems/gems/katello-4.7.0.25/app/services/katello/product_content_importer.rb:39:in `[]'
/usr/share/gems/gems/katello-4.7.0.25/app/services/katello/product_content_importer.rb:39:in `block in find_product_for_content'
/usr/share/gems/gems/katello-4.7.0.25/app/services/katello/product_content_importer.rb:38:in `each'
/usr/share/gems/gems/katello-4.7.0.25/app/services/katello/product_content_importer.rb:38:in `find'
/usr/share/gems/gems/katello-4.7.0.25/app/services/katello/product_content_importer.rb:38:in `find_product_for_content'
/usr/share/gems/gems/katello-4.7.0.25/app/services/katello/product_content_importer.rb:66:in `block in handle_product_moves'
/usr/share/gems/gems/katello-4.7.0.25/app/services/katello/product_content_importer.rb:63:in `each'
/usr/share/gems/gems/katello-4.7.0.25/app/services/katello/product_content_importer.rb:63:in `handle_product_moves'
/usr/share/gems/gems/katello-4.7.0.25/app/services/katello/product_content_importer.rb:84:in `block in import'
/usr/share/gems/gems/katello-4.7.0.25/app/services/katello/product_content_importer.rb:83:in `each'
/usr/share/gems/gems/katello-4.7.0.25/app/services/katello/product_content_importer.rb:83:in `import'
/usr/share/gems/gems/katello-4.7.0.25/app/models/katello/content.rb:55:in `block in import_all'
Expected results:
No such errors
Additional info:
For this specific user, following change fixed the issue:
diff --git a/app/services/katello/product_content_importer.rb b/app/services/katello/product_content_importer.rb
index b5e345e..6757768 100644
--- a/app/services/katello/product_content_importer.rb
+++ b/app/services/katello/product_content_importer.rb
@@ -36,7 +36,7 @@ module Katello
def find_product_for_content(content_id)
prod = @cp_products.find do |prod_json|
- prod_json['productContent'].any? do |product_content_json|
+ prod_json.first&.[]('productContent')&.any? do |product_content_json|
product_content_json["content"]["id"] == content_id
end
end
See next comments for more information.
Since the problem described in this bug report should be
resolved in a recent advisory, it has been closed with a
resolution of ERRATA.
For information on the advisory (Important: Satellite 6.15.0 release), and where to find the updated
files, follow the link below.
If the solution does not work for you, open a new bug report.
https://access.redhat.com/errata/RHSA-2024:2010