Bug #18113
closedParameter foreman-proxy-dhcp-range invalid: false is not a valid string
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"
- 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
- 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)
- 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"
Files
Updated by James Perry about 8 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.
Updated by James Perry about 8 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.
Updated by Dominic Cleal about 8 years ago
- Project changed from Foreman to Installer
- Category set to Foreman modules
- Translation missing: en.field_release set to 210
Updated by Dominic Cleal about 8 years ago
- Status changed from New to Assigned
- Assignee set to Dominic Cleal
Updated by The Foreman Bot about 8 years ago
- Status changed from Assigned to Ready For Testing
- Pull request https://github.com/theforeman/foreman-installer/pull/218 added
Updated by Dominic Cleal about 8 years ago
- Status changed from Ready For Testing to Closed
- % Done changed from 0 to 100
Applied in changeset 08bb5091c7b41e2d062b779054d9a7c9d2dd239d.