Bug #33754
closedpuppet runs fail after Foreman 3.0.0 upgrade from 2.5.3
Description
I successfully upgraded our DEV foreman instance from 2.5.3 to 3.0.0 after uninstalling the "tfm-rubygem-foreman_expire_hosts" plugin that caused the db:migrate script to fail however, the same was not true on our production server. The Upgrade appeared to work and the UI was accessible but 74 hosts reported puppet run errors...
Warning: Error 500 on SERVER: Server Error: Failed to find ${NODE} via exec: Execution of '/etc/puppetlabs/puppet/node.rb ${NODE}' returned 1:
"foreman-rake config" produced
ActiveRecord::SubclassNotFound: The single-table inheritance mechanism failed to locate the subclass: 'Setting::ExpireHosts'. This error is raised because the column 'category' is reserved for storing the class in case of inheritance. Please rename this column if you didn't intend it to be used for storing the inheritance class or overwrite Setting.inheritance_column to use another column for that information.
I ran...
"delete from settings where category='Setting::ExpireHosts';"
on the database and this allowed "foreman-rake config" to return successfully, unfortunately it did not fix the puppet client error.
Looking at the production.log I see... (full stack attached to this ticket.)
2021-10-20T14:20:22 [I|app|e022815c] Backtrace for 'Failed to generate external nodes for ${NODE}' error (TypeError): no implicit conversion of nil into Array
/opt/theforeman/tfm/root/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/relation/delegation.rb:87:in `+'
/opt/theforeman/tfm/root/usr/share/gems/gems/activerecord-6.0.3.7/lib/active_record/relation/delegation.rb:87:in `+'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_puppet-1.0.3/app/services/foreman_puppet/host_info_providers/config_groups_info.rb:7:in `host_info'
/usr/share/foreman/app/models/concerns/host_info_extensions.rb:27:in `block in info'
/usr/share/foreman/app/models/concerns/host_info_extensions.rb:25:in `each'
/usr/share/foreman/app/models/concerns/host_info_extensions.rb:25:in `info'
/opt/theforeman/tfm/root/usr/share/gems/gems/foreman_puppet-1.0.3/app/controllers/concerns/foreman_puppet/extensions/hosts_controller_extensions.rb:100:in `block in externalNodes'
I am unsure what the difference is between our DEV and PROD instances are as DEV was originally copied from PROD, obviously they have drifted somewhat now but not from a foreman rpm or plugin perspective.
I have reverted PROD back to the 2.5.3 snapshot but I could do with some help on trying to understand and fix the issue.
Please let me know what additional information you require.
Current production foreman packages and plugins
foreman-2.5.3-1.el7.noarch
foreman-cli-2.5.3-1.el7.noarch
foreman-debug-2.5.3-1.el7.noarch
foreman-dynflow-sidekiq-2.5.3-1.el7.noarch
foreman-ec2-2.5.3-1.el7.noarch
foreman-installer-2.5.3-1.el7.noarch
foreman-postgresql-2.5.3-1.el7.noarch
foreman-proxy-2.5.3-1.el7.noarch
foreman-release-2.5.3-1.el7.noarch
foreman-service-2.5.3-1.el7.noarch
foreman-vmware-2.5.3-1.el7.noarch
rubygem-foreman_maintain-0.8.6-1.el7.noarch
tfm-rubygem-foreman_bootdisk-17.1.0-1.fm2_5.el7.noarch
tfm-rubygem-foreman_column_view-0.4.0-5.fm2_5.el7.noarch
tfm-rubygem-foreman_default_hostgroup-6.0.0-1.fm2_5.el7.noarch
tfm-rubygem-foreman_dhcp_browser-0.0.8-5.fm2_5.el7.noarch
tfm-rubygem-foreman_discovery-17.0.1-1.fm2_5.el7.noarch
tfm-rubygem-foreman_expire_hosts-7.0.4-2.fm2_5.el7.noarch # This is what I removed on our DEV server to complete the DB migration.
tfm-rubygem-foreman_hooks-0.3.17-2.fm2_5.el7.noarch
tfm-rubygem-foreman_memcache-0.1.1-4.fm2_5.el7.noarch
tfm-rubygem-foreman_remote_execution-4.5.6-1.fm2_5.el7.noarch
tfm-rubygem-foreman_remote_execution_core-1.4.8-1.el7.noarch
tfm-rubygem-foreman_setup-7.0.0-3.fm2_5.el7.noarch
tfm-rubygem-foreman-tasks-4.1.5-1.fm2_5.el7.noarch
tfm-rubygem-foreman-tasks-core-0.3.6-1.fm2_5.el7.noarch
tfm-rubygem-hammer_cli_foreman-2.5.1-1.el7.noarch
Thanks in advance.
Files