Disconnected Satellite with 'undefined method `find' for nil:NilClass' when importing content that has gpg_keys associated to it

Solution Verified - Updated -

Issue

When a custom repository tied to a GPG key on a connected satellite is exported, and then that repository is imported into a disconnected satellite server, these lines are observed in /var/log/foreman/production.log:

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'

Environment

Satellite 6.10.5
Disconnected satellite server
Custom repository
GPG Key

Subscriber exclusive content

A Red Hat subscription provides unlimited access to our knowledgebase, tools, and much more.

Current Customers and Partners

Log in for full access

Log In

New to Red Hat?

Learn more about Red Hat subscriptions

Using a Red Hat product through a public cloud?

How to access this content