foreman-rake katello:reimport fails with ActiveRecord::UnknownAttributeError: unknown attribute 'sourcerpm' for Katello::Srpm

Solution Verified - Updated -

Issue

  • When running foreman-rake katello:reimport hitting the following error:
# foreman-rake katello:reimport
Importing Katello::Erratum
Importing Katello::PackageGroup
Importing Katello::PuppetModule
Importing Katello::Rpm
Importing Katello::Srpm
rake aborted!
ActiveRecord::UnknownAttributeError: unknown attribute 'sourcerpm' for Katello::Srpm.
/opt/rh/rh-ror42/root/usr/share/gems/gems/activerecord-4.2.6/lib/active_record/attribute_assignment.rb:59:in `rescue in _assign_attribute'
/opt/rh/rh-ror42/root/usr/share/gems/gems/activerecord-4.2.6/lib/active_record/attribute_assignment.rb:53:in `_assign_attribute'
/opt/rh/rh-ror42/root/usr/share/gems/gems/activerecord-4.2.6/lib/active_record/attribute_assignment.rb:41:in `block in assign_attributes'
/opt/rh/rh-ror42/root/usr/share/gems/gems/activerecord-4.2.6/lib/active_record/attribute_assignment.rb:35:in `each'
/opt/rh/rh-ror42/root/usr/share/gems/gems/activerecord-4.2.6/lib/active_record/attribute_assignment.rb:35:in `assign_attributes'
/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.4.5.64/app/models/katello/srpm.rb:22:in `update_from_json'
/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.4.5.64/app/models/katello/concerns/pulp_database_unit.rb:56:in `block (2 levels) in import_all'
/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.4.5.64/app/models/katello/concerns/pulp_database_unit.rb:51:in `each'
/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.4.5.64/app/models/katello/concerns/pulp_database_unit.rb:51:in `block in import_all'
/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.4.5.64/app/services/katello/pulp/pulp_content_unit.rb:35:in `fetch_all'
/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.4.5.64/app/models/katello/concerns/pulp_database_unit.rb:69:in `import_all'
/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.4.5.64/lib/katello/tasks/reimport.rake:36:in `block (3 levels) in <top (required)>'
/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.4.5.64/lib/katello/tasks/reimport.rake:34:in `each'
/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.4.5.64/lib/katello/tasks/reimport.rake:34:in `block (2 levels) in <top (required)>'
NoMethodError: undefined method `sourcerpm=' for #<Katello::Srpm:0x00000000bad29938>
/opt/rh/rh-ror42/root/usr/share/gems/gems/activemodel-4.2.6/lib/active_model/attribute_methods.rb:433:in `method_missing'
/opt/rh/rh-ror42/root/usr/share/gems/gems/activerecord-4.2.6/lib/active_record/attribute_assignment.rb:54:in `public_send'
/opt/rh/rh-ror42/root/usr/share/gems/gems/activerecord-4.2.6/lib/active_record/attribute_assignment.rb:54:in `_assign_attribute'
/opt/rh/rh-ror42/root/usr/share/gems/gems/activerecord-4.2.6/lib/active_record/attribute_assignment.rb:41:in `block in assign_attributes'
/opt/rh/rh-ror42/root/usr/share/gems/gems/activerecord-4.2.6/lib/active_record/attribute_assignment.rb:35:in `each'
/opt/rh/rh-ror42/root/usr/share/gems/gems/activerecord-4.2.6/lib/active_record/attribute_assignment.rb:35:in `assign_attributes'
/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.4.5.64/app/models/katello/srpm.rb:22:in `update_from_json'
/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.4.5.64/app/models/katello/concerns/pulp_database_unit.rb:56:in `block (2 levels) in import_all'
/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.4.5.64/app/models/katello/concerns/pulp_database_unit.rb:51:in `each'
/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.4.5.64/app/models/katello/concerns/pulp_database_unit.rb:51:in `block in import_all'
/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.4.5.64/app/services/katello/pulp/pulp_content_unit.rb:35:in `fetch_all'
/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.4.5.64/app/models/katello/concerns/pulp_database_unit.rb:69:in `import_all'
/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.4.5.64/lib/katello/tasks/reimport.rake:36:in `block (3 levels) in <top (required)>'
/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.4.5.64/lib/katello/tasks/reimport.rake:34:in `each'
/opt/theforeman/tfm/root/usr/share/gems/gems/katello-3.4.5.64/lib/katello/tasks/reimport.rake:34:in `block (2 levels) in <top (required)>'
Tasks: TOP => katello:reimport
(See full trace by running task with --trace)

Environment

  • Red Hat Satellite 6.3

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