+++ This bug was initially created as a clone of Bug #2110163 +++ Description of problem: After upgrading to Satellite 6.11, the Generate All Reports Job action fails in the Plan stage with "NameError (undefined local variable or method `logger'": ~~~ "ForemanTasks.async_task(ForemanInventoryUpload::Async::GenerateAllReportsJob)" | foreman-rake console Loading production environment (Rails 6.0.4.7) Switch to inspect mode. ForemanTasks.async_task(ForemanInventoryUpload::Async::GenerateAllReportsJob) Traceback (most recent call last): 16: from foreman-tasks (5.2.3) lib/foreman_tasks.rb:26:in `block in trigger_task' 15: from foreman-tasks (5.2.3) lib/foreman_tasks.rb:20:in `trigger' 14: from foreman-tasks (5.2.3) app/lib/actions/middleware/keep_current_user.rb:9:in `plan' 13: from foreman-tasks (5.2.3) app/lib/actions/middleware/keep_current_user.rb:41:in `with_current_user' 12: from foreman-tasks (5.2.3) app/lib/actions/middleware/keep_current_user.rb:10:in `block in plan' 11: from foreman-tasks (5.2.3) app/lib/actions/middleware/keep_current_taxonomies.rb:9:in `plan' 10: from foreman-tasks (5.2.3) app/lib/actions/middleware/keep_current_taxonomies.rb:30:in `with_current_taxonomies' 9: from foreman-tasks (5.2.3) app/lib/actions/middleware/keep_current_taxonomies.rb:10:in `block in plan' 8: from foreman-tasks (5.2.3) app/lib/actions/middleware/keep_current_timezone.rb:9:in `plan' 7: from foreman-tasks (5.2.3) app/lib/actions/middleware/keep_current_timezone.rb:31:in `with_current_timezone' 6: from foreman-tasks (5.2.3) app/lib/actions/middleware/keep_current_timezone.rb:10:in `block in plan' 5: from foreman-tasks (5.2.3) app/lib/actions/middleware/keep_current_request_id.rb:9:in `plan' 4: from foreman-tasks (5.2.3) app/lib/actions/middleware/keep_current_request_id.rb:34:in `with_current_request_id' 3: from foreman-tasks (5.2.3) app/lib/actions/middleware/keep_current_request_id.rb:10:in `block in plan' 2: from foreman-tasks (5.2.3) app/lib/actions/middleware/load_setting_values.rb:15:in `plan' 1: from foreman_rh_cloud (5.0.39) lib/foreman_inventory_upload/async/generate_all_reports_job.rb:13:in `plan' NameError (undefined local variable or method `logger' for #<ForemanInventoryUpload::Async::GenerateAllReportsJob:0x00000000152a44e0>) ~~~ Version-Release number of selected component (if applicable): Satellite 6.11 How reproducible: Noticed this issue on Upgraded Satellite servers (new installs don't seem to hit this issue out of the box). However, with a new install of 6.11, we can trigger this stack trace by changing the ":allow_auto_inventory_upload" setting to "No". Steps to Reproduce: 1. Navigate to Administer => Settings, RH Cloud and changed the "Automatic inventory upload" to "No" 2. Run this rake command: "ForemanTasks.async_task(ForemanInventoryUpload::Async::GenerateAllReportsJob)" | foreman-rake console Actual results: Rake command fails with "NameError (undefined local variable or method `logger' for #<ForemanInventoryUpload::Async::GenerateAllReportsJob:0x00000000152a44e0>)" Expected results: Task should not fail with this error. Additional info: If we prepend the "GenerateAllReportsJob" class with this line, the error is no longer seen: ~~~ logger = Rails.logger ~~~ --- Additional comment from on 2022-07-28T15:52:11Z Moving to POST as PR merged.
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 (Satellite 6.11.2 Async Bug Fix Update), 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/RHBA-2022:6233