Bug 2029828
| Summary: | TFTP Storage check fails on undefined method `[]' for nil:NilClass | ||
|---|---|---|---|
| Product: | Red Hat Satellite | Reporter: | Evgeni Golov <egolov> |
| Component: | Satellite Maintain | Assignee: | Evgeni Golov <egolov> |
| Status: | CLOSED ERRATA | QA Contact: | Gaurav Talreja <gtalreja> |
| Severity: | high | Docs Contact: | |
| Priority: | unspecified | ||
| Version: | 6.11.0 | CC: | apatel, aupadhye, kgaikwad, pcreech, vsedmik |
| Target Milestone: | 6.11.0 | Keywords: | Triaged |
| Target Release: | Unused | ||
| Hardware: | Unspecified | ||
| OS: | Unspecified | ||
| Whiteboard: | |||
| Fixed In Version: | rubygem-foreman_maintain-1.0.1 | Doc Type: | If docs needed, set a value |
| Doc Text: | Story Points: | --- | |
| Clone Of: | Environment: | ||
| Last Closed: | 2022-07-05 14:30:51 UTC | Type: | Bug |
| Regression: | --- | Mount Type: | --- |
| Documentation: | --- | CRM: | |
| Verified Versions: | Category: | --- | |
| oVirt Team: | --- | RHEL 7.3 requirements from Atomic Host: | |
| Cloudforms Team: | --- | Target Upstream Version: | |
| Embargoed: | |||
|
Description
Evgeni Golov
2021-12-07 12:03:37 UTC
oooh, this is different
the error happens for *any* call of `foreman-maintain` with `--only` ?!
# foreman-maintain service restart --only foreman
undefined method `[]' for nil:NilClass
# foreman-maintain service start --only foreman
undefined method `[]' for nil:NilClass
seems to affect start/stop/restart, status is fine:
# foreman-maintain service status --only foreman
Running Status Services
================================================================================
Get status of applicable services:
Displaying the following service(s):
foreman
| displaying foreman
● foreman.service - Foreman
Loaded: loaded (/usr/lib/systemd/system/foreman.service; enabled; vendor preset: disabled)
Drop-In: /etc/systemd/system/foreman.service.d
└─installer.conf
# foreman-maintain service status --only puppetserver
Running Status Services
================================================================================
Get status of applicable services:
Displaying the following service(s): [FAIL]
No service found matching your parameter 'puppetserver'
okay, the error is somewhere completely else, it just gets bubbled up here.
the problem is in ./definitions/checks/foreman_proxy/check_tftp_storage.rb:
def self.lookup_token_duration
data = feature(:foreman_database). \
query("select s.value, s.default from settings s \
where category = 'Setting::Provisioning' and name = 'token_duration'")
YAML.load(data[0]['value'] || data[0]['default'])
end
but `data` is `[]`, so `data[0]` is nil and `nil['value']` gets you the nice error
Created redmine issue https://projects.theforeman.org/issues/34100 from this bug Verified. Tested on Satellite 7.0 Snap 10.0 for both EL7 and EL8 installations Version: rubygem-foreman_maintain-1.0.3-1.el8sat.noarch Steps: 1. foreman-maintain service stop --only foreman 2. foreman-maintain service start --only foreman 3. foreman-maintain service status --only foreman 4. foreman-maintain service restart --only foreman Observation: foreman-maintain service stop/start/status/restart works fine with --only option with no errors 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 |