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.
Bug 2110163 - Generate All Reports Job Fails After Upgrade to 6.11 with Missing Logger Method
Summary: Generate All Reports Job Fails After Upgrade to 6.11 with Missing Logger Method
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: RH Cloud - Inventory
Version: 6.11.0
Hardware: Unspecified
OS: Unspecified
high
medium
Target Milestone: 6.12.0
Assignee: Shimon Shtein
QA Contact: addubey
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2022-07-24 05:05 UTC by myoder
Modified: 2023-04-21 13:18 UTC (History)
10 users (show)

Fixed In Version: 6.0.42
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
: 2112385 (view as bug list)
Environment:
Last Closed: 2022-11-16 13:34:44 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github theforeman foreman_rh_cloud pull 755 0 None Merged Add missing logger statement for GenerateAllReportsJob 2022-08-31 11:14:59 UTC
Red Hat Issue Tracker SAT-12385 0 None None None 2022-08-23 07:54:30 UTC
Red Hat Product Errata RHSA-2022:8506 0 None None None 2022-11-16 13:35:05 UTC

Description myoder 2022-07-24 05:05:04 UTC
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
~~~

Comment 1 Brad Buckingham 2022-07-28 15:52:11 UTC
Moving to POST as PR merged.

Comment 6 Charles Slivkoff 2022-09-01 15:51:56 UTC
Is 2112385 a duplicate?

Are both issues resolved in RHBA-2022:6233?

Comment 12 errata-xmlrpc 2022-11-16 13:34:44 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 (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


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