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.
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
~~~
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 (Important: Satellite 6.12 Release), 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-2022:8506
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 ~~~