Problem:
The generation of the Red Hat Inventory report for upload is consistently failing with the following error:
NoMethodError: undefined method `lifecycle_environment’ for #Host::Managed:0x000055bb2a543ba8
Did you mean? lifecycle_environments
lifecycle_environments=
lifecycle_environment_ids
lifecycle_environment_ids=
lifecycle_environment_names
Expected outcome:
The report generation completes successfully so that it can be uploaded to Red Hat for subscription management and Insights purposes.
Foreman and Proxy versions:
- foreman-3.6.1-1.el8.noarch
- katello-4.8.1-1.el8.noarch
Foreman and Proxy plugin versions:
- foreman-proxy-3.6.1-1.el8.noarch
- rubygem-foreman_rh_cloud-7.0.45-1.fm3_6.el8.noarch
Distribution and version:
Rocky Linux 8.8
Other relevant data:
Full stack trace from the generation error:
I, [2023-06-30T10:47:22.397861 #2198357] INFO -- : Started generating hosts report in /tmp/d20230630-2198357-113bozc
I, [2023-06-30T10:47:22.522988 #2198357] INFO -- : Adding slice f2f275de-80b0-4fad-8d45-589de56e8d2f
rake aborted!
NoMethodError: undefined method `lifecycle_environment' for #<Host::Managed:0x000055bb2a543ba8>
Did you mean? lifecycle_environments
lifecycle_environments=
lifecycle_environment_ids
lifecycle_environment_ids=
lifecycle_environment_names
/usr/share/gems/gems/activemodel-6.1.7.3/lib/active_model/attribute_methods.rb:469:in `method_missing'
/usr/share/gems/gems/foreman_rh_cloud-7.0.45/lib/foreman_inventory_upload/generators/tags.rb:49:in `content_data'
/usr/share/gems/gems/foreman_rh_cloud-7.0.45/lib/foreman_inventory_upload/generators/tags.rb:14:in `generate'
/usr/share/gems/gems/foreman_rh_cloud-7.0.45/lib/foreman_inventory_upload/generators/slice.rb:75:in `block (2 levels) in report_host'
/usr/share/gems/gems/foreman_rh_cloud-7.0.45/lib/foreman_inventory_upload/generators/json_stream.rb:11:in `array'
/usr/share/gems/gems/foreman_rh_cloud-7.0.45/lib/foreman_inventory_upload/generators/json_stream.rb:40:in `array_field'
/usr/share/gems/gems/foreman_rh_cloud-7.0.45/lib/foreman_inventory_upload/generators/slice.rb:67:in `block in report_host'
/usr/share/gems/gems/foreman_rh_cloud-7.0.45/lib/foreman_inventory_upload/generators/json_stream.rb:17:in `object'
/usr/share/gems/gems/foreman_rh_cloud-7.0.45/lib/foreman_inventory_upload/generators/slice.rb:45:in `report_host'
/usr/share/gems/gems/foreman_rh_cloud-7.0.45/lib/foreman_inventory_upload/generators/slice.rb:34:in `block (3 levels) in report_slice'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/relation/delegation.rb:88:in `each'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/relation/delegation.rb:88:in `each'
/usr/share/gems/gems/foreman_rh_cloud-7.0.45/lib/foreman_inventory_upload/generators/slice.rb:31:in `block (2 levels) in report_slice'
/usr/share/gems/gems/foreman_rh_cloud-7.0.45/lib/foreman_inventory_upload/generators/json_stream.rb:11:in `array'
/usr/share/gems/gems/foreman_rh_cloud-7.0.45/lib/foreman_inventory_upload/generators/json_stream.rb:40:in `array_field'
/usr/share/gems/gems/foreman_rh_cloud-7.0.45/lib/foreman_inventory_upload/generators/slice.rb:29:in `block in report_slice'
/usr/share/gems/gems/foreman_rh_cloud-7.0.45/lib/foreman_inventory_upload/generators/json_stream.rb:17:in `object'
/usr/share/gems/gems/foreman_rh_cloud-7.0.45/lib/foreman_inventory_upload/generators/slice.rb:27:in `report_slice'
/usr/share/gems/gems/foreman_rh_cloud-7.0.45/lib/foreman_inventory_upload/generators/slice.rb:20:in `render'
/usr/share/gems/gems/foreman_rh_cloud-7.0.45/lib/foreman_inventory_upload/generators/archived_report.rb:49:in `block in generate_slice'
/usr/share/gems/gems/foreman_rh_cloud-7.0.45/lib/foreman_inventory_upload/generators/archived_report.rb:47:in `open'
/usr/share/gems/gems/foreman_rh_cloud-7.0.45/lib/foreman_inventory_upload/generators/archived_report.rb:47:in `generate_slice'
/usr/share/gems/gems/foreman_rh_cloud-7.0.45/lib/foreman_inventory_upload/generators/archived_report.rb:20:in `block (4 levels) in render'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/relation/batches/batch_enumerator.rb:80:in `block in each'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/relation/batches.rb:245:in `block in in_batches'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/relation/batches.rb:229:in `loop'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/relation/batches.rb:229:in `in_batches'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/relation/batches/batch_enumerator.rb:80:in `each'
/usr/share/gems/gems/activerecord-6.1.7.3/lib/active_record/relation/batches/batch_enumerator.rb:80:in `each'
/usr/share/gems/gems/foreman_rh_cloud-7.0.45/lib/foreman_inventory_upload/generators/archived_report.rb:17:in `block (3 levels) in render'
/usr/share/gems/gems/foreman_rh_cloud-7.0.45/lib/foreman_inventory_upload/generators/metadata.rb:33:in `block (2 levels) in render_report'
/usr/share/gems/gems/foreman_rh_cloud-7.0.45/lib/foreman_inventory_upload/generators/json_stream.rb:17:in `object'
/usr/share/gems/gems/foreman_rh_cloud-7.0.45/lib/foreman_inventory_upload/generators/json_stream.rb:56:in `object_field'
/usr/share/gems/gems/foreman_rh_cloud-7.0.45/lib/foreman_inventory_upload/generators/metadata.rb:32:in `block in render_report'
/usr/share/gems/gems/foreman_rh_cloud-7.0.45/lib/foreman_inventory_upload/generators/json_stream.rb:17:in `object'
/usr/share/gems/gems/foreman_rh_cloud-7.0.45/lib/foreman_inventory_upload/generators/metadata.rb:27:in `render_report'
/usr/share/gems/gems/foreman_rh_cloud-7.0.45/lib/foreman_inventory_upload/generators/metadata.rb:17:in `render'
/usr/share/gems/gems/foreman_rh_cloud-7.0.45/lib/foreman_inventory_upload/generators/archived_report.rb:15:in `block (2 levels) in render'
/usr/share/gems/gems/foreman_rh_cloud-7.0.45/lib/foreman_inventory_upload/generators/archived_report.rb:13:in `open'
/usr/share/gems/gems/foreman_rh_cloud-7.0.45/lib/foreman_inventory_upload/generators/archived_report.rb:13:in `block in render'
/usr/share/gems/gems/foreman_rh_cloud-7.0.45/lib/foreman_inventory_upload/generators/archived_report.rb:10:in `render'
/usr/share/gems/gems/foreman_rh_cloud-7.0.45/lib/tasks/rh_cloud_inventory.rake:40:in `block (5 levels) in <top (required)>'
/usr/share/gems/gems/foreman_rh_cloud-7.0.45/lib/tasks/rh_cloud_inventory.rake:37:in `each'
/usr/share/gems/gems/foreman_rh_cloud-7.0.45/lib/tasks/rh_cloud_inventory.rake:37:in `block (4 levels) in <top (required)>'
/usr/share/foreman/app/models/concerns/foreman/thread_session.rb:108:in `as'
/usr/share/foreman/app/models/concerns/foreman/thread_session.rb:114:in `as_anonymous_admin'
/usr/share/gems/gems/foreman_rh_cloud-7.0.45/lib/tasks/rh_cloud_inventory.rake:36:in `block (3 levels) in <top (required)>'
/usr/share/gems/gems/rake-13.0.1/exe/rake:27:in `<top (required)>'
Tasks: TOP => rh_cloud_inventory:report:generate
(See full trace by running task with --trace)