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.
DescriptionJoniel Pasqualetto
2022-05-25 16:16:00 UTC
Description of problem:
Fail to parse the the metadata when importing products/repositories that have a GPG key associated. Import task fails almost immediately with the following trace back:
~~~
2022-05-25T10:22:02 [E|app|0a12262c] NoMethodError: undefined method `find' for nil:NilClass
0a12262c | /opt/theforeman/tfm/root/usr/share/gems/gems/katello-4.1.1.56/app/services/katello/pulp3/content_view_version/metadata_map.rb:108:in `gpg_key_for_product'
0a12262c | /opt/theforeman/tfm/root/usr/share/gems/gems/katello-4.1.1.56/app/services/katello/pulp3/content_view_version/metadata_map.rb:63:in `block in parse_products'
0a12262c | /opt/theforeman/tfm/root/usr/share/gems/gems/katello-4.1.1.56/app/services/katello/pulp3/content_view_version/metadata_map.rb:57:in `map'
0a12262c | /opt/theforeman/tfm/root/usr/share/gems/gems/katello-4.1.1.56/app/services/katello/pulp3/content_view_version/metadata_map.rb:57:in `parse_products'
0a12262c | /opt/theforeman/tfm/root/usr/share/gems/gems/katello-4.1.1.56/app/services/katello/pulp3/content_view_version/metadata_map.rb:27:in `initialize'
0a12262c | /opt/theforeman/tfm/root/usr/share/gems/gems/katello-4.1.1.56/app/lib/actions/katello/content_view_version/import.rb:6:in `new'
0a12262c | /opt/theforeman/tfm/root/usr/share/gems/gems/katello-4.1.1.56/app/lib/actions/katello/content_view_version/import.rb:6:in `plan'
0a12262c | /opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.4.9/lib/dynflow/action.rb:515:in `block (3 levels) in execute_plan'
~~~
Version-Release number of selected component (if applicable):
Satellite 6.10.5 (katello-4.1.1.56)
How reproducible:
Always
Steps to Reproduce:
1. Create a custom product/repository and assign a GPG key to it
2. Create a CV including the repository created on step 1
3. Create a complete export of the CV created on step 2
4. Try importing the content
Actual results:
Fail to process the metadata and import doesn't work:
~~~
# hammer content-import version --path /var/lib/pulp/imports/Zabbix/1.0/2022-05-25T11-20-12-04-00/ --organization-id 4
Could not import the archive.:
undefined method `find' for nil:NilClass
~~~
Expected results:
Import to start
Additional info:
Issue happens here (file /opt/theforeman/tfm/root/usr/share/gems/gems/katello-4.1.1.56/app/services/katello/pulp3/content_view_version/metadata_map.rb):
~~~
def initialize(metadata:)
@toc = metadata[:toc]
@products = parse_products(metadata[:products]) if metadata[:products]
@repositories = parse_repositories(metadata[:repositories]) if metadata[:repositories]
@content_view = parse_content_view(metadata[:content_view]) if metadata[:content_view]
@content_view_version = parse_content_view_version(metadata[:content_view_version]) if metadata[:content_view_version]
@from_content_view_version = parse_content_view_version(metadata[:from_content_view_version]) if metadata[:from_content_view_version]
@gpg_keys = parse_gpg_keys(metadata[:gpg_keys]) if metadata[:gpg_keys]
end
~~~
When initializing the variable @products, the parser tries to access the variable @gpg_keys, that has not been initialized yet at that point. Simply changing the order of the initialization of those variables allows the import to happen.
Importing library and contentview containing repository with associated GPG key works properly.
VERIFIED with Satellite 6.11.1 SNAP1 @RHEL8.6 (rubygem-katello-4.3.0.44-1.el8sat.noarch)
Created attachment 1899240[details]
Hotfix RPM for Satellite 6.11.0 on RHEL7
INSTALL INSTRUCTIONS:
1. Take a complete backup or snapshot of Satellite 6.11.0 server
2. Download the hotfix RPM for Satellite 6.11.0 on RHEL7 attached to this BZ and copy it to Satellite server
3. # yum install ./tfm-rubygem-katello-4.3.0.42-2.HOTFIXRHBZ2090390.el7sat.noarch.rpm --disableplugin=foreman-protector
4. # satellite-maintain service restart
Created attachment 1899241[details]
Hotfix RPM for Satellite 6.11.0 on RHEL8
INSTALL INSTRUCTIONS:
1. Take a complete backup or snapshot of Satellite 6.11.0 server
2. Download the hotfix RPM for Satellite 6.11.0 on RHEL8 attached to this BZ and copy it to Satellite server
3. # dnf install ./rubygem-katello-4.3.0.42-2.HOTFIXRHBZ2090390.el8sat.noarch.rpm --disableplugin=foreman-protector
4. # satellite-maintain service restart
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 (Satellite 6.11.1 Async Bug Fix Update), 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/RHBA-2022:5742
Description of problem: Fail to parse the the metadata when importing products/repositories that have a GPG key associated. Import task fails almost immediately with the following trace back: ~~~ 2022-05-25T10:22:02 [E|app|0a12262c] NoMethodError: undefined method `find' for nil:NilClass 0a12262c | /opt/theforeman/tfm/root/usr/share/gems/gems/katello-4.1.1.56/app/services/katello/pulp3/content_view_version/metadata_map.rb:108:in `gpg_key_for_product' 0a12262c | /opt/theforeman/tfm/root/usr/share/gems/gems/katello-4.1.1.56/app/services/katello/pulp3/content_view_version/metadata_map.rb:63:in `block in parse_products' 0a12262c | /opt/theforeman/tfm/root/usr/share/gems/gems/katello-4.1.1.56/app/services/katello/pulp3/content_view_version/metadata_map.rb:57:in `map' 0a12262c | /opt/theforeman/tfm/root/usr/share/gems/gems/katello-4.1.1.56/app/services/katello/pulp3/content_view_version/metadata_map.rb:57:in `parse_products' 0a12262c | /opt/theforeman/tfm/root/usr/share/gems/gems/katello-4.1.1.56/app/services/katello/pulp3/content_view_version/metadata_map.rb:27:in `initialize' 0a12262c | /opt/theforeman/tfm/root/usr/share/gems/gems/katello-4.1.1.56/app/lib/actions/katello/content_view_version/import.rb:6:in `new' 0a12262c | /opt/theforeman/tfm/root/usr/share/gems/gems/katello-4.1.1.56/app/lib/actions/katello/content_view_version/import.rb:6:in `plan' 0a12262c | /opt/theforeman/tfm/root/usr/share/gems/gems/dynflow-1.4.9/lib/dynflow/action.rb:515:in `block (3 levels) in execute_plan' ~~~ Version-Release number of selected component (if applicable): Satellite 6.10.5 (katello-4.1.1.56) How reproducible: Always Steps to Reproduce: 1. Create a custom product/repository and assign a GPG key to it 2. Create a CV including the repository created on step 1 3. Create a complete export of the CV created on step 2 4. Try importing the content Actual results: Fail to process the metadata and import doesn't work: ~~~ # hammer content-import version --path /var/lib/pulp/imports/Zabbix/1.0/2022-05-25T11-20-12-04-00/ --organization-id 4 Could not import the archive.: undefined method `find' for nil:NilClass ~~~ Expected results: Import to start Additional info: Issue happens here (file /opt/theforeman/tfm/root/usr/share/gems/gems/katello-4.1.1.56/app/services/katello/pulp3/content_view_version/metadata_map.rb): ~~~ def initialize(metadata:) @toc = metadata[:toc] @products = parse_products(metadata[:products]) if metadata[:products] @repositories = parse_repositories(metadata[:repositories]) if metadata[:repositories] @content_view = parse_content_view(metadata[:content_view]) if metadata[:content_view] @content_view_version = parse_content_view_version(metadata[:content_view_version]) if metadata[:content_view_version] @from_content_view_version = parse_content_view_version(metadata[:from_content_view_version]) if metadata[:from_content_view_version] @gpg_keys = parse_gpg_keys(metadata[:gpg_keys]) if metadata[:gpg_keys] end ~~~ When initializing the variable @products, the parser tries to access the variable @gpg_keys, that has not been initialized yet at that point. Simply changing the order of the initialization of those variables allows the import to happen.