Project

General

Profile

Actions

Bug #35080

open

foreman-installer crashes if current value is undef

Added by Ben Magistro over 2 years ago. Updated over 2 years ago.

Status:
New
Priority:
Normal
Assignee:
-
Category:
-
Target version:
-
Difficulty:
Triaged:
No
Fixed in Releases:
Found in Releases:

Description

I've experienced this a couple times now on different versions (working our way up to current 3.3.x (or 3.4 depending on our speed)) but currently experiencing it on 2.0.3.
Using the installer in interactive mode, editing foreman-proxy -> foreman_ssl_ca. The initial value is undef and the installer exits with a `regexperror`. I can probably look at this further once we are up to a current version if the issue persists there too.

OS: CentOS 7.9
TFM: 2.0.3

Error:

/usr/share/gems/gems/highline-1.7.8/lib/highline.rb:1023:in `block in wrap': failed to allocate memory: /([^\n]{94,})/ (RegexpError)
    from /usr/share/gems/gems/highline-1.7.8/lib/highline.rb:1020:in `each_line'
    from /usr/share/gems/gems/highline-1.7.8/lib/highline.rb:1020:in `wrap'
    from /usr/share/gems/gems/highline-1.7.8/lib/highline.rb:723:in `format_statement'
    from /usr/share/gems/gems/highline-1.7.8/lib/highline.rb:621:in `say'
    from /usr/share/gems/gems/kafo-4.0.1/lib/kafo/wizard.rb:127:in `configure'
    from /usr/share/gems/gems/kafo-4.0.1/lib/kafo/wizard.rb:118:in `block (2 levels) in render_params'
    from /usr/share/gems/gems/highline-1.7.8/lib/highline/menu.rb:312:in `call'
    from /usr/share/gems/gems/highline-1.7.8/lib/highline/menu.rb:312:in `select'
    from /usr/share/gems/gems/highline-1.7.8/lib/highline.rb:366:in `choose'
    from /usr/share/gems/gems/kafo-4.0.1/lib/kafo/wizard.rb:78:in `configure_module'
    from /usr/share/gems/gems/kafo-4.0.1/lib/kafo/wizard.rb:51:in `block (3 levels) in main_menu'
    from /usr/share/gems/gems/highline-1.7.8/lib/highline/menu.rb:312:in `call'
    from /usr/share/gems/gems/highline-1.7.8/lib/highline/menu.rb:312:in `select'
    from /usr/share/gems/gems/highline-1.7.8/lib/highline.rb:366:in `choose'
    from /usr/share/gems/gems/kafo-4.0.1/lib/kafo/wizard.rb:45:in `main_menu'
    from /usr/share/gems/gems/kafo-4.0.1/lib/kafo/wizard.rb:33:in `run'
    from /usr/share/gems/gems/kafo-4.0.1/lib/kafo/kafo_configure.rb:142:in `execute'
    from /usr/share/gems/gems/clamp-1.1.2/lib/clamp/command.rb:63:in `run'
    from /usr/share/gems/gems/kafo-4.0.1/lib/kafo/kafo_configure.rb:118:in `run'
    from /usr/share/gems/gems/clamp-1.1.2/lib/clamp/command.rb:132:in `run'
    from /usr/share/gems/gems/kafo-4.0.1/lib/kafo/kafo_configure.rb:162:in `run'
    from /sbin/foreman-installer:8:in `<main>'

Actions #1

Updated by Ben Magistro over 2 years ago

I can confirm this is still present in 3.3.0. Updated traceback is below.

Traceback (most recent call last):
        34: from /sbin/foreman-installer:8:in `<main>'
        33: from /opt/theforeman/tfm/root/usr/share/gems/gems/kafo-6.4.0/lib/kafo/kafo_configure.rb:50:in `run'
        32: from /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.1.2/lib/clamp/command.rb:132:in `run'
        31: from /opt/theforeman/tfm/root/usr/share/gems/gems/kafo-6.4.0/lib/kafo/kafo_configure.rb:180:in `run'
        30: from /opt/theforeman/tfm/root/usr/share/gems/gems/clamp-1.1.2/lib/clamp/command.rb:63:in `run'
        29: from /opt/theforeman/tfm/root/usr/share/gems/gems/kafo-6.4.0/lib/kafo/kafo_configure.rb:202:in `execute'
        28: from /opt/theforeman/tfm/root/usr/share/gems/gems/kafo-6.4.0/lib/kafo/wizard.rb:37:in `run'
        27: from /opt/theforeman/tfm/root/usr/share/gems/gems/kafo-6.4.0/lib/kafo/wizard.rb:49:in `main_menu'
        26: from /opt/rh/rh-ruby27/root/usr/share/ruby/forwardable.rb:235:in `choose'
        25: from /opt/theforeman/tfm/root/usr/share/gems/gems/highline-2.0.3/lib/highline.rb:277:in `choose'
        24: from /opt/theforeman/tfm/root/usr/share/gems/gems/highline-2.0.3/lib/highline/menu.rb:415:in `select'
        23: from /opt/theforeman/tfm/root/usr/share/gems/gems/highline-2.0.3/lib/highline/menu.rb:449:in `value_for_selected_item'
        22: from /opt/theforeman/tfm/root/usr/share/gems/gems/kafo-6.4.0/lib/kafo/wizard.rb:55:in `block (3 levels) in main_menu'
        21: from /opt/theforeman/tfm/root/usr/share/gems/gems/kafo-6.4.0/lib/kafo/wizard.rb:82:in `configure_module'
        20: from /opt/rh/rh-ruby27/root/usr/share/ruby/forwardable.rb:235:in `choose'
        19: from /opt/theforeman/tfm/root/usr/share/gems/gems/highline-2.0.3/lib/highline.rb:277:in `choose'
        18: from /opt/theforeman/tfm/root/usr/share/gems/gems/highline-2.0.3/lib/highline/menu.rb:415:in `select'
        17: from /opt/theforeman/tfm/root/usr/share/gems/gems/highline-2.0.3/lib/highline/menu.rb:449:in `value_for_selected_item'
        16: from /opt/theforeman/tfm/root/usr/share/gems/gems/kafo-6.4.0/lib/kafo/wizard.rb:92:in `block (3 levels) in configure_module'
        15: from /opt/theforeman/tfm/root/usr/share/gems/gems/kafo-6.4.0/lib/kafo/wizard.rb:105:in `configure_group'
        14: from /opt/rh/rh-ruby27/root/usr/share/ruby/forwardable.rb:235:in `choose'
        13: from /opt/theforeman/tfm/root/usr/share/gems/gems/highline-2.0.3/lib/highline.rb:277:in `choose'
        12: from /opt/theforeman/tfm/root/usr/share/gems/gems/highline-2.0.3/lib/highline/menu.rb:415:in `select'
        11: from /opt/theforeman/tfm/root/usr/share/gems/gems/highline-2.0.3/lib/highline/menu.rb:449:in `value_for_selected_item'
        10: from /opt/theforeman/tfm/root/usr/share/gems/gems/kafo-6.4.0/lib/kafo/wizard.rb:122:in `block (2 levels) in render_params'
         9: from /opt/theforeman/tfm/root/usr/share/gems/gems/kafo-6.4.0/lib/kafo/wizard.rb:131:in `configure'
         8: from /opt/rh/rh-ruby27/root/usr/share/ruby/forwardable.rb:235:in `say'
         7: from /opt/theforeman/tfm/root/usr/share/gems/gems/highline-2.0.3/lib/highline.rb:374:in `say'
         6: from /opt/theforeman/tfm/root/usr/share/gems/gems/highline-2.0.3/lib/highline.rb:393:in `render_statement'
         5: from /opt/theforeman/tfm/root/usr/share/gems/gems/highline-2.0.3/lib/highline/statement.rb:45:in `to_s'
         4: from /opt/theforeman/tfm/root/usr/share/gems/gems/highline-2.0.3/lib/highline/statement.rb:39:in `statement'
         3: from /opt/theforeman/tfm/root/usr/share/gems/gems/highline-2.0.3/lib/highline/statement.rb:63:in `format_statement'
         2: from /opt/theforeman/tfm/root/usr/share/gems/gems/highline-2.0.3/lib/highline/wrapper.rb:22:in `wrap'
         1: from /opt/theforeman/tfm/root/usr/share/gems/gems/highline-2.0.3/lib/highline/wrapper.rb:22:in `each_line'
/opt/theforeman/tfm/root/usr/share/gems/gems/highline-2.0.3/lib/highline/wrapper.rb:25:in `block in wrap': failed to allocate memory: /([^\\n]{94,})/ (RegexpError)
Actions #2

Updated by Ben Magistro over 2 years ago

Believe this bug needs to be moved to kafo and may duplicate https://projects.theforeman.org/issues/20223 with the underlying issue possibly being in highline and not kafo. I don't ruby enough to take this further without some guidance.

From some crude additional testing/digging, it appears the issue is tied to `say` on https://github.com/theforeman/kafo/blob/master/lib/kafo/wizard.rb#L131 . Changing this to `puts` for testing produces the following output `Data type: regexes matching /\A(([a-zA-Z]:[\\\/])|([\\\/][\\\/][^\\\/]+[\\\/][^\\\/]+)|([\\\/][\\\/]\?[\\\/][^\\\/]+)).*\z/ or regexes matching /\A\/([^\n\/\0]+\/*)*\z/ or undef`. This makes me think `say` is trying do something and the regex for this data type is causing a conflict. Using `puts` or removing this line seems to make the installer happy from the little testing I've done.

Actions

Also available in: Atom PDF