On node retrieval receiving a stack error it's related to ansible and expire hosts plugins

Problem:
/etc/puppetlabs/puppet/node.rb sa1x-foreman-p1.harlandclarke.local
—outputs this into the production.log:

2018-02-19 17:24:37 6b1c844f [app] [I] Started GET "/node/sa1x-foreman-p1.harlandclarke.local?format=yml" for 127.0.0.1 at 2018-02-19 17:24:37 -0600
2018-02-19 17:24:37 6b1c844f [app] [I] Processing by HostsController#externalNodes as YML
2018-02-19 17:24:37 6b1c844f [app] [I]   Parameters: {"name"=>"sa1x-foreman-p1.harlandclarke.local"}
2018-02-19 17:24:37 6b1c844f [app] [I] Current user: foreman_api_admin (administrator)
2018-02-19 17:24:37 6b1c844f [app] [W] Action failed
 | SystemStackError: stack level too deep
 | /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_controller/metal/strong_parameters.rb:462:in `convert_value_to_parameters'
 | /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_controller/metal/strong_parameters.rb:456:in `convert_hashes_to_parameters'
 | /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_controller/metal/strong_parameters.rb:351:in `[]'
 | /opt/rh/sclo-ror42/root/usr/share/gems/gems/activesupport-4.2.5.1/lib/active_support/hash_with_indifferent_access.rb:69:in `default'
 | /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_controller/metal/strong_parameters.rb:351:in `[]'
 | /opt/rh/sclo-ror42/root/usr/share/gems/gems/actionpack-4.2.5.1/lib/action_controller/metal/strong_parameters.rb:351:in `[]'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_expire_hosts-4.0.0/app/controllers/concerns/foreman_expire_hosts/host_controller_extensions.rb:64:in `action_permission'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_ansible-1.4.6/app/controllers/foreman_ansible/concerns/hosts_controller_extensions.rb:37:in `action_permission_with_ansible'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_expire_hosts-4.0.0/app/controllers/concerns/foreman_expire_hosts/host_controller_extensions.rb:68:in `action_permission'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_ansible-1.4.6/app/controllers/foreman_ansible/concerns/hosts_controller_extensions.rb:37:in `action_permission_with_ansible'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_expire_hosts-4.0.0/app/controllers/concerns/foreman_expire_hosts/host_controller_extensions.rb:68:in `action_permission'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_ansible-1.4.6/app/controllers/foreman_ansible/concerns/hosts_controller_extensions.rb:37:in `action_permission_with_ansible'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_expire_hosts-4.0.0/app/controllers/concerns/foreman_expire_hosts/host_controller_extensions.rb:68:in `action_permission'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_ansible-1.4.6/app/controllers/foreman_ansible/concerns/hosts_controller_extensions.rb:37:in `action_permission_with_ansible'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_expire_hosts-4.0.0/app/controllers/concerns/foreman_expire_hosts/host_controller_extensions.rb:68:in `action_permission'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_ansible-1.4.6/app/controllers/foreman_ansible/concerns/hosts_controller_extensions.rb:37:in `action_permission_with_ansible'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_expire_hosts-4.0.0/app/controllers/concerns/foreman_expire_hosts/host_controller_extensions.rb:68:in `action_permission'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_ansible-1.4.6/app/controllers/foreman_ansible/concerns/hosts_controller_extensions.rb:37:in `action_permission_with_ansible'
 | /opt/theforeman/tfm/root/usr/share/gems/gems/foreman_expire_hosts-4.0.0/app/controllers/concerns/foreman_expire_hosts/host_controller_extensions.rb:68:in `action_permission'
:

**Expected outcome:return facter info

Foreman and Proxy versions:

foreman.noarch                              1.16.0-1.el7        @foreman
foreman-cli.noarch                          1.16.0-1.el7        @foreman
foreman-debug.noarch                        1.16.0-1.el7        @foreman
foreman-installer.noarch                    1:1.16.0-1.el7      @foreman
foreman-postgresql.noarch                   1.16.0-1.el7        @foreman
foreman-proxy.noarch                        1.16.0-1.el7        @foreman
foreman-release.noarch                      1.16.0-1.el7        installed
foreman-release-scl.noarch                  3-1.el7             @foreman
foreman-selinux.noarch                      1.16.0-1.el7        @foreman
foreman-vmware.noarch                       1.16.0-1.el7        @foreman
tfm-rubygem-foreman_remote_execution_core.noarch
tfm-rubygem-hammer_cli_foreman.noarch       0.11.0-1.el7        @foreman

Foreman and Proxy plugin versions:

tfm-rubygem-foreman-tasks.noarch            0.10.9-1.fm1_16.el7 @foreman-plugins
tfm-rubygem-foreman-tasks-core.noarch       0.2.4-1.fm1_16.el7  @foreman-plugins
tfm-rubygem-foreman_ansible.noarch          1.4.6-1.fm1_16.el7  @foreman-plugins
tfm-rubygem-foreman_ansible_core.noarch     1.1.1-1.fm1_16.el7  @foreman-plugins
tfm-rubygem-foreman_bootdisk.noarch         10.0.2-1.fm1_16.el7 @foreman-plugins
tfm-rubygem-foreman_expire_hosts.noarch     4.0.0-1.fm1_16.el7  @foreman-plugins
tfm-rubygem-foreman_hooks.noarch            0.3.14-1.fm1_16.el7 @foreman-plugins
tfm-rubygem-foreman_remote_execution.noarch 1.3.3-1.fm1_16.el7  @foreman-plugins
tfm-rubygem-foreman_setup.noarch            5.0.0-1.fm1_13.el7  @foreman-plugins

Other relevant data:
If I remove expire_hosts or ansible rubygems everything is fine. I just don’t know what specifically is causing the issue.

I believe that the reason for causing the issues you are seeing was addressed in https://github.com/theforeman/foreman_ansible/commit/eb3c420c4e4ad756beabca0141f1c1053af921a1#diff-304db8e3bfa0838c57354a2265e70e81

1 Like

Thank you, I don’t know if I would have found that on my own but that has solved the problem.

1 Like