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 1506107 - Check for verifying syntax for ISP DHCP configurations failed with error undefined method `strip' for nil:NilClass
Summary: Check for verifying syntax for ISP DHCP configurations failed with error unde...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Red Hat Satellite
Classification: Red Hat
Component: Satellite Maintain
Version: 6.3.0
Hardware: Unspecified
OS: Unspecified
urgent
high with 1 vote
Target Milestone: Unspecified
Assignee: Kavita
QA Contact: Nikhil Kathole
URL:
Whiteboard:
: 1506106 (view as bug list)
Depends On:
Blocks: 1496794
TreeView+ depends on / blocked
 
Reported: 2017-10-25 07:16 UTC by Nikhil Kathole
Modified: 2021-12-10 15:21 UTC (History)
15 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2018-04-04 14:02:54 UTC
Target Upstream Version:
Embargoed:


Attachments (Terms of Use)
log in foreman-maintain.log file (5.17 KB, text/plain)
2017-10-25 07:16 UTC, Nikhil Kathole
no flags Details


Links
System ID Private Priority Status Summary Last Updated
Foreman Issue Tracker 22663 0 Normal Closed Check for verifying syntax for ISP DHCP configurations failed with error undefined method `strip' for nil:NilClass 2020-10-28 09:22:13 UTC
Red Hat Knowledge Base (Solution) 3361021 0 None None None 2018-02-22 09:50:15 UTC
Red Hat Product Errata RHBA-2018:0633 0 None None None 2018-04-04 14:03:22 UTC

Description Nikhil Kathole 2017-10-25 07:16:27 UTC
Created attachment 1343109 [details]
log in foreman-maintain.log file

Description of problem: When katello-services are stopped and Check for verifying syntax for ISP DHCP configuration is performed, it fails with error showing undefined method `strip' for nil:NilClass.

Version-Release number of selected component (if applicable): foreman-maintain snap 3

 # rpm -q rubygem-foreman_maintain
rubygem-foreman_maintain-0.0.10-1.el7sat.noarch

How reproducible: always


Steps to Reproduce:
1. katello-service stop
2. foreman-maintain health check --label foreman-proxy-verify-dhcp-config-syntax
Running ForemanMaintain::Scenario::FilteredScenario
================================================================================
Check for verifying syntax for ISP DHCP configurations:               [FAIL]
undefined method `strip' for nil:NilClass
--------------------------------------------------------------------------------
Scenario [ForemanMaintain::Scenario::FilteredScenario] failed.

The following steps ended up in failing state:

  [foreman-proxy-verify-dhcp-config-syntax]

Resolve the failed steps and rerun
the command. In case the failures are false positives,
use --whitelist="foreman-proxy-verify-dhcp-config-syntax"

Actual results:
Displayed error undefined method `strip' for nil:NilClass

Expected results: Error should get handled.


Additional info: When katello-services are stopped and user performed check for verifying syntax for ISP DHCP configuration, can we add interaction for user like hammer-ping?

Continue with step [katello-service restart]?, [y(yes), n(no), q(quit)]

Comment 1 Nikhil Kathole 2017-10-25 07:59:29 UTC
*** Bug 1506106 has been marked as a duplicate of this bug. ***

Comment 4 Anurag Patel 2017-10-26 08:13:40 UTC
Hello Nikhil,

To debug this further could you please let know if you're able to ping your hostname?

$ ping $(hostname)

Comment 5 Nikhil Kathole 2017-10-26 09:13:58 UTC
Hi,

Yes, I am able to ping host.

Comment 6 Anurag Patel 2017-11-03 19:58:46 UTC
This fix has just been merged upstream. It should be available in foreman-maintain 0.0.11.

Comment 7 Nikhil Kathole 2017-12-15 11:00:27 UTC
VERIFIED

Version Tested:
# rpm -q rubygem-foreman_maintain
rubygem-foreman_maintain-0.1.1-1.el7sat.noarch


# foreman-maintain advanced procedure run katello-service-stop
Running ForemanMaintain::Scenario
================================================================================
katello-service stop:
\ No katello service running                                          [OK]
--------------------------------------------------------------------------------

# foreman-maintain health check --label foreman-proxy-verify-dhcp-config-syntax
Running ForemanMaintain::Scenario::FilteredScenario
================================================================================
Check for verifying syntax for ISP DHCP configurations:
No valid HTTP response (Connection failed) 0. Response: ""
              [FAIL]
Please check and verify DHCP configurations.
--------------------------------------------------------------------------------
Scenario [ForemanMaintain::Scenario::FilteredScenario] failed.

The following steps ended up in failing state:

  [foreman-proxy-verify-dhcp-config-syntax]

Resolve the failed steps and rerun
the command. In case the failures are false positives,
use --whitelist="foreman-proxy-verify-dhcp-config-syntax"

Comment 9 Nikhil Kathole 2018-02-08 12:50:05 UTC
Moving this to assigned.

Comment 11 Sijo Jose 2018-02-22 08:20:24 UTC
# rpm -qa |grep -i rubygem-foreman_maintain
rubygem-foreman_maintain-0.1.3-1.el7sat.noarch


I have same issue with 0.1.3 version as well.



D, [2018-02-22 18:06:47+1100 #22908] DEBUG -- : Running command which passenger-recycler with stdin nil
D, [2018-02-22 18:06:47+1100 #22908] DEBUG -- : output of the command:
 /usr/bin/passenger-recycler
I, [2018-02-22 18:06:47+1100 #22908]  INFO -- : Running foreman-maintain command with arguments [["upgrade", "check", "--target-version", "6.3"]]
D, [2018-02-22 18:06:47+1100 #22908] DEBUG -- : Running command rpm -q 'satellite' --queryformat="%{VERSION}" with stdin nil
D, [2018-02-22 18:06:47+1100 #22908] DEBUG -- : output of the command:
 6.2.14
D, [2018-02-22 18:06:47+1100 #22908] DEBUG -- : Running command /usr/share/candlepin/cpdb --help |  grep -c '\-\-validate ' with stdin nil
D, [2018-02-22 18:06:47+1100 #22908] DEBUG -- : output of the command:
 1
D, [2018-02-22 18:06:47+1100 #22908] DEBUG -- : Running command LANG=en_US.utf-8 hammer -c "/etc/foreman-maintain/foreman-maintain-hammer.yml" --interactive=no architecture list with stdin nil
D, [2018-02-22 18:06:49+1100 #22908] DEBUG -- : output of the command:
 ---|-------
ID | NAME
---|-------
1  | x86_64
2  | i386
---|-------
D, [2018-02-22 18:06:49+1100 #22908] DEBUG -- : Running command rpm -q 'hdparm' --queryformat="%{VERSION}" with stdin nil
D, [2018-02-22 18:06:49+1100 #22908] DEBUG -- : output of the command:
 9.43
D, [2018-02-22 18:06:49+1100 #22908] DEBUG -- : Running command rpm -q 'fio' --queryformat="%{VERSION}" with stdin nil
D, [2018-02-22 18:06:49+1100 #22908] DEBUG -- : output of the command:
 3.1
D, [2018-02-22 18:06:49+1100 #22908] DEBUG -- : Running command curl -w '
%{http_code}' --silent -ks --cert /etc/foreman/client_cert.pem       --key /etc/foreman/client_key.pem       --cacert /etc/foreman/proxy_ca.pem https://$(hostname):9090/dhcp with stdin nil
D, [2018-02-22 18:06:49+1100 #22908] DEBUG -- : output of the command:
 Requested url was not found
404
E, [2018-02-22 18:06:49+1100 #22908] ERROR -- : undefined method `strip' for nil:NilClass (NoMethodError)
/usr/share/gems/gems/foreman_maintain-0.1.3/definitions/features/foreman_proxy.rb:37:in `find_http_error_msg'
/usr/share/gems/gems/foreman_maintain-0.1.3/definitions/features/foreman_proxy.rb:50:in `run_dhcp_curl'
/usr/share/gems/gems/foreman_maintain-0.1.3/definitions/features/foreman_proxy.rb:55:in `dhcp_req_pass?'
/usr/share/gems/gems/foreman_maintain-0.1.3/definitions/features/foreman_proxy.rb:17:in `valid_dhcp_configs?'
/usr/share/gems/gems/foreman_maintain-0.1.3/definitions/checks/foreman_proxy/verify_dhcp_config_syntax.rb:13:in `run'
/usr/share/gems/gems/foreman_maintain-0.1.3/lib/foreman_maintain/executable.rb:119:in `__run__'
/usr/share/gems/gems/foreman_maintain-0.1.3/lib/foreman_maintain/check.rb:40:in `__run__'

Comment 12 Sijo Jose 2018-02-22 10:08:08 UTC
I have already tried with that option but I got below error while satellite-installer started.

I will do a fresh upgrade again and update.

Parameter foreman-proxy-dns-managed invalid: "false--foreman-proxy-dhcp-managed=false" is not a valid boolean

Comment 13 Sijo Jose 2018-02-22 11:33:11 UTC
I got different error with solution mentioned in 3361021 "foreman-maintain upgrade run --target-version 6.3  --whitelist="foreman-proxy-verify-dhcp-config-syntax""







D, [2018-02-22 22:30:05+1100 #9591] DEBUG -- : Running command rpm -q 'satellite-installer' --queryformat="%{VERSION}" with stdin nil
D, [2018-02-22 22:30:05+1100 #9591] DEBUG -- : output of the command:
 6.3.0.12
D, [2018-02-22 22:30:05+1100 #9591] DEBUG -- : Running command satellite-installer --upgrade with stdin nil
D, [2018-02-22 22:30:11+1100 #9591] DEBUG -- : output of the command:
 Script started on Thu 22 Feb 2018 22:30:05 AEDT
Parameter foreman-proxy-dns-managed invalid: "false--foreman-proxy-dhcp-managed=false" is not a valid boolean
Error during configuration, exiting

E, [2018-02-22 22:30:11+1100 #9591] ERROR -- : Failed executing satellite-installer --upgrade, exit status 21 (ForemanMaintain::Error::ExecutionError)
/usr/share/gems/gems/foreman_maintain-0.1.3/lib/foreman_maintain/utils/command_runner.rb:50:in `execution_error'
/usr/share/gems/gems/foreman_maintain-0.1.3/lib/foreman_maintain/concerns/system_helpers.rb:53:in `execute!'
/usr/share/gems/gems/foreman_maintain-0.1.3/definitions/procedures/installer/upgrade.rb:4:in `run'
/usr/share/gems/gems/foreman_maintain-0.1.3/lib/foreman_maintain/executable.rb:119:in `__run__'
/usr/share/gems/gems/foreman_maintain-0.1.3/lib/foreman_maintain/runner/execution.rb:76:in `block (2 levels) in run'
/usr/share/gems/gems/foreman_maintain-0.1.3/lib/foreman_maintain/runner/execution.rb:99:in `capture_errors'
/usr/share/gems/gems/foreman_maintain-0.1.3/lib/foreman_maintain/runner/execution.rb:75:in `block in run'
/usr/share/gems/gems/foreman_maintain-0.1.3/lib/foreman_maintain/runner/execution.rb:93:in `with_metadata_calculation'
/usr/share/gems/gems/foreman_maintain-0.1.3/lib/foreman_maintain/runner/execution.rb:74:in `run'
/usr/share/gems/gems/foreman_maintain-0.1.3/lib/foreman_maintain/runner.rb:109:in `run_step'
/usr/share/gems/gems/foreman_maintain-0.1.3/lib/foreman_maintain/runner.rb:98:in `run_steps'
/usr/share/gems/gems/foreman_maintain-0.1.3/lib/foreman_maintain/runner.rb:91:in `execute_scenario_steps'
/usr/share/gems/gems/foreman_maintain-0.1.3/lib/foreman_maintain/runner.rb:45:in `run_scenario'
/usr/share/gems/gems/foreman_maintain-0.1.3/lib/foreman_maintain/upgrade_runner.rb:138:in `block in run_phase'
/usr/share/gems/gems/foreman_maintain-0.1.3/lib/foreman_maintain/upgrade_runner.rb:183:in `with_non_empty_scenario'
/usr/share/gems/gems/foreman_maintain-0.1.3/lib/foreman_maintain/upgrade_runner.rb:134:in `run_phase'
/usr/share/gems/gems/foreman_maintain-0.1.3/lib/foreman_maintain/upgrade_runner.rb:82:in `block in run'
/usr/share/gems/gems/foreman_maintain-0.1.3/lib/foreman_maintain/upgrade_runner.rb:77:in `each'
/usr/share/gems/gems/foreman_maintain-0.1.3/lib/foreman_maintain/upgrade_runner.rb:77:in `run'
/usr/share/gems/gems/foreman_maintain-0.1.3/lib/foreman_maintain/cli/upgrade_command.rb:80:in `execute'
/usr/share/gems/gems/clamp-0.6.2/lib/clamp/command.rb:67:in `run'
/usr/share/gems/gems/clamp-0.6.2/lib/clamp/subcommand/execution.rb:11:in `execute'
/usr/share/gems/gems/clamp-0.6.2/lib/clamp/command.rb:67:in `run'
/usr/share/gems/gems/clamp-0.6.2/lib/clamp/subcommand/execution.rb:11:in `execute'
/usr/share/gems/gems/clamp-0.6.2/lib/clamp/command.rb:67:in `run'
/usr/share/gems/gems/foreman_maintain-0.1.3/lib/foreman_maintain/cli.rb:21:in `run'
/usr/share/gems/gems/clamp-0.6.2/lib/clamp/command.rb:125:in `run'
/usr/share/gems/gems/foreman_maintain-0.1.3/bin/foreman-maintain:12:in `<top (required)>'
/bin/foreman-maintain:23:in `load'
/bin/foreman-maintain:23:in `<main>'
I, [2018-02-22 22:30:11+1100 #9591]  INFO -- : foreman-maintain command finished with

Comment 15 Sijo Jose 2018-02-24 15:48:38 UTC
Ok I understood the issue now. When we run the upgrade check, with it will create an answer file "/etc/foreman-installer/scenarios.d/satellite-answers.yaml"


and when we are giving whitelist for dhcp syntax as mentioned in the solution like,

foreman-maintain upgrade check --target-version 6.3 --whitelist="foreman-proxy-verify-dhcp-config-syntax"


in the answer file the dns-manged is getting wrong option. that means if you check the answer file after the upgrade check with white list option,

the dns-managed entry will be like,

 dns_managed: false--foreman-proxy-dhcp-managed=faError


I changed it to 

dns_managed: true

and ran the upgrade, it is looking good.

Comment 16 Kavita 2018-03-01 06:51:43 UTC
Hi Sijo Jose,

As Amit mentioned, currently we are not passing any parameter to command satellite-installer --upgrade. 
There is no relation between whitelist option & answer file. 

could you please confirm whether you tried to run installer --upgrade manually i.e not through foreman-maintain?

If you are still facing this issue, I would suggest to create different BZ & attach log files so that easy to debug further on an issue.

(In reply to Sijo Jose from comment #15)
> Ok I understood the issue now. When we run the upgrade check, with it will
> create an answer file
> "/etc/foreman-installer/scenarios.d/satellite-answers.yaml"
> 
> 
> and when we are giving whitelist for dhcp syntax as mentioned in the
> solution like,
> 
> foreman-maintain upgrade check --target-version 6.3
> --whitelist="foreman-proxy-verify-dhcp-config-syntax"
> 
> 
> in the answer file the dns-manged is getting wrong option. that means if you
> check the answer file after the upgrade check with white list option,
> 
> the dns-managed entry will be like,
> 
>  dns_managed: false--foreman-proxy-dhcp-managed=faError
> 
> 
> I changed it to 
> 
> dns_managed: true
> 
> and ran the upgrade, it is looking good.

Comment 18 Satellite Program 2018-03-01 07:29:11 UTC
Upstream bug assigned to kgaikwad

Comment 19 Sijo Jose 2018-03-01 12:11:13 UTC
(In reply to Kavita from comment #16)
> Hi Sijo Jose,
> 
> As Amit mentioned, currently we are not passing any parameter to command
> satellite-installer --upgrade. 
> There is no relation between whitelist option & answer file. 
> 
> could you please confirm whether you tried to run installer --upgrade
> manually i.e not through foreman-maintain?
> 
> If you are still facing this issue, I would suggest to create different BZ &
> attach log files so that easy to debug further on an issue.
> 
> (In reply to Sijo Jose from comment #15)
> > Ok I understood the issue now. When we run the upgrade check, with it will
> > create an answer file
> > "/etc/foreman-installer/scenarios.d/satellite-answers.yaml"
> > 
> > 
> > and when we are giving whitelist for dhcp syntax as mentioned in the
> > solution like,
> > 
> > foreman-maintain upgrade check --target-version 6.3
> > --whitelist="foreman-proxy-verify-dhcp-config-syntax"
> > 
> > 
> > in the answer file the dns-manged is getting wrong option. that means if you
> > check the answer file after the upgrade check with white list option,
> > 
> > the dns-managed entry will be like,
> > 
> >  dns_managed: false--foreman-proxy-dhcp-managed=faError
> > 
> > 
> > I changed it to 
> > 
> > dns_managed: true
> > 
> > and ran the upgrade, it is looking good.

Sure, I will create another BZ if I face the issue again.

Comment 20 Nikhil Kathole 2018-03-26 10:21:56 UTC
VERIFIED

Version tested:

# rpm -qa | grep maintain
rubygem-foreman_maintain-0.1.5-1.el7sat.noarch

Running Checks before upgrading to Satellite 6.3
================================================================================
Check for verifying syntax for ISP DHCP configurations:               [OK]
--------------------------------------------------------------------------------

Running Checks before upgrading to Satellite 6.2
================================================================================
Check for verifying syntax for ISP DHCP configurations:               [OK]
--------------------------------------------------------------------------------

Running Checks before upgrading to Satellite 6.3.z
================================================================================
Check for verifying syntax for ISP DHCP configurations:               [OK]
--------------------------------------------------------------------------------

When services are down 

Running Checks before upgrading to Satellite 6.3.z
================================================================================
Check for verifying syntax for ISP DHCP configurations:
No valid HTTP response (Connection failed) 0. Response: ""
              [FAIL]
Please check and verify DHCP configurations.
--------------------------------------------------------------------------------

Comment 23 errata-xmlrpc 2018-04-04 14:02:54 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, 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-2018:0633


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