Project

General

Profile

Bug #18113

Parameter foreman-proxy-dhcp-range invalid: false is not a valid string

Added by James Perry over 2 years ago. Updated 10 months ago.

Status:
Closed
Priority:
Normal
Assignee:
Category:
Foreman modules
Target version:
Difficulty:
Triaged:
Bugzilla link:
Team Backlog:
Fixed in Releases:
Found in Releases:

Description

I am in the process of upgrading from Foreman 1.13.2 to 1.14. When I ran foreman-installer --verbose (Step 3C) it gave the error:

Parameter foreman-proxy-dhcp-range invalid: false is not a valid string

[ INFO 2017-01-17 12:04:30 verbose] Executing hooks in group pre_migrations
[ INFO 2017-01-17 12:04:30 verbose] All hooks in group pre_migrations finished
[ INFO 2017-01-17 12:04:30 verbose] Executing hooks in group boot
[ INFO 2017-01-17 12:04:30 verbose] All hooks in group boot finished
[ INFO 2017-01-17 12:04:30 verbose] Executing hooks in group init
[ INFO 2017-01-17 12:04:30 verbose] All hooks in group init finished
[ INFO 2017-01-17 12:04:30 verbose] Loading default values from puppet modules...
[ INFO 2017-01-17 12:04:30 verbose] ... finished
[ INFO 2017-01-17 12:04:30 verbose] Executing hooks in group pre_values
[ INFO 2017-01-17 12:04:30 verbose] All hooks in group pre_values finished
[ INFO 2017-01-17 12:04:30 verbose] Executing hooks in group pre_validations
[ INFO 2017-01-17 12:04:30 verbose] All hooks in group pre_validations finished
[ INFO 2017-01-17 12:04:30 verbose] Running validation checks
*[ERROR 2017-01-17 12:04:30 verbose] Parameter foreman-proxy-dhcp-range invalid: false is not a valid string *

Running foreman-installer --help and looking for foreman-proxy-dhcp-range notes the default is "false"

  1. foreman-installer --help | grep dhcp-range
    --foreman-proxy-dhcp-range Space-separated DHCP pool range (default: false)

Attached run of "foreman-installer --verbose -l debug"


In the /usr/share/foreman-installer/modules/foreman_proxy/CHANGELOG.md there is a reference for 5.0.0 that says

  • Fix dhcp_range default to be undef

Further checking / testing found that this error occurs when:
1. Run with no options --> # foreman-installer

  1. foreman-installer
    Parameter foreman-proxy-dhcp-range invalid: false is not a valid string
    Error during configuration, exiting

2. Run with --verbose, --foreman-prox-dhcp-range (with no setting)

  1. foreman-installer --noop --verbose --foreman-proxy-dhcp-range
    [ INFO 2017-01-17 12:37:30 verbose] Executing hooks in group pre_migrations
    ...
    [ INFO 2017-01-17 12:37:30 verbose] Running validation checks
    [ERROR 2017-01-17 12:37:30 verbose] Parameter foreman-proxy-dhcp-range invalid: false is not a valid string
    Error during configuration, exiting

The error clears and runs if run with foreman-installer --noop --foreman-proxy-dhcp-range "", foreman-installer --noop --foreman-proxy-dhcp-range=undef, foreman-installer --noop --foreman-proxy-dhcp-range=false

I'm not familiar enough with the underlying foreman-installer code to track down where the foreman_proxy::params::dhcp_range value is evaluating the foreman-proxy-dhcp-range to be determine that false is not a valid string.

What I did find is that in the following files I found a reference to dhcp_range.

/usr/share/foreman-installer/modules/foreman_proxy/manifests/init.pp
$dhcp_range = $foreman_proxy::params::dhcp_range

/usr/share/foreman-installer/modules/foreman_proxy/manifests/params.pp
$dhcp_range = undef

usr/share/foreman-installer/modules/foreman_proxy/manifests/proxydhcp.pp
range => $foreman_proxy::dhcp_range

/usr/share/foreman-installer/parser_cache/foreman.yaml
dhcp_range: "foreman_proxy::params::dhcp_range"

foreman-installer-debug.txt foreman-installer-debug.txt 31.3 KB James Perry, 01/17/2017 12:19 PM

Associated revisions

Revision 08bb5091 (diff)
Added by Dominic Cleal over 2 years ago

fixes #18113 - change dhcp_range from false to undef

The module permits `Optional[String]` for this parameter, so it's
preferred to use undef/nil instead of false to disable it.

History

#1 Updated by James Perry over 2 years ago

  • Category set to DHCP

#2 Updated by James Perry over 2 years ago

  • Category deleted (DHCP)

#3 Updated by James Perry over 2 years ago

Just and FYI. The host is not setup to do DHCP or provision any bare metal or VMs at this time. Not sure if it matters in this respect, but wanted to ensure it was noted.

#4 Updated by James Perry over 2 years ago

When I hard set --foreman-proxy-dhcp-range="false" the next time foreman-installer was run the error didn't re-appear.

It seems that there needs to be an additional check to see if the value is set, even if incorrectly. The added =undef value didn't seem to propagate correctly through or into the desired file.

I have a foreman-answers from 10/31/2016 that has dhcp_range: false set, so it has been there since I updated to 13.2.

#5 Updated by Dominic Cleal over 2 years ago

  • Project changed from Foreman to Installer
  • Category set to Foreman modules
  • Legacy Backlogs Release (now unused) set to 210

#6 Updated by Dominic Cleal over 2 years ago

  • Status changed from New to Assigned
  • Assignee set to Dominic Cleal

#7 Updated by The Foreman Bot over 2 years ago

  • Status changed from Assigned to Ready For Testing
  • Pull request https://github.com/theforeman/foreman-installer/pull/218 added

#8 Updated by Dominic Cleal over 2 years ago

  • Status changed from Ready For Testing to Closed
  • % Done changed from 0 to 100

Also available in: Atom PDF