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 2079357 - foreman-maintain maintenance-mode status command fails with `undefined method `maintenance_mode_status?' for nil:NilClass`
Summary: foreman-maintain maintenance-mode status command fails with `undefined method...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Satellite Maintain
Version: 6.11.0
Hardware: Unspecified
OS: Unspecified
unspecified
medium
Target Milestone: 6.11.0
Assignee: Amit Upadhye
QA Contact: sganar
URL:
Whiteboard:
Depends On:
Blocks: 1693733 2040650
TreeView+ depends on / blocked
 
Reported: 2022-04-27 12:46 UTC by sganar
Modified: 2022-07-05 14:35 UTC (History)
5 users (show)

Fixed In Version: rubygem-foreman_maintain-1.0.9
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2022-07-05 14:35:13 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Red Hat Product Errata RHSA-2022:5498 0 None None None 2022-07-05 14:35:34 UTC

Description sganar 2022-04-27 12:46:46 UTC
Description of problem:
foreman-maintain maintenance-mode status command fails with `undefined method `maintenance_mode_status?' for nil:NilClass`

Version-Release number of selected component (if applicable):
Satellite 6.11.0 snap 17.0
rubygem-foreman_maintain-1.0.6-1.el7sat.noarch

How reproducible:
Always

Steps to Reproduce:
1. # foreman-maintain maintenance-mode status
2.
3.

Actual results:
fails with `undefined method `maintenance_mode_status?' for nil:NilClass`

Expected results:
command should pass

Additional info:

Comment 1 sganar 2022-04-29 08:40:26 UTC
Same is the error for command 
# foreman-maintain maintenance-mode is-enabled

Comment 2 Amit Upadhye 2022-05-02 16:01:12 UTC
Hello,

I don't see this happening with version 1.0.8, can you provide the foreman-maintain.logs or reproduce with latest version?

on el7

# foreman-maintain maintenance-mode status
Running Status of maintenance-mode
================================================================================
Check of maintenance-mode consistency: 
/ Running status of maintenance-mode                                            

Status of maintenance-mode: Off
- Iptables chain: absent
- sync plans: empty data
- cron jobs: not managed                                              [OK]
--------------------------------------------------------------------------------

[root@sat691 ~]# foreman-maintain maintenance-mode is-enabled
Running Show only status code of maintenance-mode
================================================================================
Showing status code for maintenance_mode: 
Maintenance mode is Off                                               [OK]
--------------------------------------------------------------------------------

1

on el8

# foreman-maintain maintenance-mode status
Running Status of maintenance-mode
================================================================================
Check of maintenance-mode consistency: 
/ Running status of maintenance-mode                                            

Status of maintenance-mode: Off
- Nftables table: absent
- sync plans: empty data
- cron jobs: not managed                                              [OK]
--------------------------------------------------------------------------------

[root@rhel8 ~]# foreman-maintain maintenance-mode is-enabled
Running Show only status code of maintenance-mode
================================================================================
Showing status code for maintenance_mode: 
Maintenance mode is Off                                               [OK]
--------------------------------------------------------------------------------

1

Comment 4 sganar 2022-05-25 08:13:37 UTC
Verified.

Tested on Satellite 6.11.0 Snap 21.0
rubygem-foreman_maintain-1.0.10-1.el8sat.noarch

Steps followed: 
1. # foreman-maintain maintenance-mode status
2. # foreman-maintain maintenance-mode is-enabled

Observation: 
No error, commands work fine

Comment 7 errata-xmlrpc 2022-07-05 14:35:13 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 (Moderate: Satellite 6.11 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:5498


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