Bug 1477490 - Unfriendly error message when installing dhcp on interface without IP address: installer fails with pick(): must receive at least one non empty" in the logs
Unfriendly error message when installing dhcp on interface without IP address...
Status: CLOSED ERRATA
Product: Red Hat Satellite 6
Classification: Red Hat
Component: Installer (Show other bugs)
6.3.0
Unspecified Unspecified
unspecified Severity medium (vote)
: GA
: --
Assigned To: Chris Roberts
Sachin Ghai
http://projects.theforeman.org/issues...
: Triaged
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2017-08-02 05:03 EDT by Ivan Necas
Modified: 2018-02-21 11:54 EST (History)
5 users (show)

See Also:
Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2018-02-21 11:54:37 EST
Type: Bug
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: ---


Attachments (Terms of Use)


External Trackers
Tracker ID Priority Status Summary Last Updated
Foreman Issue Tracker 21114 None None None 2017-09-29 16:51 EDT

  None (edit)
Description Ivan Necas 2017-08-02 05:03:23 EDT
Version-Release number of selected component (if applicable):
Sat-6.3 snap 9

How reproducible:
always

Steps to Reproduce:

1. configure network on the host, don't set ip address on the interface eth1
2. try to install dns and dhcp against this interface:

satellite-installer --scenario                   "satellite"\
                  --foreman-proxy-dns            "true"\
                  --foreman-proxy-dns-forwarders "8.8.8.8"\
                  --foreman-proxy-dns-forwarders "8.8.4.4"\
                  --foreman-proxy-dns-interface  "eth1"\
                  --foreman-proxy-dns-zone       "sat63.example.com"\
                  --foreman-proxy-dhcp           "true"\
                  --foreman-proxy-dhcp-interface "eth1"\
                  --foreman-proxy-tftp           "true"\
                  --foreman-proxy-content-puppet "true"\
                  --foreman-proxy-puppetca       "true"\
                  --disable-system-checks

Installer fails with a backtrace, the installer log contains:


[ERROR 2017-08-02 07:21:02 main]  pick(): must receive at least one non empty value at /usr/share/foreman-installer/modules/foreman_proxy/manifests/proxydhcp.pp:6 on node sat63-qa-rhel7.example.com
[ERROR 2017-08-02 07:21:02 main] /usr/share/ruby/vendor_ruby/puppet/util/errors.rb:106:in `fail'
[ERROR 2017-08-02 07:21:02 main] /usr/share/foreman-installer/modules/stdlib/lib/puppet/parser/functions/pick.rb:24:in `block in <module:Functions>'
[ERROR 2017-08-02 07:21:02 main] /usr/share/ruby/vendor_ruby/puppet/parser/functions.rb:164:in `block (2 levels) in newfunction'
[ERROR 2017-08-02 07:21:02 main] /usr/share/ruby/vendor_ruby/puppet/util/profiler/around_profiler.rb:58:in `profile'
[ERROR 2017-08-02 07:21:02 main] /usr/share/ruby/vendor_ruby/puppet/util/profiler.rb:51:in `profile'
[ERROR 2017-08-02 07:21:02 main] /usr/share/ruby/vendor_ruby/puppet/parser/functions.rb:157:in `block in newfunction'
[ERROR 2017-08-02 07:21:02 main] /usr/share/ruby/vendor_ruby/puppet/parser/ast/function.rb:42:in `evaluate



Expected results:
The logs contain info "Could not get the ip address from fact ipaddress_eth1"

Additional info:
This is a regression of http://projects.theforeman.org/issues/16942

The fix should be

   $ip   = pick_default($::foreman_proxy::dhcp_pxeserver, inline_template("<%= scope.lookupvar('::ipaddress_${interface_fact_name}', '') %>"), '')

The friendly error messages are tracked in http://projects.theforeman.org/issues/12662, but thi BZ is just about the more accurate error in the logs
Comment 2 Sachin Ghai 2018-01-03 04:29:50 EST
Verified with sat6.3 snap30. 

Error message is correctly appearing in case user pass the interface when no IP assigned to it:


 ~]# satellite-installer --scenario                   "satellite"\
>                   --foreman-proxy-dns            "true"\
>                   --foreman-proxy-dns-forwarders "8.8.8.8"\
>                   --foreman-proxy-dns-forwarders "8.8.4.4"\
>                   --foreman-proxy-dns-interface  "enp0s29u1u1u5"\
>                   --foreman-proxy-dns-zone       "SAT.example.com"\
>                   --foreman-proxy-dhcp           "true"\
>                   --foreman-proxy-dhcp-interface "enp0s29u1u1u5"\
>                   --foreman-proxy-tftp           "true"\
>                   --foreman-proxy-content-puppet "true"\
>                   --foreman-proxy-puppetca       "true"\
>                   --disable-system-checks


 Could not get the ip address from fact ipaddress_enp0s29u1u1u5 at /usr/share/foreman-installer/modules/foreman_proxy/manifests/proxydhcp.pp:8 on node cloud-qe-03.idmqe.lab.eng.bos.redhat.com
/usr/share/ruby/vendor_ruby/puppet/parser/functions/fail.rb:3:in `block in <top (required)>'
/usr/share/ruby/vendor_ruby/puppet/parser/functions.rb:164:in `block (2 levels) in newfunction'
/usr/share/ruby/vendor_ruby/puppet/util/profiler/around_profiler.rb:58:in `profile'
Comment 3 pm-sat@redhat.com 2018-02-21 11:54:37 EST
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/RHSA-2018:0336

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