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.

Bug 1770044

Summary: foreman-rake katello:reimport fails with 'NoMethodError: undefined method `pulp2_service_class' for nil:NilClass'
Product: Red Hat Satellite Reporter: matt jia <mjia>
Component: Content ManagementAssignee: Samir Jha <sajha>
Status: CLOSED ERRATA QA Contact: Lai <ltran>
Severity: high Docs Contact:
Priority: high    
Version: 6.6.0CC: ehelms, jalviso, janarula, ktordeur, mmccune, momran, pcreech, vsedmik
Target Milestone: 6.7.0Keywords: Regression, Triaged
Target Release: Unused   
Hardware: Unspecified   
OS: Unspecified   
Whiteboard:
Fixed In Version: rubygem-katello-3.14.0 Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
: 1771555 1791880 (view as bug list) Environment:
Last Closed: 2020-04-14 13:26:24 UTC Type: Bug
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description matt jia 2019-11-08 00:01:22 UTC
Description of problem:

foreman-rake katello:reimport no longer works.

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

6.6

How reproducible:

easy

Steps to Reproduce:

run `foreman-rake katello:reimport` 


Actual results:

It fails with below traceback:


foreman-rake katello:reimport
Importing Katello::Erratum
Importing Katello::PackageGroup
Importing Katello::PuppetModule
Importing Katello::Rpm
Importing Katello::Srpm
Importing Katello::ModuleStream
Importing Katello::YumMetadataFile
Importing Katello::Deb
rake aborted!
NoMethodError: undefined method `pulp2_service_class' for nil:NilClass
/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.12.0.27/app/models/katello/concerns/smart_proxy_extensions.rb:180:in `content_service'
/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.12.0.27/app/models/katello/concerns/pulp_database_unit.rb:61:in `import_all'
/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.12.0.27/lib/katello/tasks/reimport.rake:41:in `block (3 levels) in <top (required)>'
/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.12.0.27/lib/katello/tasks/reimport.rake:39:in `each'
/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.12.0.27/lib/katello/tasks/reimport.rake:39:in `block (2 levels) in <top (required)>'
/opt/rh/rh-ruby25/root/usr/share/gems/gems/rake-12.3.0/exe/rake:27:in `<top (required)>'
Tasks: TOP => katello:reimport

Expected results:

It should complete successfully without the error.

Additional info:

To workaround the issue, comment out below line in /opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.12.0.27/lib/katello/tasks/reimport.rake

models = [Katello::Erratum,
              Katello::PackageGroup,
              Katello::PuppetModule,
              Katello::Rpm,
              Katello::Srpm,
              Katello::ModuleStream,
              Katello::YumMetadataFile,
              #Katello::Deb,
              ...

Comment 4 Samir Jha 2019-11-08 17:48:06 UTC
Created redmine issue http://projects.theforeman.org/issues/28223 from this bug

Comment 5 Bryan Kearney 2019-11-08 21:01:10 UTC
Moving this bug to POST for triage into Satellite 6 since the upstream issue https://projects.theforeman.org/issues/28223 has been resolved.

Comment 7 Lai 2020-01-07 18:51:55 UTC
Steps to retest:

run `foreman-rake katello:reimport` 

Expected:
# foreman-rake katello:reimport
Importing Katello::Erratum
Importing Katello::PackageGroup
Importing Katello::PuppetModule
Importing Katello::Rpm
Importing Katello::Srpm
Importing Katello::ModuleStream
Importing Katello::YumMetadataFile
Importing Katello::FileUnit
Importing Katello::Subscription
Importing Katello::Pool
Importing Katello::DockerManifest
Importing Katello::DockerManifestList
Importing Katello::DockerTag
Importing Katello::ContentViewPuppetEnvironment
Importing Katello::Content
Importing Katello::OstreeBranch
Importing Activation Key Subscriptions

Actual:
# foreman-rake katello:reimport
Importing Katello::Erratum
Importing Katello::PackageGroup
Importing Katello::PuppetModule
Importing Katello::Rpm
Importing Katello::Srpm
Importing Katello::ModuleStream
Importing Katello::YumMetadataFile
Importing Katello::FileUnit
Importing Katello::Subscription
Importing Katello::Pool
Importing Katello::DockerManifest
Importing Katello::DockerManifestList
Importing Katello::DockerTag
Importing Katello::ContentViewPuppetEnvironment
Importing Katello::Content
Importing Katello::OstreeBranch
Importing Activation Key Subscriptions

Tested on 6.7.0_07

Marking issue as verified.

Comment 10 errata-xmlrpc 2020-04-14 13:26:24 UTC
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, 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-2020:1454