Bug 1770044 - foreman-rake katello:reimport fails with 'NoMethodError: undefined method `pulp2_service_class' for nil:NilClass'
Summary: foreman-rake katello:reimport fails with 'NoMethodError: undefined method `pu...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Content Management
Version: 6.6.0
Hardware: Unspecified
OS: Unspecified
high
high
Target Milestone: 6.7.0
Assignee: Samir Jha
QA Contact: Lai
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2019-11-08 00:01 UTC by matt jia
Modified: 2020-04-14 13:26 UTC (History)
7 users (show)

Fixed In Version: rubygem-katello-3.14.0
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 1771555 1791880 (view as bug list)
Environment:
Last Closed: 2020-04-14 13:26:24 UTC
Target Upstream Version:


Attachments (Terms of Use)


Links
System ID Priority Status Summary Last Updated
Foreman Issue Tracker 28223 High Closed foreman-rake katello:reimport fails with 'NoMethodError: undefined method `pulp2_service_class' for nil:NilClass' 2020-11-23 16:05:06 UTC
Red Hat Knowledge Base (Solution) 4563131 None None None 2019-11-08 01:17:28 UTC
Red Hat Product Errata RHSA-2020:1454 None None None 2020-04-14 13:26:33 UTC

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


Note You need to log in before you can comment on or make changes to this bug.